Skip to content
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

fix mincut (fixes #324) #327

Closed
wants to merge 3 commits into from

Conversation

etiennedeg
Copy link
Member

@etiennedeg etiennedeg commented Jan 15, 2024

When a vertex is merged during the cut of the phase, if the current vertex is not kept, we need to switch to the kept vertex

fixes #324

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5878e7b) 97.30% compared to head (9b26193) 97.30%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #327   +/-   ##
=======================================
  Coverage   97.30%   97.30%           
=======================================
  Files         115      115           
  Lines        6796     6796           
=======================================
  Hits         6613     6613           
  Misses        183      183           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle
Copy link
Member

gdalle commented Jan 15, 2024

@etiennedeg did you check out #325? haven't had time to review yet

@etiennedeg
Copy link
Member Author

Yes, his implementation drops the heuristics but the heuristic was not at fault. I noticed that he struggled to understand my code, so I added more comments

@axsk
Copy link
Contributor

axsk commented Jan 18, 2024

It's not true I did not drop the heuristic.

What is true that I did not understand is the whole algorithm, esp. the part with the cutweight -= ew (still cryptic to me) which is why removed those parts to bring it more in line with the original Stoer-Wagner Algorithm (which I do understand) but WITH the heuristic still applied.

Looking at this fix I could imagine it being still necessary for my patch though..

@axsk
Copy link
Contributor

axsk commented Jan 18, 2024

So I agree that updating u to the merged root should be done and have updated my PR accordingly.
I would appreciate if you could give it another look @etiennedeg

@axsk
Copy link
Contributor

axsk commented Jan 18, 2024

If you come to the conclusion you don't like my simplifications bringing it in line with Stoer-Wagner or they are not working with the heuristic let me know so I will close my PR and prepare a seperate one with the performance fixes alone.

@etiennedeg
Copy link
Member Author

Closing in favor of #325 (see #325 (comment))

@etiennedeg etiennedeg closed this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] mincut() gives wrong result
3 participants