Skip to content

Conversation

@brunos252
Copy link
Contributor

@brunos252 brunos252 commented Feb 24, 2022

Description

Algorithm implementation for finding max flow in a graph. Ford-Fulkerson algorithm was used along with capacity scaling.
Also implemented is a BFS search algorithm for finding min and max values of an edge weight, used for the capacity scaling.

Pull request type

  • Algorithm/Module

Related issues

Delete if this PR doesn't resolve any issues. Link the issue if it does.

######################################

Reviewer checklist (the reviewer checks this part)

Module/Algorithm

  • Core algorithm/module implementation
  • Query module implementation
  • Unit tests
  • End-to-end tests
  • Code documentation
  • README short description
  • Documentation on memgraph/docs

######################################

@brunos252 brunos252 requested a review from jmatak February 24, 2022 15:00
@brunos252 brunos252 self-assigned this Feb 24, 2022
@brunos252 brunos252 added lang: python Issue on Python codebase status: ready PR is ready for review type: algorithm Initial algorithm implementation labels Feb 24, 2022
@brunos252 brunos252 changed the title T178 mage max flow Max flow implementation Feb 24, 2022
Copy link
Contributor

@jmatak jmatak left a comment

Choose a reason for hiding this comment

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

I have one comment related to using deque, and what's left is writing the documentation on memgraph/docs:

https://github.com/memgraph/docs/tree/master/mage/algorithms/traditional-graph-analytics
https://github.com/memgraph/docs/tree/master/mage/query-modules/python

Enjoy 😄

@brunos252
Copy link
Contributor Author

/docs is ready for PR

MERGE (a:Node {id: 2}) MERGE (b:Node {id: 4}) CREATE (a)-[:RELATION {weight: 10}]->(b);
MERGE (a:Node {id: 3}) MERGE (b:Node {id: 4}) CREATE (a)-[:RELATION {weight: 1}]->(b);
MERGE (a:Node {id: 3}) MERGE (b:Node {id: 5}) CREATE (a)-[:RELATION {wght: 11}]->(b);
MERGE (a:Node {id: 4}) MERGE (b:Node {id: 5}) CREATE (a)-[:RELATION {weight: 12}]->(b); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

@jmatak are we adding a new line at the end of the file or not, I forgot what was the rule?

Copy link
Contributor

Choose a reason for hiding this comment

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

The rule is to add it

@antoniofilipovic antoniofilipovic added status: discuss it PR commented - needs discussion and removed status: ready PR is ready for review labels Mar 7, 2022
Copy link
Contributor

@Josipmrden Josipmrden left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me, minor comment only

@Josipmrden Josipmrden self-requested a review March 7, 2022 16:11
@@ -0,0 +1 @@
CREATE ({id: 0}), ({id: 5}) No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

@brunos252 Set your IDE to add a new line whenever you save a file.

Copy link
Contributor

@jmatak jmatak left a comment

Choose a reason for hiding this comment

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

Fix new line and it's finished 🎉

@brunos252 brunos252 requested a review from jmatak March 8, 2022 08:37
@jmatak jmatak merged commit 4251e65 into main Mar 8, 2022
@jmatak jmatak deleted the T178-MAGE_max-flow branch March 8, 2022 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: python Issue on Python codebase status: discuss it PR commented - needs discussion type: algorithm Initial algorithm implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants