-
Notifications
You must be signed in to change notification settings - Fork 117
Optimization: iFUB algorithm for unweighted graph diameter #482
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
base: master
Are you sure you want to change the base?
Optimization: iFUB algorithm for unweighted graph diameter #482
Conversation
Implement iFUB algorithm for unweighted diameter.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #482 +/- ##
==========================================
+ Coverage 97.16% 97.17% +0.01%
==========================================
Files 121 121
Lines 7020 7088 +68
==========================================
+ Hits 6821 6888 +67
- Misses 199 200 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you! On first look this looks great, but it will take a bit to get a proper review. In the meantime, we should probably have some more rigorous tests for it added. (1) Tests comparing against large graphs with known diameters (e.g. by construction); and (2) tests comparing against the old slow implementation for random graphs. Could you add such tests, maybe something that adds an additional 60 seconds to the tests, but with a "number of random samples" parameter that I can change locally and run for a few hours on my machine? |
Added some more rigorous tests
|
Hello Krastanov, thanks for the comment. I have added (1) comparison against graphs with known diameters and the (2) comparison with old slow implementation for random graphs, under test/distance.jl. You can change NUM_SAMPLES there. Also, please note that it is my first time contributing to an existing Julia package, so please tell me if there is any changes to be done. |
|
Thanks, this looks great! I will try to review this in the next few days. One other thing that I need to check lately -- if you used an LLM-like tool, could you disclose that, which tool, and what the prompt was? I do not see anything in your PR that makes me think that was the case, and it is not like LLM tools are bad (they help a lot), but they do require approaching the review differently and having this extra info helps. |
|
Thanks for the feedback! I have used Gemini 3.0 for code generation. This optimization method was originally used in one of my researches, but I needed to change the style of the code to be similar to Graphs.jl. Therefore, I used Gemini to first change the code into a "Graphs.jl" format. Then I manually edited the codes again. |
|
Do you happen to have a reference of where this algorithm was introduced first / who named it iFUB, etc? Or a textbook about it? |
|
Pardon the formatter error -- it seems it is due to an incorrect security configuration on our end, not due to your code. |
Implement iFUB algorithm for diameter calculation of unweighted graphs,
SimpleGraphandSimpleDiGraphBelow is a comparison with the original diameter calculation logic, ran on my desktop.