0% found this document useful (0 votes)
48 views8 pages

Maximum Flow and Minimum Cut

The document discusses the relationship between maximum flow and minimum cut in graph theory, specifically through the Max-flow Min-cut theorem. It explains the concepts of minimum cut and maximum flow, provides examples, and outlines the theorem's proof and applications, including project selection and image segmentation problems. The theorem states that the maximum flow from a source to a sink in a network is equal to the minimum cut that disconnects the graph into two components.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views8 pages

Maximum Flow and Minimum Cut

The document discusses the relationship between maximum flow and minimum cut in graph theory, specifically through the Max-flow Min-cut theorem. It explains the concepts of minimum cut and maximum flow, provides examples, and outlines the theorem's proof and applications, including project selection and image segmentation problems. The theorem states that the maximum flow from a source to a sink in a network is equal to the minimum cut that disconnects the graph into two components.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Maximum Flow and Minimum Cut

Introduction
In our previous articles, we have seen how costly it is to calculate the maximum flow as well
as the minimum cut of a graph. If we want to calculate both of them, then we need not follow
the conventional method to calculate them instead we will bother about calculating only one
of them.

In this article, we will discuss how we can find the maximum flow of a flow network by
calculating the minimum cut of the network or vice-versa. We have already seen what do
minimum cut and maximum flow means in previous articles, though we have given a slight
glimpse for revision of the concept.

There is a theorem that can be proved to pose a relation between maximum flow and
minimum cut of a network and that theorem is known as the "Max-flow Min-cut"
theorem which has been briefly explained and proved in the article.

Let's revisit the concepts of minimum cut and maximum flow and then we will see what does
the max-flow min-cut theorem states and how we can prove it.

Minimum Cut Problem


Let us assume for some reason we want to split any given image into two non-similar
portions. If we approach this problem in terms of graph data structure we would consider
pixels as the vertices of the graph and edges between two similar pixels of the image. In this
case, a minimum cut will be analogous to the partition of pixels into two parts where the two
parts are the most dissimilar.

example a simple undirected graph 𝐺G with five vertices and six edges as shown below -
To understand the minimum cut (or simply min-cut) concept, we will take the help of an

To obtain the minimum cut of this graph, we will be interested in disconnecting this graph
by removing two edges, 𝐴↔𝐵A↔B and 𝐷↔𝐶D↔C as shown below.
into two components by removing the minimum possible number of edges. This can be done

Formally minimum cut is defined as, the minimum sum of weight of the edges (minimum
edges in case of unweighted graphs) required to remove to disconnect the graph into two
components.

given graph 𝐺G has been discussed in the Minimum cut article. We would strongly
Karger's algorithm is a randomized algorithm that is used to find the minimum cut of any

recommend you to refer it to have an idea of its implementation.

Maximum Flow Problem


If we consider a rail network that connects two cities (say 𝐴A and 𝐵B) by way of several
intermediate cities, where each railway line has some value assigned to it denoting its
capacity.

Assuming steady conditions (number of trains on a railway line never exceeds its capacity), if

from City 𝐴A to city 𝐵B then the problem is known as the "Maximum Flow Problem".
we need to find what is the maximum number of trains (maximum flow) that we can send

In graph theory, we have been given a network with a source (which has no incoming edge)
node and a sink (which has no outgoing edge) node and capacities of all the edges which
correspond to the maximum flow that an edge can allow to flow through it.

We are interested in finding the maximum amount of flow we can send from the source node
to the sink node constrained with the capacities of all the intermediate edges. To understand it
more clearly we will have a look on an example have been given below -
The given graph 𝐺G has six vertices and nine edges where the first value of each edge
represents the flow through it (which is initially set to 0) and the second value represents its
capacity.

For example - 0/50/5 is written over edge 𝐴↔𝐵A↔B means capacity of this edges is
5 and currently there is no flow along this edge.

We can find the maximum flow through this network by following the steps which have been
explained briefly in Maximum Flow.

After proceeding through the steps, we find maximum flow through the network as
-

Max Flow Min Cut Theorem


The max-flow min-cut theorem is the network flow theorem that says, maximum flow from
the source node to sink node in a given graph will always be equal to the minimum sum

components 𝑖.𝑒.i.e. size of the minimum cut of the graph .


of weights of edges which if removed disconnects the graph into two

More formally, the max-flow min-cut theorem states that, the maximum flow passing from
the source node to the sink node is equal to the size of the minimum cut.

Intuition
In all types of networks (whether they carry data or some other object), the amount of flow
that can flow through the network is restricted by the weakest connection (an edge with
comparatively less capacity) between disjoint sets of the network. Even if other connections
can allow a huge amount of flow through them but can never be used.

Let's have a look at an example to understand this clearly -

In the above-shown network, edge 𝑠→𝐴, 𝑠→𝐵s→A, s→B has a capacity of 50 units

edges 𝐴→𝐵 𝑎𝑛𝑑 𝐵→𝐸A→B and B→E with capacities of 3 and 5 respectively.
but we can't send that much flow through them because in the later stage we have

Hence, the maximum flow we can have through this graph is only 8.

can be obtained by removing edges 𝐴→𝐸 𝑎𝑛𝑑 𝐵→𝐸A→E and B→E with the
Another important observation in this graph is the size of the minimum cut is also 8, which

total sum of weights as 8 as shown below -

Proof of Max-Flow Min-Cut Theorem

while proving the max-flow min-cut theorem - 𝐺G - The given network. 𝑆S - Set that
Before beginning with the proof let's define some variables which we will use frequently

includes the source node 𝑠s. 𝑇T - Set that includes the sink node 𝑡t. 𝑓f - A function
represent flow through the network. 𝑓∗f∗ - Function 𝑓f at its max value (Maximum flow).

Lemma - A statement that is assumed to be true and used as a basis to draw a conclusion.
Corollary - A statement which is direct result of a fact (in our case result of a Lemma).

Lemma 1:

For any flow through 𝑓(𝐺)f(G) and cut (𝑆,𝑇)(S,T) in a network, we can say that -

𝑓(𝐺)≤𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑆,𝑇)f(G)≤capacity(S,T)
This lemma also makes sense as we have seen in the above intuition, it is not possible to send
more flow through an edge than its capacity.

Corollary 2:

Because of lemma 1, for maximum flow 𝑓(𝐺)∗f(G)∗ and minimum


cut (𝑆,𝑇)∗(S,T)∗ we have -

𝑓(𝐺)∗≤𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦((𝑆,𝑇)∗)f(G)∗≤capacity((S,T)∗)
The above mathematical result places an upper bound for the maximum flow through the
graph.

According to the "Ford-Fulkerson method" let the initial flow 𝑓f be 00. Now we will
search for an augmenting path between 𝑠s and 𝑡t in the residual graph which has been

path 𝑝p from 𝑠s to 𝑡t, 𝑐𝑚𝑖𝑛cmin is the minimum capacity of any edge along the path.
formed at each step of the process. Let in an augmenting

So we will add this flow (𝑐𝑚𝑖𝑛cmin) in our maximum flow 𝑓∗f∗ -

𝑓∗=𝑓+𝑐𝑚𝑖𝑛f∗=f+cmin
This process is repeated until there are more augmenting paths in the residual network. Once

as 𝑉V and all vertices which are not reachable from the source as 𝑉′V′. It is obvious that
there is no augmenting path left, we denote all vertices which are reachable from the source

sink 𝑡t can't be in set 𝑉V as there are no more paths between 𝑠s and 𝑡t.

For any pair of vertices, 𝑢 𝑎𝑛𝑑 𝑣u and v where 𝑢u is in set 𝑉V and 𝑣v is in set 𝑉
′V′. The flow 𝑓(𝑢,𝑣)f(u,v) is maximized as no augmenting paths are left also flow
of (𝑣,𝑢)(v,u) is 0 due to same reason.

Therefore we can say that,

𝑓(𝑢,𝑣)=𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑢,𝑣), 𝑢 𝜖 𝑉, 𝑣 𝜖 𝑉′f(u,v)=capacity(u,v),
u ϵ V, v ϵ V′
And by corollary 2 we can conclude that -
𝑓∗=𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦((𝑆,𝑇)∗)f∗=capacity((S,T)∗)

Applications
 Generalized max-flow min-cut theorem

along a path also needs to satisfy the capacity constraint of vertices 𝑖.𝑒.i.e. a flow
If we define the capacity of vertices along with edges in a flow network. Then, flow

passing through a particular vertex can't exceed its capacity. In this case, the capacity
of a cut is the sum of the capacities of edges and vertices present in it.

maximum 𝑠−𝑡s−t flow is equal to the minimum capacity of a 𝑠−𝑡s−t cut in a


So using this we can pose a generalized max-flow min-cut theorem will state that

different sense to solve other complex problems.

 Project Selection Problem

In the project selection problem, we have 𝑝p projects and 𝑚m machines. For


completing a project successfully we require some machines for each project (a

project 𝑝𝑖pi we earn a revenue of 𝑟(𝑝𝑖)r(pi), and each


machine can also be shared for completing several projects), on completing each

machine 𝑚𝑗mj costs 𝑐(𝑚𝑗)c(mj).

we define a dummy source node 𝑠s connected the projects with


We want to choose projects such that the revenue we get at the end is maximized. So

capacity 𝑟(𝑝𝑖)r(pi) and a dummy sink node 𝑡t which is connected by all the
machines with capacities 𝑐(𝑚𝑗)c(mj) also an edge is is added
between (𝑝𝑖,𝑚𝑗)(pi,mj) if project 𝑝𝑖pi requires machine 𝑚𝑗mj.

Let's assume we have 3 projects and 3 machines with requirements and costs as
shown in the table below -

𝑟(𝑝𝑖)r(pi) 𝑐(𝑞𝑗)c(qj) 𝑟𝑒𝑞(𝑝𝑖)re


𝑚1&𝑚2m
No.

𝑚2m
1 50 100

𝑚2&𝑚3m
2 100 50
3 75 25
The network formed based on the data will look like
-

problem or by finding the minimum 𝑠−𝑡s−t cut of the network formed.


Then one can either solve this problem with the approach used in the maximum flow

 Image Segmentation Problem

In the image segmentation problem, we have been given an image, we want to find

defined for each pixel 𝑖i among 𝑛n pixels of the given image.


what is the foreground and what is the background? We have two non-negative values

𝑓𝑖=fi= probability that pixel 𝑖i is in the foreground.


𝑏𝑖=bi= probability that pixel 𝑖i is in the background.
1.
2.

We will consider a pixel in the foreground if 𝑓𝑖>𝑏𝑖fi>bi and background in the


other case.

vertex 𝑖 𝑎𝑛𝑑 𝑗i and j if they are adjacent to each other as shown below -
In terms of graph data structure, we consider every pixel as a vertex and edge between

pixels 𝑖,𝑗i,j in case one is in the foreground and other in the background.
Now we introduce a new term penalty which we have for each adjacent pair of
We will define a dummy source node connected with all vertices with capacities 𝑓𝑖fi and a
sink node which is also connected to all the vertices with capacities 𝑏𝑖bi also, edges (𝑖,𝑗)
(i,j) and (𝑗,𝑖)(j,i) are added with capacity as 𝑝𝑖𝑗pij between two adjacent pixels.

Then the minimum s-t cut represents pixels assigned to the foreground 𝑃P and pixels
assigned to the background in 𝑄Q.

vv

You might also like