Function retworkx::digraph_find_cycle[][src]

pub fn digraph_find_cycle(graph: &PyDiGraph, source: Option<usize>) -> EdgeList

Return the first cycle encountered during DFS of a given PyDiGraph, empty list is returned if no cycle is found

:param PyDiGraph graph: The graph to find the cycle in :param int source: Optional index to find a cycle for. If not specified an arbitrary node will be selected from the graph.

:returns: A list describing the cycle. The index of node ids which forms a cycle (loop) in the input graph :rtype: EdgeList