Allow picking the best of several orders for GreedyColoringAlgorithm#265
Merged
Allow picking the best of several orders for GreedyColoringAlgorithm#265
Conversation
Member
Author
|
@SouthEndMusic does this API do what you'd like it to do? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 1939 1955 +16
=========================================
+ Hits 1939 1955 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
I like the idea! We could reuse the buffers if we only change the ordering. But it can be done later. |
Member
Author
|
@amontoison all the tests are now passing, I think this one is easy to ship |
Collaborator
|
Ok I will review do my best to review it tonight ! |
amontoison
reviewed
Oct 14, 2025
amontoison
approved these changes
Oct 14, 2025
Collaborator
amontoison
left a comment
There was a problem hiding this comment.
LGTM, I just have a suggestion to not call remap_colors a second time for nothing.
It is not expensive but can be probably easily avoided.
amontoison
pushed a commit
that referenced
this pull request
Oct 22, 2025
…265) * Allow picking the best of several orders for GreedyColoringAlgorithm * Fix type params * Tuple * Better tests * Better test * Fix foc * Fix type inference inside closure * Fix seed * Test on 1.11 * Avoid duplicate remap_colors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the context of DI, it's a bit annoying to compare several orders before picking the best one, since the best order is matrix-dependent.
This PR allows passing a tuple of orders to
GreedyColoringAlgorithm, which are then compared for every matrix and the best one is picked. I use a tuple to preserve type-stability and to ensure efficiency in the base caseN=1.Todo: