# petgraph

> Graph data structures and algorithms for Rust

Source: https://talira.ai/catalog/petgraph-mx67bvxd
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / math / graph theory](https://talira.ai/categories/libraries/math/graph-theory), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^1][^2][^3]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [petgraph](https://talira.ai/orgs/petgraph.md)

petgraph provides fast, flexible graph data structures and algorithms in [Rust](https://talira.ai/catalog/rust-mf51vs5t.md), for directed and undirected graphs with arbitrary node and edge data. It has several graph types (Graph, StableGraph, GraphMap and MatrixGraph), algorithms such as shortest paths, minimum spanning trees and graph isomorphism with traits for writing your own, and DOT import and export for visualising graphs with [Graphviz](https://talira.ai/catalog/graphviz-vpswh7h8.md).

## Links

- GitHub: https://github.com/petgraph/petgraph
- Docs: https://docs.rs/petgraph

## Problems it solves

- find shortest paths in a graph in Rust
- model a dependency graph in Rust
- graph algorithms like minimum spanning tree in Rust

## Features

- Graph, StableGraph, GraphMap and MatrixGraph types
- path-finding, spanning trees and isomorphism algorithms
- traits for custom algorithms
- DOT import and export

## Trust

Overall: 0.57 out of 1.
Signals: maintenance 0.73, adoption 0.72, momentum 0.44, community 0.86, backing 0.30, extensibility 0.00.

- last commit 15 days ago
- 19 commits in the last 90 days
- latest release petgraph@v0.8.3 14 months ago
- 4.1k GitHub stars
- 144 contributors
- has a company behind it

## Sources

[^1]: https://github.com/petgraph/petgraph/blob/master/Cargo.toml (checked 29 Nov 2026)
[^2]: https://github.com/petgraph/petgraph/blob/master/LICENSE-MIT (checked 29 Nov 2026)
[^3]: https://github.com/petgraph/petgraph/blob/master/LICENSE-APACHE (checked 29 Nov 2026)
