Skip to content

Commit

Permalink
lint: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Nov 12, 2022
1 parent ec80c8e commit 74d5257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/graphs/dijkstra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use std::ops::Add;

type Graph<V, E> = BTreeMap<V, BTreeMap<V, E>>;

// performs Dijsktra's algorithm on the given graph from the given start
// the graph is a positively-weighted undirected graph
// Performs Dijsktra's algorithm on the given `graph` from the given `start`.
// `graph` is a positively-weighted undirected graph.
//
// returns a map that for each reachable vertex associates the distance and the predecessor
// since the start has no predecessor but is reachable, map[start] will be None
// Returns a map that for each reachable vertex associates its distance to its predecessor.
// Since the start has no predecessor but is reachable, `map[start]` will be `None`.
pub fn dijkstra<V: Ord + Copy, E: Ord + Copy + Add<Output = E>>(
graph: &Graph<V, E>,
start: &V,
Expand Down Expand Up @@ -155,4 +155,4 @@ mod tests {
dists_e.insert('b', Some(('c', 39)));
assert_eq!(dijkstra(&graph, &'e'), dists_e);
}
}
}
2 changes: 1 addition & 1 deletion src/graphs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod breadth_first_search;
mod depth_first_search;
mod representation;
mod dijkstra;
mod representation;

pub use self::breadth_first_search::breadth_first_search;
pub use self::depth_first_search::depth_first_search;
Expand Down

0 comments on commit 74d5257

Please sign in to comment.