0% found this document useful (0 votes)
14 views44 pages

Lecture 12

The document discusses transport networks in graph theory, defining key concepts such as source, sink, flow, and cuts. It explains the flow conservation principle and the maximum flow problem, emphasizing the relationship between maximum flow and minimum cut through the Max-Flow Min-Cut Theorem. Additionally, it introduces the Ford-Fulkerson algorithm for finding maximum flow in a network.

Uploaded by

man
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views44 pages

Lecture 12

The document discusses transport networks in graph theory, defining key concepts such as source, sink, flow, and cuts. It explains the flow conservation principle and the maximum flow problem, emphasizing the relationship between maximum flow and minimum cut through the Max-Flow Min-Cut Theorem. Additionally, it introduces the Ford-Fulkerson algorithm for finding maximum flow in a network.

Uploaded by

man
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

06/15/2025

Graph Theory
Lecture - 12

Dr. Ilyas Fakhir


06/15/2025
Transport Network
• Let G = (V , E) be a loop-free connected graph. The
G is called a network or transport network if the
following conditions are satisfied:
(i) There exists s unique vertex s ∈ V with id(s), the in
degree of s, equal to 0. This vertex s is called the
source.
(ii) There is a unique vertex t ∈ V, called the sink, where
od(t), the out degree of t, equals 0.
(iii) The graph G is weighted, so there is a function from
E to the set of nonnegative integers that assigns to each
edge e = (v, w) ∈ E a capacity, denoted by c(e) =
c(v, w).
06/15/2025
Flow
• LetG = (V , E) be a transport network, a function f
from E to the nonnegative integers is called a flow
for G if:
(i) f(e) ≤ c(e) for each edge e ∈ E, and
(ii) for each v ∈ V, other than the source s or the sink t,

If there is no edge (v, w), then f(v, w) = 0.


Let f be a flow for a transport network G = (V, E)
(i) An edge e of the network is called saturated if f(e) = c(e).
When f(e) < c(e), the edge is called unsaturated.
(ii) If s is the source of G, then is
called the value of the flow.
06/15/2025
Cut
• If
G = (V, E) is a transport network and C is a cut-set
for the directed graph associated with G, then C is
called a cut, or an s–t cut, if the removal of the
edges in C from the network results in the separation
of s and t.
• Ans-t cut (A, B) is a partition of V into subsets A
and B such that s ∈ A and t ∈ B. We define the cut
value, c(A, B), to be the sum of capacities of all the
edges going from set A to set B.
Example

06/15/2025
• Forexample, the graph in Figure below is a
transport network. Here vertex a is the source, the
sink is at vertex z, and capacities are shown
beside each edge. Since c(a, b) + c(a, g) = 5 + 7
= 12, the amount of the commodity being
transported from a to z cannot exceed 12. With
c(d, z) + c(h, z) = 5 + 6 = 11, the amount is
further restricted to be no greater than 11.
Example

06/15/2025
• In
the Figure below, the flow into vertex g is 5, but
the flow out from that vertex is 2 + 2 = 4.
Hence the function f is not a flow in this case.
Example

06/15/2025
• For the network in Figure below, only the edge (h,
d) is saturated. All other edges are unsaturated.
 The value of the flow in this network is

 We observe that in the network


Example

06/15/2025
• For
the network in Figure below, s-t cuts are
{{s ,a}, {s, c}}, {{s, c}, {a, c}, {a, b}}, etc. The
minimum s-t cut is {{a, b}, {d, b}, {d, t}} which
has capacity as 12+7+4 = 23.
06/15/2025
Some Properties of Flows
06/15/2025
Flow Network

• Problem: Maximize the total amount of flow from


s to t subject to two constraints
 Flow on edge e doesn’t exceed c(e)
 For every node v ≠ s, t, incoming flow is equal to
outgoing flow

10
06/15/2025
Flow
• Capacity Constraint: On any edge e we have f(e) ≤
c(e).
• Flow Conservation: For any vertex v ≠ {s, t}, flow
in equals flow out:
• Subject to these constraints, we want to maximize
the total flow into t. For instance, imagine we want to
route message traffic from the source to the sink, and
the capacities tell us how much bandwidth we’re
allowed on each edge.

11
Example

06/15/2025
• Our goal is to push as much flow as possible from
s to t in the graph. The rules are that no edge can
have flow exceeding its capacity, and for any
vertex except for s and t, the flow into the vertex
must equal the flow out from the vertex.
Example (Contd.)

06/15/2025
• Inthe above graph, what is the maximum flow
from s to t? Answer: 5. Using “capacity[flow]”
notation, the positive flow looks as in Figure
below. Note that the flow can split and rejoin
itself.
Example (Contd.)

06/15/2025
• Howcan you see that the above flow was really
maximum? Notice, this flow saturates the a → c
and s → b edges, and, if you remove these, you
disconnect t from s. In other words, the graph has
an “s-t cut” of size 5 (a set of edges of total
capacity 5 such that if you remove them, this
disconnects the source from the sink).
06/15/2025
Minimum s-t Cut
•A minimum s-t cut in a flow network G is a cut of
minimum value, that is, min{c〈S, T〉 : 〈S, T〉 is an s-t
cut}.
• Example: The s-t cut 〈{s, x, v}, {w, t} 〉 = {(x, w), (v,
t)} appears in Figure below. The capacity of the cut c〈S,
T〉 = c(x, w) + c(v, t) = 13. Notice that (w, v) is a
backward arc and hence its capacity is not included in
the capacity of the cut.
06/15/2025
Example
• The flow f (in parentheses) and s-t cut 〈S, T〉 shown in
Figure below illustrate Fact of flow conservation. In
particular, val(f) = 6, and the flow across the cut, f〈S,
T〉, equals f(x, w) + f(v, t) – f(w, v) = 2 + 5 – 1 = 6.
Max-Flow Min-Cut Theorem

06/15/2025
• Therelationship between the maximum-flow
problem and its dual, the minimum cut problem, is
an example of strong max-min duality that occurs
between certain optimization problems and their
dual problems.
• Let f be the current flow in a network G = (V, E, s,
t, c). An arc (v, w) ∈ E is increasable if f(v, w) <
c(v, w) and is reducible if f(v, w) > 0.
• Let
I denote the set of all increasable arcs, and let
R be the set of all reducible arcs. (Of course, in
general, I ∩ R ≠ ).
Max-Flow Min-Cut Theorem

06/15/2025
• Given a flow f in a network G = (V, E, s, t, c), the
residual network Gf = (V, Ef , s, t, cf ) has vertex-set
V, and the arc-set Ef is constructed from network G as
follows: for each arc (v, w) ∈ E, if arc (v, w) ∈ Ef, then
create an arc (v, w) in Gf , and label it with a residual
capacity cf (v, w) = c(v, w) – f(v, w); if arc (v, w) ∈ R,
then create an arc (w, v) in Gf , and label it cf (w, v) =
f(v, w).
• Given a flow f in a network G = (V, E, s, t, c), a flow-
augmenting path P for network G is a directed s-t
path in the residual network Gf . The capacity of
flow-augmenting path P , is given by
06/15/2025
Example
• The current flow f in the network G shown at the top
in Figure below has value 9. The corresponding
residual network Gf is shown at the bottom.
06/15/2025
Example
• There are exactly two directed paths from s to t in
the residual network, each corresponding to a
different flow-augmenting path for increasing the
flow. One of them is the directed path s → v → w → t
in the network Gf . The arc (v, w) in path P
corresponds to the reducible arc (w, v) in network G.
Notice that cf (p) = 1.
06/15/2025
Example
Few possible cuts in the graph are shown in the
graph and weights of each cut are as follows:
Cut1=25, Cut2=12, Cut3=16, Cut4=10, Cut5=15. As
mentioned, these are only few possible cuts but
considering any valid cut would not have weight less
than Cut4.
Minimum Cut Problem

06/15/2025
•A cut is a node partition (S, T) such that s is in S and
t is in T.
Minimum Cut Problem

06/15/2025
•A cut is a node partition (S, T) such that s is in S and
t is in T.
Minimum Cut Problem

06/15/2025
•A cut is a node partition (S, T) such that s is in S and
t is in T.
Maximum Flow Problem

06/15/2025
Flow

06/15/2025
Flow

06/15/2025
Maximum Flow Problem

06/15/2025
Max-Flow Min-Cut Theorem

06/15/2025
06/15/2025
Example: Algorithm Application
06/15/2025
Iteration – 1
06/15/2025
Iteration – 1
06/15/2025
Iteration – 2
06/15/2025
Iteration – 2
06/15/2025
Iteration – 3
06/15/2025
Iteration – 3
06/15/2025
Iteration – 4
06/15/2025
Iteration – 4
06/15/2025
Max-Flow Value
06/15/2025
Ford-Fulkerson Algorithm
FordFulkerson(Graph G,Node S,Node T):
Initialize flow in all edges to 0
while (there exists an augmenting path(P) between
S and T in residual network graph):
Augment flow between S to T along the path P
Update residual network graph
return
06/15/2025
• An augmenting path is a simple path from
source to sink which do not include any cycles
and that pass only through positive weighted
edges. A residual network graph indicates how
much more flow is allowed in each edge in the
network graph. If there are no augmenting
paths possible from S to T, then the flow is
maximum. The result i.e., the maximum flow
will be the total flow out of source node which
is also equal to total flow into the sink node.
06/15/2025
Example
Graph G
Residual Graph Gf
06/15/2025
Example
Graph G
Residual Graph Gf
06/15/2025
Example
Graph G
Residual Graph Gf

You might also like