cycles = [c for c in nx.simple_cycles(network.to_undirected()) if len(c) <= max_cycle_length]
undirected will miss self-loops if users run forward and backward edges which might be nice to include in the output. In the future it would be great to include them or handle them in a separate method.
cycles = [c for c in nx.simple_cycles(network.to_undirected()) if len(c) <= max_cycle_length]undirectedwill miss self-loops if users run forward and backward edges which might be nice to include in the output. In the future it would be great to include them or handle them in a separate method.