Crate graph

Crate graph 

Source
Expand description

§graph

A complete, workspace-wide re-export of all graph data structures and algorithms in the graph-rs library.

Import this crate and use the prelude to get everything in scope:

use graph::prelude::*;

let mut g: AdjacencyList<&str> = AdjacencyList::directed();
let a = g.add_node("A");
let b = g.add_node("B");
g.add_edge(a, b, 1.0).unwrap();

let result = dijkstra(&g, a).unwrap();
assert!(result.distances.contains_key(&b));

§Crates in this workspace

CrateContents
graph-collectionsStack, Queue, Deque, MinHeap, PriorityQueue, UnionFind
graph-coreGraph trait, AdjacencyList, AdjacencyMatrix
graph-traversalDFS, BFS, topological sort, cycle detection
graph-shortest-pathDijkstra, Bellman-Ford, Floyd-Warshall, A*
graph-spanningKruskal, Prim, bridges, articulation points
graph-flowFord-Fulkerson, Edmonds-Karp, min-cut, Hopcroft-Karp
graph-advancedTarjan SCC, Kosaraju SCC, Euler, Hamiltonian, TSP

Modules§

prelude
Brings the entire graph-rs public API into scope.