Graaf

Functions and types for working with graphs
WARNING: this crate is in early alpha. The API is unstable.
Algorithms
algo::bfs::min_distances_single_sourcealgo::bfs::min_distancesalgo::bfs::predecessorsalgo::dijkstra::min_distances_single_sourcealgo::dijkstra::min_distancesalgo::dijkstra::predecessors
Graph operation traits
These traits are implemented for various graph representations built from standard library containers.
ops::AddEdgeadds an edge to an unweighted graph.ops::AddWeightedEdgeadds an edge to a weighted graph.ops::CountAllEdgescounts all edges in a graph.ops::CountAllVerticescounts all vertices in a graph.ops::EdgeWeightgets the weight of an edge.ops::Indegreereturns the indegree of a vertex.ops::IsEdgereturns whether an edge exists between two vertices.ops::IterAllEdgesiterates over all unweighted edges in a graph.ops::IterAllWeightedEdgesiterates over all weighted edges in a graph.ops::IterEdgesiterates over all unweighted edges of a source vertex.ops::IterVerticesiterates over all vertices in a graph.ops::IterWeightedEdgesiterates over all weighted edges of a source vertex.ops::Outdegreereturns the outdegree of a vertex.ops::RemoveEdgeremoves an edge from a graph.ops::VertexWeightreturns the weight of a vertex.
Graph representations
Adjacency list
Unweighted
Vec<Vec<usize>>Vec<HashSet<usize>>[Vec<usize>][HashSet<usize>]HashMap<usize, Vec<usize>>HashMap<usize, HashSet<usize>>
Weighted
Vec<Vec<(usize, W)>>Vec<HashSet<(usize, W)>>Vec<HashMap<usize, W>>[Vec<(usize, W)>][HashSet<(usize, W)>][HashMap<usize, W>]HashMap<usize, Vec<(usize, W)>>HashMap<usize, HashSet<(usize, W)>>HashMap<usize, HashMap<usize, W>>
Adjacency matrix
Unweighted
AdjacencyMatrix: an adjacency matrix representation of an unweighted directed graph stored as a bit array.
Edge list
Unweighted
Vec<(usize, usize)>[(usize, usize)]HashSet<(usize, usize)>
Weighted
Vec<(usize, usize, W)>[(usize, usize, W)]HashSet<(usize, usize, W)>