Repository navigation
[BUG][PERF] Fix ISMAGS directed matching and monomorphism overhead - #8900
Conversation
|
I cant read this PR description. Can you write it in your own words? |
dschult
left a comment
There was a problem hiding this comment.
Thanks @Peiffap for this PR!
Looking at each commit individually was very helpful.
Thanks for finding the omitted code handling incoming edges,
And for updating the tests to reflect that problem, for removing both extraneous unused variables and for not assigning variables in every case when only used in certain cases. And thanks very much for the documentation rewording about monomorphism!
All of these are good changes and the PR is ready to merge!
Seems like the per-commit structure was helpful so I kept that, but tried wording things differently. Thanks for the review and for all your work on matching recently! |
|
Hmm looks like the benchmarks are timing out, we can look at them in another PR! |
Fix a few ISMAGS issues found after #8838, with one commit per fix:
0be5f6ab4: Apply the candidate sets for incoming edges. These were computed but not used, allowing incorrect mappings for directed graphs. Add tests for edge existence, edge colors and multiedge counts.e6a85d93b: Skip computingnot_gn_nbrswhen finding monomorphisms. Nonneighbors only need to be checked for isomorphism and induced subgraph isomorphism.4ade591e4: Fix a test assertion that always passed forGraphandDiGraphwithout checking the number of mappings.8f31c83b0: Clarify the monomorphism docstrings and add an example showing how symmetries of the subgraph affect the number of mappings.aa6d9a2ab: Remove the unusedself_ge_partitionvariable.For example, this used to return
True, althoughGcontains no directed cycle of length 3:Finding all monomorphisms of
path_graph(2)inpath_graph(10000)took 2.78 s before and 0.15 s after, with the same 19,998 mappings (median of three runs, Python 3.14,symmetry=False).Tests: 1,568 passed, 740 expected failures; all pre-commit checks passed.
AI assisted with the changes, which were checked with regression tests, doctests and benchmarks.