graph/lib.rs
1#![warn(missing_docs)]
2
3//! # graph
4//!
5//! A complete, workspace-wide re-export of all graph data structures and
6//! algorithms in the `graph-rs` library.
7//!
8//! Import this crate and use the [`prelude`] to get everything in scope:
9//!
10//! ```
11//! use graph::prelude::*;
12//!
13//! let mut g: AdjacencyList<&str> = AdjacencyList::directed();
14//! let a = g.add_node("A");
15//! let b = g.add_node("B");
16//! g.add_edge(a, b, 1.0).unwrap();
17//!
18//! let result = dijkstra(&g, a).unwrap();
19//! assert!(result.distances.contains_key(&b));
20//! ```
21//!
22//! ## Crates in this workspace
23//!
24//! | Crate | Contents |
25//! |-----------------------|---------------------------------------------------|
26//! | `graph-collections` | Stack, Queue, Deque, MinHeap, PriorityQueue, UnionFind |
27//! | `graph-core` | Graph trait, AdjacencyList, AdjacencyMatrix |
28//! | `graph-traversal` | DFS, BFS, topological sort, cycle detection |
29//! | `graph-shortest-path` | Dijkstra, Bellman-Ford, Floyd-Warshall, A\* |
30//! | `graph-spanning` | Kruskal, Prim, bridges, articulation points |
31//! | `graph-flow` | Ford-Fulkerson, Edmonds-Karp, min-cut, Hopcroft-Karp |
32//! | `graph-advanced` | Tarjan SCC, Kosaraju SCC, Euler, Hamiltonian, TSP |
33
34/// Brings the entire `graph-rs` public API into scope.
35///
36/// ```
37/// use graph::prelude::*;
38/// ```
39pub mod prelude {
40 pub use graph_advanced::*;
41 pub use graph_collections::*;
42 pub use graph_core::*;
43 pub use graph_flow::*;
44 pub use graph_shortest_path::*;
45 // graph_spanning re-exports DisjointSet which conflicts with
46 // graph_collections::DisjointSet — export spanning items explicitly.
47 pub use graph_spanning::{articulation_points, bridges, kruskal, prim, SpanningTree};
48 pub use graph_traversal::*;
49}