-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Added Ford Fulkerson algorithm for Hacktoberfest contribution #1708
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
Added Ford Fulkerson algorithm for Hacktoberfest contribution #1708
Conversation
Codecov Report
All modified and coverable lines are covered by tests ✅
Project coverage is 84.69%. Comparing base (
9010481
) to head (ea28f4b
).
Additional details and impacted files
@@ Coverage Diff @@ ## master #1708 +/- ## ========================================== + Coverage 84.65% 84.69% +0.03% ========================================== Files 378 379 +1 Lines 19744 19795 +51 Branches 2951 2965 +14 ========================================== + Hits 16715 16766 +51 Misses 3029 3029
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
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.
It needs to be documented what format this is in. (Side note: I would prefer an adjacency list representation because it yields a better time complexity.)
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.
Since we're using BFS to find augmenting paths, this isn't just any Ford-Fulkerson algorithm, it's the Edmonds-Karp variant to be specific (which has a runtime bound independent from the specific capacities).
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.
This violates our naming conventions. It should be called n
, n_vertices
or similar.
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.
Some comments would help clarity here.
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.
This unnecessarily wrecks the time complexity (assuming you decide to go with an adjacency list). This should use an actual queue. Or alternatively, implement the BFS as "levelorder" via level / next level arrays you populate and swap.
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.
- These should all be in one big
describe("Edmonds-Karp", ...)
. - These test case names should be descriptive and useful, or be omitted altogether.
- How would I easily verify these tests? I think some visualizations of the graphs might be helpful, perhaps as ASCII art, or if these are from an external source, a link to where you got them from.
Uh oh!
There was an error while loading. Please reload this page.
Open in Gitpod know more
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.