Registry / utility / petgraph

petgraph

JSON →
library0.8.3rscratesunverified

Graph data structure library. Provides graph types and graph algorithms.

# Cargo.toml [dependencies] petgraph = "0.8.3"
INSTALL
IMPORT
SIG · PETGRAPH
P
petgraph
utilityrustv0.8.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Graph
use petgraph::Graph;

Create a directed graph with labeled nodes and edges.

use petgraph::Graph; fn main() { let mut graph = Graph::<&str, i32>::new(); let a = graph.add_node("A"); let b = graph.add_node("B"); graph.add_edge(a, b, 1); println!("Graph: {:?}", graph); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.8.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
petgraph — cargo add petgraph · libregistry