Skip to content

Handle self-loops in all_simple_paths#1619

Merged
mtreinish merged 3 commits into
Qiskit:mainfrom
IvanIsCoding:fix-all-simple-paths
Jul 9, 2026
Merged

Handle self-loops in all_simple_paths#1619
mtreinish merged 3 commits into
Qiskit:mainfrom
IvanIsCoding:fix-all-simple-paths

Conversation

@IvanIsCoding

Copy link
Copy Markdown
Collaborator

Closes #1617

This was a discrepancy introduced in #1520. For the record, NetworkX returns ["a"] for a self-loop which is slightly different than ["a", "a"] but I think the old behaviour is fine.

@mtreinish mtreinish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, it seems like a pretty straight forward fix.

@mtreinish
mtreinish added this pull request to the merge queue Jul 9, 2026
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Merged via the queue into Qiskit:main with commit 8a0cf2d Jul 9, 2026
40 checks passed
@IvanIsCoding

IvanIsCoding commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@Mergifyio backport stable/0.18

@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

backport stable/0.18

✅ Backports have been created

Details

IvanIsCoding added a commit that referenced this pull request Jul 10, 2026
(cherry picked from commit 8a0cf2d)

Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: all_simple_paths returns empty list when source == target (self-loop)

2 participants