Skip to content

GenericGraph.subgraph_search_iterator yields duplicate copies of the same subgraph #39599

@seblabbe

Description

@seblabbe

Steps To Reproduce

With SageMath version 10.6.beta6, Release Date: 2025-02-10, I observe:

sage: G1 = Graph( [(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (1, 3),
....: (1, 5), (2, 3), (2, 4), (3, 5), (4, 6), (4, 7), (5, 6), (5, 7), (6, 8),
....: (6, 10), (7, 9), (7, 11), (8, 9), (8, 10), (9, 11), (10, 11)])
sage: claw = graphs.ClawGraph()
sage: it = G1.subgraph_search_iterator(claw, return_graphs=False)
sage: next(it)
[10, 6, 8, 11]
sage: next(it)
[10, 6, 11, 8]
sage: next(it)
[10, 8, 6, 11]
sage: next(it)
[10, 8, 11, 6]
sage: next(it)
[10, 11, 6, 8]
...

Expected Behavior

The iterator should not yield many copies of the same subgraph.

Actual Behavior

We observe that the same subgraph is returned many times by the search iterator (up to a permutation of the vertices).

Additional Information

Observed during #39598

Environment

  • OS: Ubuntu 22.04
  • Sage Version: SageMath version 10.6.beta6, Release Date: 2025-02-10

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions