#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

#48 in Data structures

Download history 1183615/week @ 2024-07-06 1147438/week @ 2024-07-13 1153157/week @ 2024-07-20 1137392/week @ 2024-07-27 1138106/week @ 2024-08-03 1192340/week @ 2024-08-10 1216541/week @ 2024-08-17 1245077/week @ 2024-08-24 1160740/week @ 2024-08-31 1247474/week @ 2024-09-07 1146155/week @ 2024-09-14 1253453/week @ 2024-09-21 1277947/week @ 2024-09-28 1308739/week @ 2024-10-05 1339437/week @ 2024-10-12 1366605/week @ 2024-10-19

5,497,959 downloads per month
Used in 5,845 crates (633 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