ENH: `min_length` kwarg for `simple_cycles`
Author: rossbarCreated Jun 29, 2025Updated Jul 25, 2026
Labelstype: Enhancements
Just an idea I had while reviewing/thinking about #8111
simple_cycles already has a length_bound kwarg to filter out cycles above a certain length. I wonder if it might be possible to add related functionality: i.e. a minimum_length keyword to yield cycles that are at least a certain length.
Of course, this could naively be done with a simple filter [c for c in nx.simple_cycles(G) if len(c) > minimum_length], but what I'm interested in is whether there are any algorithmic approaches to only finding cycles above a certain length that are of course more efficient than the full cycle-search.
I haven't done any research on this front, but if such approaches exist I think they could be quite valuable!
Source: networkx/networkx