The Dinitz Algorithm An example of a run.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Network Optimization Models: Maximum Flow Problems
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Maurizio Patrignani seminar on the paper on the single-source unsplittable flow problem authored by Yefim Dinitz Naveen Garg Michel X. Goemans FOCS ‘98.
1 Efficient implementation of Dinic’s algorithm for maximum flow.
CSC 2300 Data Structures & Algorithms April 17, 2007 Chapter 9. Graph Algorithms.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
3 t s the black numbers next to an arc is its capacity.
The Dinitz Algorithm An example of a run. v1v1 Residual & Layered Networks construction s t v2v2 v3v3 v4v4 v5v5 v6v6 v7v
The max-flow problem Defined on a capacitated directed graph G=(V,E,c). The capacities are non-negative G st 11.
7. Preflow-Push Demo. 2 Preflow-Push Algorithm s 2 1 t 10 2 G: 5 3 s 2 1 t G f :
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
and 6.855J The Capacity Scaling Algorithm.
9/23/2015ACM-ICPC1 Maximum Flow Problem Source t fg e 42 Target (sink) flow capacity b s c a de 2/3/ actual flow 1/2/ 1/ 2/ 1.Actual flow  capacity.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
& 6.855J & ESD.78J Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Chapter 7 April 28 Network Flow.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.
1 Network Flow CSC401 – Analysis of Algorithms Chapter 8 Network Flow Objectives: Flow networks –Flow –Cut Maximum flow –Augmenting path –Maximum flow.
Fall 2003Maximum Flow1 w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
ENGM 631 Maximum Flow Solutions. Maximum Flow Models (Flow, Capacity) (0,3) (2,2) (5,7) (0,8) (3,6) (6,8) (3,3) (4,4) (4,10)
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Ford-Fulkerson Recap.
Flow A flow f for a network N is is an assignment of an integer value f(e) to each edge e that satisfies the following properties: Capacity Rule: For each.
Cycle Canceling Algorithm
Max-flow, Min-cut Network flow.
Edmunds-Karp Algorithm: Choosing Good Augmenting Paths
Max-flow, Min-cut Network flow.
Maximum Flow Problem flow capacity Actual flow  capacity
Network Flow 2016/04/12.
Edmonds-Karp Algorithm
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Maximum Flow Reading: CLRS Sections (skipping Lemma 26
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Augmenting Path Algorithm
Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Algorithms (2IL15) – Lecture 7
Successive Shortest Path Algorithm
The Dinitz Algorithm An example of a run.
Network Flow CSE 373 Data Structures.
EE5900 Advanced Embedded System For Smart Infrastructure
Lecture 21 Network Flow, Part 1
Dinitz's algorithm for finding a maximum flow in a network.
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Augmenting Path Algorithm
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
7. Preflow-Push Demo.
Maximum Flow Neil Tang 4/8/2008
Introduction to Maximum Flows
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

The Dinitz Algorithm An example of a run

Residual & Layered Networks construction 9 The original network N v1 v2 v3 9 11 14 v1 v2 v3 11 14 25 1 25 8 1 8 s 5 t s 5 10 t 10 10 5 v5 10 5 v5 v4 6 8 4 v4 6 8 4 9 9 v6 7 v7 v1 v2 v6 7 v7 11 9 25 v5 The residual network Nf (f = 0) s 5 10 t 4 5 v7 v4 9 v6 The layered network Lf

Computing a blocking flow in Lf Finding an augmentation path by arbitrarily backtracking from t Updating the flow v1 v2 0/11 0/9 0/25 v5 s 0/5 0/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Updating the flow v1 v2 0/11 0/9 0/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Updating the flow Cleaning forward v1 v2 0/11 0/9 0/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Finding an augmentation path by arbitrarily backtracking from t. Cleaning forward v1 v2 0/11 0/9 0/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Finding an augmentation path by arbitrarily backtracking from t. Updating the flow. v1 v2 0/11 0/9 0/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Updating the flow. v1 v2 0/11 9/9 9/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Computing a blocking flow in Lf Updating the flow. Cleaning forward v1 v2 0/11 9/9 There aren’t any edges going into t – a blocking flow is found! 9/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Adding the blocking flow to f 0/9 v1 v2 v3 0/11 0/14 0/25 0/1 0/8 s 0/5 t 0/10 0/10 0/5 v5 v4 0/6 0/8 0/4 0/9 v6 0/7 v7 v1 v2 0/11 9/9 9/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Adding the blocking flow to f 9/9 v1 v2 v3 0/11 0/14 9/25 0/1 0/8 s 5/5 t 0/10 5/10 0/5 v5 v4 0/6 0/8 0/4 0/9 v6 0/7 v7 v1 v2 0/11 9/9 9/25 v5 s 5/5 5/10 t 0/4 0/5 v7 v4 0/9 v6

Constructing Nf and Lf v1 v2 v3 v1 v2 v3 s t s t v5 v5 v4 v4 v6 v7 v1 9/9 v1 v2 v3 9 0/11 0/14 v1 v2 v3 11 14 9/25 16 0/1 0/8 9 1 8 s 5/5 t s 5 t 0/10 5/10 10 0/5 v5 5 5 v5 5 v4 0/6 0/8 0/4 v4 6 8 4 0/9 9 v6 0/7 v7 v1 v2 v6 7 v7 11 14 v3 10 16 v4 v5 s 5 8 5 t 4 9 v6 v7 7

Computing a blocking flow in Lf v1 v2 0/11 0/14 v3 0/10 0/16 v4 v5 s 0/5 0/8 0/5 t 0/4 0/9 v6 v7 0/7

Computing a blocking flow in Lf v1 v2 0/11 0/14 v3 0/10 0/16 v4 v5 s 5/5 5/8 5/5 t 0/4 0/9 v6 v7 0/7

Adding the blocking flow to f 9/9 v1 v2 v3 0/11 0/14 9/25 0/1 0/8 s 5/5 t 0/10 5/10 0/5 v5 v4 0/6 0/8 0/4 0/9 v6 0/7 v7 v1 v2 0/11 0/14 v3 0/10 0/16 v4 v5 s 5/5 5/8 5/5 t 0/4 0/9 v6 v7 0/7

Adding the blocking flow to f 9/9 v1 v2 v3 0/11 0/14 9/25 0/1 0/8 s 5/5 t 0/10 10/10 5/5 v5 v4 0/6 5/8 0/4 0/9 v6 0/7 v7 v1 v2 0/11 0/14 v3 0/10 0/16 v4 v5 s 5/5 5/8 5/5 t 0/4 0/9 v6 v7 0/7

Constructing Nf and Lf v1 v2 v3 v1 v2 v3 s t s t v5 v5 v4 v4 v6 v7 v6 9/9 v1 v2 v3 9 0/11 0/14 v1 v2 v3 11 14 9/25 16 0/1 0/8 9 1 0/8 s 5/5 t s 5 t 0/10 10/10 10 5/5 v5 v5 5 3 10 v4 0/6 5/8 6 0/4 v4 5 4 0/9 9 v6 0/7 v7 v6 7 v7 v1 v2 v3 11 14 1 8 16 10 v5 v4 s 5 t 9 4 v7 6 v6

Computing a blocking flow in Lf v1 v2 v3 0/11 0/14 0/1 0/8 0/16 0/10 v5 v4 s 0/5 t 0/9 0/4 v7 0/6 v6

Computing a blocking flow in Lf v1 v2 v3 0/11 0/14 0/1 0/8 4/16 4/10 v5 v4 s 0/5 t 0/9 4/4 v7 4/6 v6

Computing a blocking flow in Lf v1 v2 v3 0/11 0/14 0/1 0/8 4/16 4/10 v5 v4 s 0/5 t 0/9 4/4 v7 4/6 v6

Computing a blocking flow in Lf v1 v2 v3 8/11 8/14 0/1 8/8 12/16 4/10 v5 v4 s 0/5 t 0/9 4/4 v7 4/6 v6

Adding the blocking flow to f 9/9 v1 v2 v3 0/11 0/14 9/25 0/1 0/8 s 5/5 t 0/10 10/10 5/5 v5 v4 0/6 5/8 0/4 0/9 v6 0/7 v7 v1 v2 v3 8/11 8/14 0/1 8/8 12/16 4/10 v5 v4 s 0/5 t 0/9 4/4 v7 4/6 v6

Adding the blocking flow to f 9/9 v1 v2 v3 8/11 8/14 21/25 0/1 8/8 s 5/5 t 4/10 10/10 5/5 v5 v4 4/6 5/8 4/4 0/9 v6 0/7 v7 v1 v2 v3 8/11 8/14 0/1 8/8 12/16 4/10 v5 v4 s 0/5 t 0/9 4/4 v7 4/6 v6

Constructing Nf and Lf v1 v2 v3 v1 v2 v3 s t s t v5 v5 v4 v4 v6 v7 v6 9/9 v1 v2 v3 9 8/11 8/14 v1 3 v2 6 v3 21/25 8 8 4 0/1 8/8 1 8 s 21 4 5/5 t s 5 t 4/10 10/10 6 5/5 v5 v5 10 5 3 v4 4/6 5/8 4/4 v4 5 2 4 4 0/9 9 v6 0/7 v7 v6 7 v7 v1 v2 v3 3 6 1 6 4 v5 v4 v6 v7 s 5 9 7 2 t

Computing a blocking flow in Lf v1 v2 v3 0/3 0/6 0/1 0/4 0/6 v5 v4 v6 v7 s 0/5 0/9 0/7 0/2 t

Computing a blocking flow in Lf v1 v2 v3 0/3 0/6 0/1 2/4 2/6 v5 v4 v6 v7 s 2/5 2/9 2/7 2/2 t

Adding the blocking flow to f 9/9 v1 v2 v3 8/11 8/14 21/25 0/1 8/8 s 5/5 t 4/10 10/10 5/5 v5 v4 4/6 5/8 4/4 0/9 v6 0/7 v7 v1 v2 v3 0/3 0/6 0/1 2/4 2/6 v5 v4 v6 v7 s 2/5 2/9 2/7 2/2 t

Adding the blocking flow to f 9/9 v1 v2 v3 8/11 8/14 23/25 0/1 8/8 s 5/5 t 6/10 10/10 5/5 v5 v4 6/6 3/8 4/4 2/9 v6 2/7 v7 v1 v2 v3 0/3 0/6 0/1 2/2 2/6 v5 v4 v6 v7 s 2/5 2/9 2/7 2/2 t

Termination: no path from s to t in Nf 9/9 v1 v2 v3 9 8/11 8/14 v1 3 v2 6 v3 23/25 8 8 0/1 2 8/8 1 8 s 23 4 5/5 t s 6/10 5 t 10/10 6 5/5 v5 v5 10 5 5 v4 6/6 3/8 v4 3 4/4 6 4 7 2/9 2 5 v6 2/7 v7 v6 2 v7 The flow f is maximal!