Skip to content

Academical implementation of Edmonds-Karp algorithm in O(nm²) and Dinitz (Dinic) algorithm O(n²m) for computing the maximum flow of a flow network.

Notifications You must be signed in to change notification settings

ArthurRouquan/MaximumFlowAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edmonds–Karp and Dinitz–Cherkassky maximum flow algorithms

Implementation in C++20 of the Edmonds-Karp's algorithm and the Dinitz's algorithm (following the Boris V. Cherkassky's recommentations) for computing the maximum flow of a given flow network in O(nm²) and O(n²m) respectively. This implementation was made for educational purposes.

To-Do

  • Implementation of a performant push-relabel algorithm.
  • A small function to compute the minimum cut with the final residual network.

How to run it?

This project use CMake. To run the executable you need to pass a flow network instance .max file:

$ maxflow ../maxflow_instances/BVZ-tsukuba0.max

Network instance: "../maxflow_instances/BVZ-tsukuba0.max - |V| = 110594, |E| = 514483

Algorithm: "Dinitz-Cherkassky"
Maximum flow value: 34669
Duration: 532ms

Algorithm: "Edmonds-Karp"
Maximum flow value: 34669
Duration: 15312ms

References

  1. Dinitz Y. (2006) Dinitz’ Algorithm: The Original Version and Even’s Version. In: Goldreich O., Rosenberg A.L., Selman A.L. (eds) Theoretical Computer Science. Lecture Notes in Computer Science, vol 3895. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11685654_10

About

Academical implementation of Edmonds-Karp algorithm in O(nm²) and Dinitz (Dinic) algorithm O(n²m) for computing the maximum flow of a flow network.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published