A fast, flexible graph data structure library for Rust with multiple graph types and built-in algorithms.
Petgraph is a comprehensive graph data structure library for Rust that provides efficient implementations for working with graphs. It supports both directed and undirected graphs with arbitrary node and edge data, making it suitable for a wide range of applications from network analysis to dependency resolution.
Rust developers who need to implement graph-based computations, such as those working on network analysis, dependency resolution, pathfinding, or data modeling that requires graph structures.
Developers choose Petgraph for its combination of performance, flexibility, and Rust's safety guarantees, along with built-in algorithms and support for multiple graph types to suit different use cases.
Graph data structure library for Rust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers Graph, StableGraph, GraphMap, and MatrixGraph, each optimized for different performance and mutability needs, as highlighted in the README's key features.
Includes essential operations like Dijkstra's shortest path and minimum spanning trees, saving development time for common graph tasks, demonstrated in the example code.
Exposes traits for implementing custom algorithms, allowing easy extension without modifying core library code, per the philosophy section.
Can be used in embedded environments by disabling the default std feature, making it suitable for resource-constrained applications, as noted in the crate features.
The README warns of a multi-crate transition in the development version, which could introduce breaking changes and require adjustments for users upgrading.
Visualization is restricted to DOT format export, requiring external Graphviz tools for rendering, which may not suit projects needing built-in or interactive graph display.
Parallel iterators are only available for GraphMap with the rayon feature enabled, limiting performance benefits for other graph types without additional configuration.