5 releases
0.1.4 | May 12, 2019 |
---|---|
0.1.3 | Apr 25, 2019 |
0.1.2 | Mar 30, 2019 |
0.1.1 | Feb 20, 2019 |
0.1.0 | Feb 20, 2019 |
#109 in #graph-algorithms
24KB
475 lines
abstractgraph - Graph algorithms on user supplied data structures
It's quite common for graph structures to be defined implicitly by other data structures. However, most graph algorithm libraries require a specific input representation of the graph, meaning you need to awkwardly convert your internal data structures into that representation first.
abstractgraph
lets you run graph algorithms directly on your own
data structures, by having them implement traits to expose the graph structure.
Currently implemented algorithms:
- Depth First Search
- Breadth First Search
- Dijkstra's Algorithm (single source shortest path)
abstractgraph
began as a port of the aga
and agar
modules from ccan.
Usage
Add the following to your Cargo.toml
:
[dependencies]
abstractgraph = "0.1"
License
This library is licensed under the LGPL, version 2.1 or later.
lib.rs
:
This crate implements standard graph algorithms without requiring a specific graph representation.
It's quite common for graph structures to be defined implicitly by other data structures. This crate lets you run standard graph algorithms without having to translate your data structures into a specific graph representation.
Usage
To define a graph, implement the DirectedGraph
trait on some
data structure can be treated as agraph. You can then run the
various generic graph algorithms which take a generic type
implementing DirectedGraph
.
History
This crate began as a port of the aga
and agar
modules
from ccan.
Dependencies
~1MB
~19K SLoC