Flow Network Talk
-
Upload
imane-haf -
Category
Technology
-
view
783 -
download
2
description
Transcript of Flow Network Talk
Flow Networks
Imane Hafnaoui
M’Hamed Bouguara University - BoumerdesInstitute of electricity and electronics
2011 - 2012
Talk presented by
OUTILINES
1. Introduction2. Max Flow Problem3. Residual Network4. Augmenting Path5. Flow and Cut6. Max Flow – Min Cut Theorem7. Ford-Fulkerson Algorithm
Introduction
1. Flow Network Definition It is a weighted directed graph G=(V,E) where every edge has a non-negative weight called capacity and receives a flow on each edge.
It has two distinguished vertices s and t (source and sink) such that s has no incoming edges and t has no outgoing edges.
Application:Flow networks can be used to model traffic in roads, fluids flow in pipes, current flow in electrical systems, etc
Introduction
2. Flow definitionIt is a function f : V x V → R that
satisfieso Capacity constraint
o Flow conservation : for u, v Є V- {s,t}
The value of the flow, denoted |f|, is the total flow from the source s; and in the same way, to the sink t.
Max Flow Problem
Given a network G, a flow is said to be maximum if |f| is the largest of all flows in G.
The Max Flow Problem consists of finding the maximum feasible flow from s to t without violating any capacity constraints.
| f | max = 4 + 3 + 3 = 10
Ford-Fulkerson Method
• This method covers many implementations with differing running times and depends on three important ideas:
a. Residual Networkb. Augmenting pathc. Cuts
In this talk, only the Ford-Fulkerson Algorithm will be discussed which depends itself on the three previously mentioned concepts.
Residual NetworkGiven a network G = (V, E) with flow f, a residual network Gf (V, Ef) is a graph with residual capacities such that:
It introduces reverse edges where increase in flow in one direction is not possible or a decrease is necessary.
Example:
u v6 / 17
CapacityFlow
u v
11
6
Lemma
• Given a network G (V, E) and its residual network Gf (V, Ef),
|Ef| 2 |E|
ProofThat is each residual edge can admit a flow f >
0. The edges in Ef are either edges in E or their reversals.
Thus, |Ef| 2 |E|
Augmenting Path
Given a flow network G and a flow f, an augmenting path p is a path from s to t in the residual network Gf
We define the residual capacity of the path cf(p) as the max amount by which we can increase the flow, where:
cf (p) = min {cf (u,v) : (u, v) ∈ p}
Flow Augmentation
LemmaLet f p be the flow in Gf defined
And we augment f by f p . The augmented flow f ‘ is
| f ‘| = | f | + | f p|> | f |
Cuts• A cut (S, T) = ( Vs, Vt) of a
network G(V, E) is a partition of the vertices in V such that s ∈ VS and t ∈ Vt
Forward edge of cut : origin in Vs and destination in Vt
Backward edge of cut: origin in Vt and destination in Vs
• Flow f (S, T) across a cut:
• Capacity C(S, T) of a cut:
C(S, T) = 24f (S, T) = 8
CutsLemma
f (S, T) = | f |TheoremThe value of any flow is bounded
from the above by the capacity of any cut:
| f | c(S,T)Proof
Max Flow Min Cut Theorem
If f is a flow in a flow network G = (V, E) with source s and sink t , then The value of the max flow is equal to the value of the min cut.
Proof: The following conditions are equivalent:
1. | f | is a maximum flow in G.2. The residual network Gf has no augmenting
paths.3. | f | = C(S,T) (min cut)
Proof
• (1) (2): we assume | f | is a max flow. If an augmenting path exists then by the equation
| f ‘| = | f | + | f p| the augmented flow | f ‘| is strictly greater than | f |. Hence, the assumption is wrong.
• (2) (3): Suppose that Gf has no augmenting path (no path from s to t). Consider a cut (S,T) s.t.
S = {v ∈ V: there exists a path from s to v in Gf } and
T = V-S. Let u ∈ S and v ∈ T.
Proof
we must have f(u, v) = c(u, v) since otherwise (u, v) ∈ Ef , which would place v in set S.
By lemma, f (S, T) = | f | = C(S,T)
• (3) (1): By theorem, we have | f | c(S,T). So if | f | = C(S,T), it implies that | f | is maximum flow.
Ford-Fulkerson Algorithm
FORD-FULKERSON(G; s; t) for each edge (u, v) ∈ G(V, E) do
f (u, v) = 0
while G has an augmenting path p do cf (p) = min {cf (u,v) : (u, v) ∈ p}
for each edge (u, v) in p do if (u, v) ∈ E
f (u, v) = f (u, v) + cf (p)
elsef (v, u) = f (v, u) - cf (p)
...
end.
Thanks For Your Attention