GithubHelp home page GithubHelp logo

arthurrouquan / maximumflowalgorithms Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 6.12 MB

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.

CMake 1.21% C++ 98.79%
graph graphs-algorithms flow flownetwork-algorithms flownetwork edmonds-karp-algorithm edmonds-karp dinic-algorithm maximum-flow maximum-flow-algorithm

maximumflowalgorithms's Introduction

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

maximumflowalgorithms's People

Contributors

arthurrouquan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mariocjun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.