Cosmos: Add Ford fulkerson algorithm

Created on 3 Oct 2017  路  7Comments  路  Source: OpenGenus/cosmos

Add the code for Ford fulkerson algorithm for maximum flow in any language ( C, C++, Java, Go, Python or any other)

The code should be placed at code/graph-algorithms/ford_fulkerson_maximum_flow/

Note: multiple contributors can work on this issue as it has multiple parts (languages)

Your pull request will be reviewed by maintainers instantly.

For contribution guidelines, see this

If you need any help, let us know.

Hacktoberfest add code new algorithm

All 7 comments

I would like to contribute to this.

I am working on the C++ code

I'll do it in Python

272 added ford fulkerson c++ language

Added the Python implementation for ford fulkerson in #294

Shouldn't the ones currently in here using BFS for finding augmenting paths be moved to Edmonds-Karp instead? As Ford-Fulkerson doesn't actually specify what algorithm should be used for finding them.

It is sometimes called a "method" instead of an "algorithm" as the approach to finding augmenting paths in a residual graph is not fully specified [...]

Ford-Fulkersons algorithm

The algorithm is identical to the Ford鈥揊ulkerson algorithm, except that the search order when finding the augmenting path is defined. The path found must be a shortest path that has available capacity. This can be found by a breadth-first search, where we apply a weight of 1 to each edge.

Edmonds-Karp algorithm

Also noticed that at least the python algorithm for Ford-Fulkerson using BFS doesn't take edge weights into account, so it will find shortest paths, and thus be Edmonds-Karp.

Could perhaps leave Ford-Fulkerson in, but make it take an argument that is the function for finding augmenting paths. Then you could make Edmonds-Karp simply be a call to Ford-Fulkerson with BFS as the augmenting path-finding algorithm.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ruchirchauhan picture ruchirchauhan  路  4Comments

rishavpandey43 picture rishavpandey43  路  3Comments

InfiniteCoder picture InfiniteCoder  路  3Comments

ms10398 picture ms10398  路  4Comments

rhendz picture rhendz  路  4Comments