Git Product home page Git Product logo

ford-fulkerson-algorithm-python's Introduction

Ford-Fulkerson-Algorithm-Python

Ford-Fulkerson algorithm is a greedy approach for calculating the maximum possible flow in a Network or a graph.

A term, Flow network, is used to describe a network of vertices and edges with a Source (S) and a Sink (T) node. Each vertex, except S and T, can receive and send an equal amount of stuff through it. S can only send and T can only receive stuff.

We can visualize the understanding of the algorithm using a flow of liquid inside a network of pipes of different capacities. Each pipe has a certain capacity of liquid it can transfer at an instance. For this algorithm, we are going to find how much liquid can be flowed from the source to the sink at an instance using the network.

image

Fig. 1: Flow Network Graph

Terminologies Used:

1.Augmenting Path: It is the path available in a flow network.

2.Residual Graph: It represents the flow network that has additional possible flow.

3.Residual Capacity: It is the capacity of the edge after subtracting the flow from the maximum capacity.

How Ford-Fulkerson Algorithm works?

The algorithm follows:

1.Initialize the flow in all the edges to 0.

2.While there is an augmenting path between the source and the sink, add this path to the flow.

3.Update the residual graph.

Note: We can also consider reverse-path if required because if we do not consider them, we may never find a maximum flow.

Ford-Fulkerson Applications are:

1.Water distribution pipeline

2.Bipartite matching problem

3.Circulation with demands

ford-fulkerson-algorithm-python's People

Contributors

arnab132 avatar

Stargazers

 avatar

Watchers

 avatar

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.