#graph-algorithms #graph #union-find

petgraph

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

71 releases

0.6.5 May 8, 2024
0.6.4 Aug 21, 2023
0.6.3 Feb 7, 2023
0.6.2 May 28, 2022
0.0.11 Mar 26, 2015

#50 in Data structures

Download history 1140162/week @ 2024-07-30 1163378/week @ 2024-08-06 1187390/week @ 2024-08-13 1217212/week @ 2024-08-20 1173162/week @ 2024-08-27 1251100/week @ 2024-09-03 1225308/week @ 2024-09-10 1150468/week @ 2024-09-17 1289116/week @ 2024-09-24 1271851/week @ 2024-10-01 1287850/week @ 2024-10-08 1372789/week @ 2024-10-15 1359035/week @ 2024-10-22 1288977/week @ 2024-10-29 1272245/week @ 2024-11-05 1101383/week @ 2024-11-12

5,263,145 downloads per month
Used in 5,964 crates (645 directly)

MIT/Apache

1MB
14K SLoC

petgraph

Graph data structure library. Please read the API documentation here.

Supports Rust 1.64 and later.

Crates.io docs.rs MSRV Discord chat build_status

Crate feature flags:

  • graphmap (default) enable GraphMap.
  • stable_graph (default) enable StableGraph.
  • matrix_graph (default) enable MatrixGraph.
  • serde-1 (optional) enable serialization for Graph, StableGraph, GraphMap using serde 1.0. Requires Rust version as required by serde.
  • rayon (optional) enable parallel iterators for the underlying data in GraphMap. Requires Rust version as required by Rayon.

Recent Changes

See RELEASES for a list of changes. The minimum supported rust version will only change on major releases.

The mascot is named "Sir Paul Rustory Graphosaurus" (close friends call him Paul). The logo has been created by the talented Aren.

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

Dependencies

~0.8–1.7MB
~28K SLoC