-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced Vector data structure by BitSet in greedy_color #379
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #379 +/- ##
=======================================
Coverage 97.31% 97.31%
=======================================
Files 120 120
Lines 6953 6954 +1
=======================================
+ Hits 6766 6767 +1
Misses 187 187 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the contribution!
@AntoineBut can you check what my change from |
@gdalle Here are results from a rapid benchmarking : Setup :
Results :
I tried to represent graphs that behave differently with respect to coloring, some of them are colored with only 5 colors (even on thousands of vertices) and the complete graph is colored in N colors. I hope that adresses your concerns! |
Just out of curiosity, could you try with a BitVector? Then we'll pick the best and merge. My gut tells me it may be as fast as BitSet sometimes |
This PR adresses #378 .
Replacing Vector with a Set yields immediate speedup of 50-100x on my machine.
As the we are using dense sets of integers from 1 to the number of colors to color the graph (i.e relatively small integers), BitSet implementation seems to be the most appropriate here. (and is also faster on my machine, even though I have not tested on an extensive benchmark suite)
Im open to feedback of course (I am still pretty new here) :))