Graph data structure library. Requires Rust 1.12.
Please read the API documentation here
__
__ https://docs.rs/petgraph/
|buildstatus| |crates|_
.. |buildstatus| image:: https://travis-ci.org/bluss/petgraph.svg?branch=master .. _buildstatus: https://travis-ci.org/bluss/petgraph
.. |crates| image:: http://meritbadge.herokuapp.com/petgraph .. _crates: https://crates.io/crates/petgraph
Crate feature flags:
graphmap
(default) enable GraphMap
.stable_graph
(default) enable StableGraph
.0.3.0
Overhaul all graph visitor traits so that they use the IntoIterator
style. This makes them composable.
Multiple graph algorithms use new visitor traits.
Help is welcome to port more algorithms (and create new graph traits in the process)!
GraphMap
can now have directed edges. GraphMap::new
is now generic
in the edge type. DiGraphMap
and UnGraphMap
are new type aliases.
DiGraph, UnGraph, StableDiGraph, StableUnGraph
GraphMap
is based on the ordermap crate. Deterministic iteration
order, faster iteration, no side tables needed to convert to Graph
.DfsPostOrder
Dfs
gained new methods from_parts
and reset
.has_path_connecting
.tarjan_scc
, a second scc implementation.Dfs, DfsPostOrder, scc, tarjan_scc
.has_path_connecting
,
is_cyclic_directed, toposort
.Debug
formatting for Graph, StableGraph
.GraphMap
now has a method .into_graph()
that makes a Graph
.Graph::retain_nodes, retain_edges
now expose the self graph only
as wrapped in Frozen
, so that weights can be mutated but the
graph structure not.StableGraph
by defaultGraph::contains_edge
.EdgeDirection
→ Direction
.SubTopo
.0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
Dot
passes on the alternate flag to node and edge label formattingClone
impl for some iteratorsGraph::neighbors
StableGraph
, using feature flag stable_graph
0.2.1
is_isomorphic_matching
0.2.0
New Features
Add Graph::neighbors().detach() to step edges without borrowing. This is more general than, and replaces now deprecated walkedgesdirected. (#39)
Add method EdgeDirection::opposite()
Breaking changes
Graph::neighbors() for undirected graphs and Graph::neighbors_undirected for any graph now visit self loop edges once, not twice. (#31)
Option<E>
Element type of GraphMap<N, E>::all_edges()
changed to (N, N, &E)
Minor breaking changes
IntoWeightedEdge changed a type parameter to associated type
0.1.18
0.1.17
quickcheck::Arbitrary
implementations,
if optional feature quickcheck
is enabled.0.1.16
0.1.15
0.1.14
0.1.13
0.1.12
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.4
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.