Skip to content

Cycle enumeration strategy in get_cycle_closure_dataframe #218

Description

@hannahbaumann

In get_cycle_closure_dataframe() we currently enumerate cycles using:

cycles = [
    c for c in nx.simple_cycles(network.to_undirected())
    if len(c) <= max_cycle_length
]

During review we discussed whether nx.cycle_basis() would be more appropriate than nx.simple_cycles().

The main question is whether cycle closure analysis should use:

  • all simple cycles (simple_cycles, including “super cycles”), or
  • only a minimal independent basis (cycle_basis).

For now, we decided to keep simple_cycles + max_cycle_length.

Reasoning:

  • Larger/super cycles may help avoid missing problematic edges due to cancellation in smaller cycles.
  • Downstream edge-level diagnostics (get_cycle_closure_edge_statistics_dataframe) benefit from evaluating edges across multiple cycles.
  • This aligns with observations that closing basis cycles does not necessarily imply larger cycles will also close (e.g. DOI: 10.1021/acs.jcim.5c00554).

We should revisit this if super cycles appear noisy or uninformative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions