The EdgeWeightedDirectedCycle represents a data type for determining whether an edge-weighted digraph has a directed cycle. The has_cycle operation determines whether the edge-weighted digraph has a directed cycle and, if so, the cycle operation returns one. This implementation uses depth-first search.
| 37 | /// returns one. |
| 38 | /// This implementation uses depth-first search. |
| 39 | pub struct EdgeWeightedDirectedCycle { |
| 40 | cycle: Option<Stack<DirectedEdge>>, |
| 41 | edge_to: Vec<Option<DirectedEdge>>, |
| 42 | marked: Vec<bool>, |
| 43 | on_stack: Vec<bool>, |
| 44 | } |
| 45 | |
| 46 | impl DirectedCycle { |
| 47 | /// does G have a directed cycle? |
nothing calls this directly
no outgoing calls
no test coverage detected