Commit ad51d7f
docs: add comprehensive graph documentation with examples
Add GRAPH_GUIDE.md with detailed explanations of how to use this library
with traditional graph structures (nodes, edges, weights). The guide covers:
- Core concept of successor functions for weighted and unweighted graphs
- Five graph representation examples (adjacency list, adjacency matrix,
edge list, struct-based, and unweighted graphs)
- Usage examples for Dijkstra, A*, and BFS algorithms
- Practical spatial shortest paths example
- Guidance on converting from R/Python graph libraries
- Tips, best practices, and common patterns
Add four working example files demonstrating different approaches:
- graph-adjacency-list.rs: Dijkstra with adjacency list
- graph-adjacency-matrix.rs: A* with adjacency matrix
- graph-struct.rs: Encapsulated graph logic in a struct
- graph-unweighted-bfs.rs: BFS with unweighted graph
Add comprehensive test suite (tests/graph_guide_examples.rs) with 6 tests
covering all self-contained examples in the documentation to ensure they
compile and produce expected results.
Update README.md to link to the new graph guide.
Update Cargo.toml to include GRAPH_GUIDE.md in package distribution so it
appears in generated documentation.
Fix pre-existing clippy error in sliding-puzzle example by deriving
PartialEq and Eq instead of manual implementation.
Fixes #675
Co-authored-by: samueltardieu <44656+samueltardieu@users.noreply.github.com>1 parent c6965e0 commit ad51d7f
File tree
10 files changed
+1363
-12
lines changed- examples
- src
- tests
10 files changed
+1363
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
15 | 27 | | |
16 | 28 | | |
17 | 29 | | |
| |||
0 commit comments