Skip to content

Commit dd2541c

Browse files
authored
docs: Fix link and mention Dfs and Bfs as special case in examples (#816)
I just noticed that the link for the example `Using algorithms on graphs` in the docs does not work properly because there was a typo. While at it, I also added a sentence about `Dfs` and `Bfs` not being found in the algo module and instead in visit. Similarly, I added links to the docstring of the `Topo` struct which was referring to other functions/algs without linking to them.
1 parent 5fdd192 commit dd2541c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ module documentation lists the available shorthand types.
169169
170170
* [Creating an undirected graph and manipulating nodes and edges](#creating-an-undirected-graph-and-manipulating-nodes-and-edges)
171171
* [Differences of stable and non-stable graphs in index management](#differences-of-stable-and-non-stable-graphs-in-index-management)
172-
* [Using algorithms on graphs](#usign-algorithms-on-graphs)
172+
* [Using algorithms on graphs](#using-algorithms-on-graphs)
173173
* [Associating data with nodes and edges and transmuting the type of the data](#associating-data-with-nodes-and-edges-and-transmuting-the-type-of-the-data)
174174
* [Exporting graphs to DOT format](#exporting-graphs-to-dot-format)
175175
@@ -280,8 +280,9 @@ Petgraph provides not only data structures for modeling graphs, but also a wide
280280
that can be applied to them. For example, given a graph, one can compute shortest paths,
281281
minimum spanning trees, or even compute the maximal cliques of a graph.
282282
283-
Generally, algorithms are found in the [`algo`] module. All of them should include an example of
284-
how to use them. For example, to compute the minimum spanning tree of a graph, one can use the
283+
Generally, algorithms are found in the [`algo`] module, except for algorithms like
284+
depth-/breadth-first-search, which can be found in the [visit] module. All of them should include
285+
an example of how to use them. For example, to compute the minimum spanning tree of a graph, one can use the
285286
[`min_spanning_tree`](algo/min_spanning_tree/fn.min_spanning_tree.html) function.
286287
287288
```

src/visit/traversal.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,9 @@ where
311311
/// A topological order traversal for a graph.
312312
///
313313
/// **Note** that `Topo` only visits nodes that are not part of cycles,
314-
/// i.e. nodes in a true DAG. Use other visitors like `DfsPostOrder` or
315-
/// algorithms like kosaraju_scc to handle graphs with possible cycles.
314+
/// i.e. nodes in a true DAG. Use other visitors like [`DfsPostOrder`] or
315+
/// algorithms like [`kosaraju_scc`][crate::algo::kosaraju_scc] to handle
316+
/// graphs with possible cycles.
316317
#[derive(Clone)]
317318
pub struct Topo<N, VM> {
318319
tovisit: Vec<N>,

0 commit comments

Comments
 (0)