# graph-cycles
Find all cycles in a graph
A naive implementation of Johnson's algorithm to find all cycles
in a graph. Based on [petgraph](https://github.com/petgraph/petgraph).
## Example
The triangle graph has exactly one cycle, namely the full graph itself.
```rust
use graph_cycles::Cycles;
use petgraph::graph::Graph;
let g = Graph::<(), ()>::from_edges([(0, 1), (1, 2), (2, 0)]);
// find all cycles
let cycles = g.cycles();
assert_eq!(cycles.len(), 1);
assert_eq!(cycles[0].len(), 3);
// print each cycle in turn