Skip to content

Added the implementation of the Edmond Karp algorithm along with test cases #252

Merged
raklaptudirm merged 12 commits intoTheAlgorithms:masterfrom
mapcrafter2048:algorithm/edmondkarp
Oct 16, 2024
Merged

Added the implementation of the Edmond Karp algorithm along with test cases #252
raklaptudirm merged 12 commits intoTheAlgorithms:masterfrom
mapcrafter2048:algorithm/edmondkarp

Conversation

@mapcrafter2048
Copy link
Copy Markdown
Contributor

Added the implementation of the Edmond Karp algorithm along with test cases

Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread maths/bisection_method.ts Outdated
@@ -0,0 +1,27 @@
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please get rid of these unrelated changes in this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this isn't resolved. The changes are still there.

Copy link
Copy Markdown
Contributor

@appgurueu appgurueu Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still there. Maybe you forgot to push a commit that gets rid of these additions (bisection_method.ts, decimal_convert.ts, euler_method.ts)?

@mapcrafter2048
Copy link
Copy Markdown
Contributor Author

I am extremely sorry for all the mistakes I have done and submitted the code for a review with twice checking it my self

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
mapcrafter2048 and others added 2 commits October 3, 2024 23:39
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
@mapcrafter2048
Copy link
Copy Markdown
Contributor Author

I have tried implementing the changes suggest by @appgurueu
-removed the weight as it was not used here
-corrected the documentation for the space complexity form O(V) -> O9=(V^2)
-Implemented BFS using two level arrays (currentLevel and nextLevel) to maintain level-order traversal, avoiding the inefficient queue.shift() operation.
-Used an adjacency list representation for the residual graph to make the iteration over outgoing edges
-Changed the parent array initialization to null

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.89%. Comparing base (a08a122) to head (ab770c3).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #252      +/-   ##
==========================================
+ Coverage   96.82%   96.89%   +0.06%     
==========================================
  Files          98      100       +2     
  Lines        1829     1867      +38     
  Branches      345      354       +9     
==========================================
+ Hits         1771     1809      +38     
  Misses         58       58              

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

Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Comment thread graph/edmondkarp.ts Outdated
Copy link
Copy Markdown
Contributor Author

@mapcrafter2048 mapcrafter2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement the changes suggest by you

Comment thread graph/edmonds_karp.ts Outdated
Comment thread graph/edmonds_karp.ts
Copy link
Copy Markdown
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be asymptotically fine now. Looks correct.

@raklaptudirm raklaptudirm merged commit 19b4ced into TheAlgorithms:master Oct 16, 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.

4 participants