Skip to content

This repository contains various solutions of the maximum flow problem

Notifications You must be signed in to change notification settings

rizaozcelik/maximum-flow-with-capacity-scaling

Repository files navigation

Maximum Flow

This repository contains various implementations of capacity scaling algorithm anl linear programming for maximum flow problem as well as their comparisons on different configurations. Here are the list of the versions

Regular Implementation: This is the typical implementation of the capacity scaling algoritm as explain in the book Network Flows: Theory, Algorithms, and Applications by Orlin et. al. Yet, it has two options for path finding that are DFS and BFS.

Heap Implementation: This version uses a different scheme for updating Delta. To do so, it starts with the same initial Delta and when no augmeting path can be found uses a heap that contains the edge capacities to determine the next Delta instead of dividing by 2 directly as in the original implementation.

Linear Programming: In this version, the problem is formulated as a linear program and resulting system is solved by scipy and gurobipy separately for comparison purposes.

To test the code:

  • Clone the repo
  • Install the requirements by pip or conda
  • Run runner.py with the existing configuration to see a quick test ride.

You can also see the comparisons either by checking out the pdf file. If you wish, you can add more experiments by simply adding a json file in the same format with the existing ones and running it from the runner.

About

This repository contains various solutions of the maximum flow problem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages