The Ford-Fulkerson algorithm is a method that resolves the max-flow min-cut problem. That is, given a network with vertices and edges between those vertices that have certain weights, how much “flow” can the network process at a time? Flow can mean anything, but typically it means data through a computer network.
When the capacities are integers, the runtime of Ford–Fulkerson is bounded by O ( E *f ).
Ford-Fulkarson’s algorithm
Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in the graph, find the maximum possible flow from s to t with following constraints:
Flow on an edge doesn’t exceed the given capacity of the edge.
Incoming flow is equal to outgoing flow for every vertex except s and t.
The maximum possible flow in the above graph is 23.
Program in C :
Output:
Please comment below in case of any problem found during running the code or any other doubts.
Computer Science Major, Bioinformatics Bachelor, Deep Learning enthusiast, hard core Gamer , occasional Philosopher, avid music listener and movie lover. Visit my other blog for Gaming and Technical review related posts @ Blogger; also feel free to post a question @ Quora (links below)
How to modify Service Fabric replicator log size and also how to change Service Fabric Local cluster installtion directory or log directory. Continue reading