Skip to content

Potential bug in connected_double_edge_swap #6220

@rossbar

Description

@rossbar

The following test case failed during a pytest-randomly workflow:

def test_edge_cases_con_double_edge_swap():
graph = nx.path_graph(4)
assert 0 == nx.connected_double_edge_swap(graph)

I was able to reproduce locally on main by running interactively. When running without a seed, I occasionally get 1 instead of 0. This is also reproducible when seeded:

>>> G = nx.path_graph(4)
>>> nx.connected_double_edge_swap(G, seed=140)
1

I tested with both 2.8.3 and 2.7 and was able to reproduce with those versions as well, so I don't think this is something recently introduced (though I haven't looked at blame or bisected).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions