Hi,
_________________________________________
#test
import networkx as nx
G=nx.DiGraph()
for x in range(0, 11):
G.add_node(x)
G.add_edges_from(
[
(0, 36),
(0, 38),
(1, 36),
(1, 39),
(2, 37),
(18, 0),
(19, 0),
(19, 39),
(20, 1),
(20, 37),
(20, 39),
(21, 37),
(21, 40),
(22, 38),
(38, 1),
(39, 1),
(39, 40),
(40, 2),
(40, 38) ])
print(nx.find_cycle(G, source=0))
**After the code is run: output => [(1, 39), (39, 1)]
______________________________________________
When the code above is run, it outputs a directed cycle of [(1, 39), (39, 1)] which obviously is not correct as the graph does not contain a cycle from 0 (as you can tell from the edges).
Is there something that I am missing here or is there a problem with the find_cycle method that needs to be patched?
Thanks,
Taylor Do