Skip to content

BUG: fix ISMAGS self-loops error - #8519

Merged
dschult merged 1 commit into
networkx:mainfrom
dschult:fix_ismags_loops
Feb 17, 2026
Merged

dschult merged 1 commit into
networkx:mainfrom
dschult:fix_ismags_loops

Conversation

@dschult

@dschult dschult commented Feb 16, 2026

Copy link
Copy Markdown
Member

The recently merged isomorphism/tests/test_common.py suite of isomorphism tests showed that self-loops were not being handled correctly in the ISMAGS isomorphism algorithm.

This PR fixes that. The check of matching self-loop count is added when creating the initial candidate sets -- that is, while checking for correct colors. Now it checks for matching node color and count of self-loops.

Test is updated and method doc-string in ISMAGS is updated.

This is independent of other isomorphism PRs.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A really nice benefit of the isomorphism test refactor! Thanks @dschult !

@dschult
dschult merged commit b3148fa into networkx:main Feb 17, 2026
39 checks passed
@dschult dschult added this to the 3.7 milestone Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants