network flows. menger ’ s theorem theorem 7.1. (menger [1927] ) let g be a graph (directed or...
TRANSCRIPT
Network Flows
Menger’s Theorem
Theorem 7.1. (Menger [1927] )
Let G be a graph (directed or undirected), let s and t be two vertices, and k N. Then there are k edge-disjoint s-t-paths if and only if after deleting any k – 1edges t is still reachable from s.
Proof (directed case)
• Necessity is obvious.
• To prove sufficiency in the directed case, let (G, u, s, t) be a network with unit capacities u ≡1such that t is reachable from s even after deleting any k – 1 edges.
• This implies that the minimum capacity of an s-t-cut is at least k.
• By the Max-Flow-Min-Cut Theorem and Corollary 6.7 there is an integral s-t-flow of value at least k.
• By Theorem 6.8 this flow can be decomposed into integral flows on s-t-paths (and possibly some circuits).
• Since all capacities are 1 we must have at least k edge-disjoint s-t-paths.
Proof (undirected case)
• Necessity is obvious.
• Let G be an undirected graph with two vertices s and t such that t is reachable from s even after deleting any k – 1 edges.
Proof (undirected case)
u v
u v
Vertex-disjoint path
• We call two paths vertex-disjoint if they have no edge and no inner vertex in common (they may have one or two common endpoints).
Menger’s Theorem (2)
Theorem 7.2. (Menger [1927] )
Let G be a graph (directed or undirected), let s and t be two non-adjacent vertices, and k N. Then there are k vertex-disjoint s-t-paths if and only if after deleting any k – 1vertices (distinct from s and t) t is still reachable from s.
Proof
v0 v1
v
Proof
v0 v1
v
Any set of k – 1 edges in the new graph whose deletion makes t unreachable from s implies a set of at most k – 1vertices in G whose deletion makes t unreachable from s. Moreover, edge-disjoint s-t-paths in the new graphcorresponds to vertex-disjoint paths in the old one.
k-edge-connected Graph
Corollary 7.3. ( Whitney [1932] ) An undirected graph G with at least two
vertices is k-edge-connected if and only if for each pair s, t V(G) with s ≠ t there are k edge-disjoint s-t-paths.
An undirected graph G with more than k vertices is k-connected if and only if for each pair s, t V(G) with s ≠ t there are k vertex-disjoint s-t-paths.
Proof
• To prove the second statement let G be an undirected graph with more than k vertices.
• If G has k −1 vertices whose deletion makes the graph disconnected, then it cannot have k vertex disjoint s-t-paths for each pair s, t V(G).
• Conversely, if G does not have k vertex-disjoint s-t-paths for some s, t V(G), then we consider two cases.
• If s and t are non-adjacent, then by the 2nd Menger Theorem G has k −1 vertices whose deletion separates s and t.
G is not k-connected.
Proof (s and t are adjacent)
• If s and t are joined by a set F of parallel edges.
• Then G – F has no k – |F| vertex-disjoint s-t-paths. (|F| ≥ 1)
• So by the 2nd Menger Theorem it has a set X of k − |F| – 1 vertices whose deletion separates s and t.
• Let v V(G)\(X {s, t}). Then v cannot be reachable from s and from t in G – F – X.
• Say v is not reachable from t. Add vertex s to X. Then v and t are in different connected components of G – (X {s}).
• |X {s}| = k − |F| ≤ k – 1 G is not k-connected.
Directed Edge-Disjoint Paths Problem
• Instance: Two directed graphs (G, H) on the same vertices.
• Task: Find a family (Pf)fE(H) of edge-disjoint paths in G such that for each f = (t, s) in H, Pf is an s-t-path.
Such a family is called a solution of (G, H). We say that Pf realizes f. The edges of G are called supply edges, the edges of H demand edges. A vertex incident to some demand edge is called a terminal.
Solvable instance
Proposition 7.4.
Let (G, H) be an instance of the Directed Edge-Disjoint Paths Problem where H is just a set of parallel edges and G + H is Eulerian. Then (G, H) has a solution.
Solvable instance
Proposition 7.4.
Let (G, H) be an instance of the Directed Edge-Disjoint Paths Problem where H is just a set of parallel edges and G + H is Eulerian. Then (G, H) has a solution.
Proof (induction on number of parallel edges in H).
Since G + H is Eulerian, every edge, in particular any f E(H),
belong to some circuit C. We take C – F as the first part of our
solution, delete C, and apply induction.
Ford-Fulkerson Algorithm
Input: A network (G, u, s, t). Output: An s-t-flow f of maximum value.
.2 and by along Augment
.min: Compute 3)
. exists none
.path augmenting-an Find 2)
. allfor 0Set 1)
to go
stop thenIf
Pf
eu
Pf
GEeef
fPEe
Edmonds-Karp Algorithm
Input: A network (G, u, s, t). Output: An s-t-flow f of maximum value.
.2 and by along Augment
.min: Compute 3)
. none is there
.path augmenting-shortest a Find 2)
. allfor 0Set 1)
to go
stop thenIf
Pf
eu
Pf
GEeef
fPEe
Lemma
Lemma 7.5.
Let f1, f2, ... be a sequence of flows such that fi+1 results from fi by augmenting along Pi, where Pi is a shortest fi-augmenting path. Then
a) |E(Pk)| ≤ | E(Pk+1)| for all k.
b) |E(Pk)| + 2 ≤ |E(Pl)| for all k < l such that Pk∪Pl contains a pair of reverse edges.
|E(Pk)| ≤ | E(Pk+1)| for all k
• Consider the graph G1, which results from Pk Pk+1 by deleting pairs of reverse edges. (Edges appearing both in Pk and Pk+1 are taken twice.)
Graph G1
St
G1=PkUPk+1 − {reverse edges}
G1
Proof a)
• Consider the graph G1, which results from Pk Pk+1 by deleting pairs of reverse edges. (Edges appearing both in Pk and Pk+1 are taken twice.)
• Note that E(G1) E(Gfk), since any edge in E(Gfk+1
)\E(Gfk)
must be the reverse of an edge in Pk .
Proof a)
• Consider the graph G1, which results from Pk Pk+1 by deleting pairs of reverse edges. (Edges appearing both in Pk and Pk+1 are taken twice.)
• Note that E(G1) E(Gfk), since any edge in E(Gfk+1
)\E(Gfk)
must be the reverse of an edge in Pk .
• Let H1 simply consists of two copies of (t,s).
• Obviously G1+ H1 is Eulerian.
G1+ H1
St
G1=PkUPk+1 − reverse edges
H1 − two edges (t,s)
G1
Proof a)
• Consider the graph G1, which results from Pk Pk+1 by deleting pairs of reverse edges. (Edges appearing both in Pk and Pk+1 are taken twice.)
• Note that E(G1) E(Gfk), since any edge in E(Gfk+1
)\E(Gfk)
must be the reverse of an edge in Pk .
• Let H1 simply consists of two copies of (t,s).
• Obviously G1+ H1 is Eulerian.
• Proposition 7.4. there are two edge disjoint s-t-paths Q1 and Q2.
• E(G1) E(Gfk) both Q1 and Q2 are augmenting paths in Gfk
.
|E(Pk)| ≤ | E(Pk+1)| for all k
• Since Pk was a shortest fk- augmenting path,
|E(Pk)| ≤ |E(Q1)| and |E(Pk)| ≤ |E(Q2)|.
• 2|E(Pk)| ≤ |E(Q1)| + |E(Q2)| ≤ |E(G1)| ≤
≤ |E(Pk)| + |E(Pk+1)|.
• |E(Pk)| ≤ |E(Pk+1)|.
|E(Pk)| + 2 ≤ |E(Pl)| for all k < l such that Pk⋃Pl contains a pair of reverse edges
• Let k < l such that for any i, k < i < l, Pi Pl contains no pair of reverse edges.
• Consider the graph G1, which results from Pk Pl by deleting pairs of reverse edges.
• Again, E(G1) E(Gfk):
– E(Pk) E(Gfk), E(Pl) E(Gfl
)
– Any edge of E(Gfl)\E(Gfk
) must be the reverse of an edge in one of Pk, Pk+1,…, Pl–1.
– But − due to choice of k and l − among these paths only Pk contains the reverse of an edge in Pl .
• 2|E(Pk)| ≤ |E(Q1)| + |E(Q2)| ≤ |E(G1)| ≤
≤ |E(Pk)| + |E(Pk+1)| – 2.
Lemma
Lemma 7.5.
Let f1, f2, ... be a sequence of flows such that fi+1 results from fi by augmenting along Pi, where Pi is a shortest fi-augmenting path. Then
a) |E(Pk)| ≤ | E(Pk+1)| for all k.
b) |E(Pk)| + 2 ≤ |E(Pl)| for all k < l such that Pk∪Pl contains a pair of reverse edges.
Number of Augmentations
Theorem 7.6. (Edmonds, Karp [1972] )
Regardless of the edge capacities, the Edmonds-Karp Algorithm stops after at most mn/2 augmentations, where m is the number of edges and n is the number of vertices.
Proof
• Let P1, P2,… be the augmenting paths chosen during the Edmonds-Karp Algorithm.
• By the choice of γ in step 3 of the algorithm, each augmenting path contains at least one bottleneck edge e: uf (e) = γ.
• For any edge e, let Pi1, Pi2
,… be the subsequence of
augmenting paths containing e as a bottleneck edge.
• Then between Pij, Pij+1
there must be an augmenting path Pк
containing a reverse edge of e.
Proof
• Lemma 7.5 b)
|E(Pij)| + 4 ≤ |E(Pk)| + 2 ≤ |E(Pij+1
)| for all j.
• 1 ≤ |E(Pij)| ≤ n – 1
there can be at most n/4 augmenting paths containing e as a bottleneck edge.
• Since any augmenting path must contain at least one edge of Ğ as a bottleneck edge, there can be at most (n|E(Ğ)|)/4 =(mn)/2 augmenting paths.
Running time of Edmonds-Karp Algorithm
Corollary 7.7.
The Edmonds-Karp Algorithm solves the Maximum Flow Problem in O(m2n) time.
Applications: scheduling problem P.
• Given set of jobs J = {J1,…, Jn} and m parallel identical machines. A processing time pj, a release time rj, and a deadline dj are associated with each job Jj.
• Find a feasible preemptive schedule or decide that none exists.
• Preemption of a job means that processing may be interrupted and resumed at a later time, even on another machine.
• So, a schedule is for each job an allocation of one or more intervals to one or more machines.
• Schedule is feasible if no two time intervals overlap on the same machine, no two time intervals allocated to the same job overlap, and each job Jj is executed inside the interval [rj, dj].
Exersice 7.1
• Find a polynomial time algorithm for the scheduling problem P.
Solution
J1J1
JiJi
JnJn
I1I1
IkIk
IrIr
p1
pi
pn
mTr
mTk
mT1
Tk
Ji+1Ji+1
pi+1 Tk
Let t0 < t1 < …< tr be the ordered sequence of all different ri-values and di-values.
Consider the intervals Ik:=[tk– 1,tk] of length Tk = tk – tk– 1.
Homework
Escape problem
•Given m ≤ n2 starting points (x1, y1), (x2, y2),…, (xm,ym) in the grid, the escape problem is to determine whether or not there are m vertex-disjoint paths from the starting points to any m different points on the boundary.
•Reduce the Escape problem to the Maximum Flow problem.