Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.

Slides:



Advertisements
Similar presentations
1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
Advertisements

Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
The Maximum Network Flow Problem. CSE Network Flows.
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.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
Chapter 26 of CLSR Maximum Network Flow by me Dr. M. Sakalli Ch26 of CSLR and many other sources. Marmara Univ. Picture taken from without permission.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
1 The Max Flow Problem. 2 Flow networks Flow networks are the problem instances of the max flow problem. A flow network is given by 1) a directed graph.
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network.
1 Maximum flow problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.
1 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method Maximum bipartite matching.
1 Optimization Spring 2007 (Third Quarter). 2 Some practical remarks Homepage: Exam: Written, 3 hours. There.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
The max flow problem
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Chapter 27 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method m bipartite matching.
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2008 Lecture 5 Tuesday, 10/7/08 Graph Algorithms: Part 2.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 5 Wednesday, 10/4/06 Graph Algorithms: Part 2.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
1 The Min Cost Flow Problem. 2 Flow Networks with Costs Flow networks with costs are the problem instances of the min cost flow problem. A flow network.
1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
1 The Min Cost Flow Problem. 2 The Min Cost Flow problem We want to talk about multi-source, multi-sink flows than just “flows from s to t”. We want to.
Assignment 4. (Due on Dec 2. 2:30 p.m.) This time, Prof. Yao and I can explain the questions, but we will NOT tell you how to solve the problems. Question.
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
Maximum Flow Chapter 26.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm.
Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Flow Networks & Flows.
Maximum Flow Chapter 26. Flow Concepts Source vertex s – where material is produced Sink vertex t – where material is consumed For all other vertices.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Chapter 7 April 28 Network Flow.
Algorithm Design and Analysis (ADA)
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.
Flow Networks Ching-Chen Huang Hsi-Yue Hsiao. CONTENTS Network flows on directed acyclic graphs Ford-fulkerson Algorithms -Residual networks.
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.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Network Flow What is a network? Flow network and flows
The Maximum Network Flow Problem
Maximum Flow Chapter 26.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Graph Algorithms Minimum Spanning Tree (Chap 23)
Network flow problem [Adapted from M.Chandy].
Network Flows and Matching (Supplementary)
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
Flow Networks Topics Flow Networks Residual networks
Network Flows and Matching (Supplementary)
Flow Networks General Characteristics Applications
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

Maximum Flow Problem Definitions and notations The Ford-Fulkerson method

Flow Networks

Flow Given a flow network G=(V,E) with capacity function c. Let s be the source and t the sink. A flow in G is a real-valued function f: V×V  R satisfying the following three properties: Capacity constraint: For all u,v  V, f(u,v)  c( u,v). Skew symmetry: For all u,v  V, f(u,v) = -f(v, u). Flow conservation: For all u  V-{s,t}, If (u, v)  E, and (v, u)  E, then we must have f (u, v) = f (v, u) = 0. By skew symmetry, for all v  V-{s,t},

Value of a Flow The value of a flow is defined as

Maximum-flow Problem Input: a flow network G with source s and sink t. Output: a flow of maximum value

Working with Flows If X and Y are sets of vertices in a flow network, then The flow conversation property can be expressed as for all u  V-{s,t}

Working with Flows

Maximum-flow Problem Input: a flow network G with source s and sink t Output: a flow of maximum value How to solve it efficiently?

The Ford-Fulkerson Method Why “method” not “algorithm”? The Ford-Fulkerson method depends on three important ideas: Residual Network, Augmenting Path, and Cut. These ideas are essential to the important max-flow min-cut theorem, which characterizes the value of maximum flow in terms of cuts of the flow network.

The Ford-Fulkerson Method FORD-FULKERSON-METHOD(G, s, t) 1.initialize flow f to 0 2.while there exists an augmenting path p 3. do augment flow f along p 4.return f

Residual Networks Given a flow network and a flow, the residual network consists of edges that can admit more flow. More formally, given: G=(V, E): a flow network with source s and sink t f: a flow in G. the residual capacity of (u,v), given by: c f (u,v) = c(u,v) - f(u,v) Residual network: G f = (V, E f ), where E f ={(u,v)  V × V: c f (u,v) > 0}

Residual Networks (example)

The relationship between a flow in a residual network and one in the original network *

Augmenting paths Given a flow network G=(V, E) and a flow f, an augmenting path is a simple path from s to t in the residual network G f. Residual capacity of p : the maximum amount by which we can increase the flow along the edges of an augmenting path p, i.e., c f (p) = min { c f (u,v): (u,v) is on p} The residual capacity is 1.

Augmenting Path (example)

Augmenting Path

Cut Cut (S, T): S is a subset of V, T =V-S, s  S and t  T. Net flow across the cut (S,T): f(S,T) Capacity of the cut (S,T): c(S,T) Minimum cut of a network:

Cut

The Basic Ford-Fulkerson Algorithm

Analysis of the algorithm The running time of the algorithm depends on how the augmenting path is determined. If it is chosen poorly, the algorithm even dose not terminate. If the capacities are integers, the time complexity is O(E f*), where f* is the value of a maximum flow. If we use breadth-first search to find the augmenting path, we can improve the time complexity to O(VE 2 ) (Edmonds-Karp algorithm)

The Edmonds-Karp algorithm Lemma 26.8 If the Edmonds-Karp algorithm is run on a flow network G = (V, E) with source s and sink t, then fro all vertices v  V-{s,t}, the shortest-path distance  f(s, v) in the residual network Gf increases monotonically with each flow augmentation.

Edmonds-Karp algorithm Theorem 26.9 If the Edmonds-Karp algorithm is run on a flow network G = (V, E) with source s and sink t, then the total number of flow augmentations performed by the algorithm is O(VE).

An example s t b