Crate petgraph

Source
Expand description

petgraph is a graph data structure library.

  • Graph which is an adjacency list graph with arbitrary associated data.

  • StableGraph is similar to Graph, but it keeps indices stable across removals.

  • GraphMap is an adjacency list graph which is backed by a hash table and the node identifiers are the keys into the table.

  • CSR is a sparse adjacency matrix graph with arbitrary associated data.

Optional crate feature: "serde-1", see the Readme for more information.

Re-exportsΒ§

pub use graph::Graph;
pub use Direction::Outgoing;
pub use Direction::Incoming;

ModulesΒ§

algo
Graph algorithms.
astar πŸ”’
csr
Compressed Sparse Row (CSR) is a sparse adjacency matrix graph.
data
Graph traits for associated data and graph construction.
dijkstra πŸ”’
dot
Simple graphviz dot file format output.
graph
Graph<N, E, Ty, Ix> is a graph datastructure using an adjacency list representation.
graph_impl πŸ”’
graphmap
GraphMap<N, E, Ty> is a graph datastructure where node values are mapping keys.
isomorphism πŸ”’
iter_format πŸ”’
Formatting utils
iter_utils πŸ”’
macros πŸ”’
prelude
Commonly used items.
scored πŸ”’
stable_graph
StableGraph keeps indices stable across removals.
traits_graph πŸ”’
unionfind
UnionFind<K> is a disjoint-set data structure.
util πŸ”’
visit
Graph traits and graph traversals.

MacrosΒ§

copyclone πŸ”’

EnumsΒ§

Directed
Marker type for a directed graph.
Direction
Edge direction.
Undirected
Marker type for an undirected graph.

TraitsΒ§

EdgeType
A graph’s edge type determines whether is has directed edges or not.
IntoWeightedEdge
Convert an element like (i, j) or (i, j, w) into a triple of source, target, edge weight.