CS 170 DISCUSSION 10 MAXIMUM FLOW. Raymond Chan raychan3.github.io/cs170/fa17.html UC Berkeley Fall 17

Similar documents
1 Review for Lecture 2 MaxFlow

CMPSCI 611: Advanced Algorithms

Running Time. Assumption. All capacities are integers between 1 and C.

The maximum flow problem

Flow Network. The following figure shows an example of a flow network:

Lecture 8 Network Optimization Algorithms

10 Max-Flow Min-Cut Flows and Capacitated Graphs 10 MAX-FLOW MIN-CUT

Algorithms: COMP3121/3821/9101/9801

Maximum Flow. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Maximum Flow 1 / 27

CSC 373: Algorithm Design and Analysis Lecture 12

Algorithms and Theory of Computation. Lecture 11: Network Flow

CS 1501 Recitation. Xiang Xiao

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming

Types of Networks. Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas

Algorithm Design and Analysis

Energy minimization via graph-cuts

Discrete Optimization 2010 Lecture 3 Maximum Flows

Algorithm Design and Analysis

Two Applications of Maximum Flow

CSE 326: Data Structures Network Flow. James Fogarty Autumn 2007

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?

Maximum flow problem

Review Questions, Final Exam

Lecture 2: Network Flows 1

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa

p 3 p 2 p 4 q 2 q 7 q 1 q 3 q 6 q 5

2.13 Maximum flow with a strictly positive initial feasible flow

Internet Routing Example

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

The max flow problem. Ford-Fulkerson method. A cut. Lemma Corollary Max Flow Min Cut Theorem. Max Flow Min Cut Theorem

Max Flow: Algorithms and Applications

The min cost flow problem Course notes for Optimization Spring 2007

Maximum flow problem CE 377K. February 26, 2015

6.046 Recitation 11 Handout

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015

The min cost flow problem Course notes for Search and Optimization Spring 2004

(1,3) (3,4) (2,2) (1,2) (2,4) t

The Simplest and Smallest Network on Which the Ford-Fulkerson Maximum Flow Procedure May Fail to Terminate

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

Soviet Rail Network, 1955

Algorithm Design and Analysis

CMSC 451: Max-Flow Extensions

Algorithms: Lecture 12. Chalmers University of Technology

Exposition of the Dinitz algorithm

Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs

Parallel Graph Algorithms (con4nued)

7.5 Bipartite Matching

Minimum cost transportation problem

Basics on the Graphcut Algorithm. Application for the Computation of the Mode of the Ising Model

An example of LP problem: Political Elections

Network Flow Problems Luis Goddyn, Math 408

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

CSE 202 Homework 4 Matthias Springer, A

Mathematics for Decision Making: An Introduction. Lecture 13

New Theory and Algorithms for Scheduling Arc Shutdown Jobs in Networks

Maximum Integer Flows in Directed Planar Graphs with Multiple Sources and Sinks and Vertex Capacities

Parallel Graph Algorithms (con4nued)

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Selected partial inverse combinatorial optimization problems with forbidden elements. Elisabeth Gassner

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

- Well-characterized problems, min-max relations, approximate certificates. - LP problems in the standard form, primal and dual linear programs

Maximum flow problem (part I)

Maximum Flow Problem (Ford and Fulkerson, 1956)

Midterm Exam 2 Solutions

C&O 355 Mathematical Programming Fall 2010 Lecture 18. N. Harvey

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

. CS711008Z Algorithm Design and Analysis. Lecture 10. Algorithm design technique: Network flow and its applications 1. Dongbo Bu

Lecture 18: More NP-Complete Problems

Algorithms and Data Structures 2014 Exercises and Solutions Week 14

The partial inverse minimum cut problem with L 1 -norm is strongly NP-hard. Elisabeth Gassner

Flows. Chapter Circulations

The α-maximum Flow Model with Uncertain Capacities

Maximum Skew-Symmetric Flows. September Abstract

Friday, September 21, Flows

ORIE 633 Network Flows October 4, Lecture 10

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Lecture 5 January 16, 2013

Module 7-2 Decomposition Approach

Network Flows made simple

Lecture 21 November 11, 2014

(tree searching technique) (Boolean formulas) satisfying assignment: (X 1, X 2 )

2. A vertex in G is central if its greatest distance from any other vertex is as small as possible. This distance is the radius of G.

22 Max-Flow Algorithms

Symmetric chain decompositions of partially ordered sets

Network Flows. 7. Multicommodity Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

Mathematical Programs Linear Program (LP)

Network Flows. 4. Maximum Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

Network Flows. CTU FEE Department of control engineering. March 28, 2017

Maximum skew-symmetric flows and matchings

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017)

Algorithm Theory - Exercise Class

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows

Bulletin of the Transilvania University of Braşov Vol 8(57), No Series III: Mathematics, Informatics, Physics,

III. Linear Programming

An Introduction to Network Flows Over Time

The Transportation Problem. Experience the Joy! Feel the Excitement! Share in the Pleasure!

Linear Programming. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Linear Programming 1 / 47

Transcription:

7 IUION MXIMUM FLOW Raymond han raychan.github.io/cs7/fa7.html U erkeley Fall 7

MXIMUM FLOW Given a directed graph G = (V, E), send as many units of flow from source node s to sink node t. Edges have capacity constraints. When sending flow through some path, flow must be at most the capacity constraint of every edge. Number of units sent from s = number of units received by t. pplications: supply chain shipping, network flows, supply and demand shipping (need modification). Raymond han, U erkeley Fall 7

MXIMUM FLOW Max Flow Linear Program Raymond han, U erkeley Fall 7

REIUL GRPH When sending f uv through edge (u, v), we create a residual back edge (v, u). apacity of (u, v) = c uv - f uv apacity of (v, u) = f uv Keep sending flows from s to t. Once we have no path from s to t, we have the maximum flow. Edges can be removed if capacity reaches. his will ensure we won t have a path eventually. an use residual edges later to go back on previous flow decisions. Raymond han, U erkeley Fall 7

MX FLOW LGORIHM Ford-Fulkerson algorithm. In each iteration, send as many units of flow as possible and build residual graph. top condition: no s-t path in residual graph. Edmond-Karp algorithm. Find shortest s-t path via F in terms of edge hops. end as many units of flow as possible and build residual graph until no s-t path. If capacities are integral, solution flows are integral, runtime is O( V E ). Raymond han, U erkeley Fall 7

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE

MX FLOW REIUL GRPH EXMPLE Raymond han, U erkeley Fall 7

MX FLOW REIUL GRPH EXMPLE Raymond han, U erkeley Fall 7

MX FLOW REIUL GRPH EXMPLE uppose we send units through first. Raymond han, U erkeley Fall 7

MX FLOW REIUL GRPH EXMPLE end units via. Raymond han, U erkeley Fall 7

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via.

Raymond han, U erkeley Fall 7 end units via. end units via. end unit via. MX FLOW REIUL GRPH EXMPLE

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via. end unit via.

Raymond han, U erkeley Fall 7 MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via. end unit via.

MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via. end unit via. Raymond han, U erkeley Fall 7

MX FLOW REIUL GRPH EXMPLE end units via. end units via. end unit via. end unit via. No more s-t path. Maximum flow is 6. fter computing max flow, output edges with their respective flows (see flow graph). Raymond han, U erkeley Fall 7

MINIMUM U cut partitions the vertices into two disjoint sets L and R. he capacity of a cut is the sum of edges that crosses the cut (go from L to R). (s, t)-cut partitions graph such that L contains s and all vertices s can reach and R contain t and all vertices that can reach t. For any flow f and any (s, t)-cut (L, R), size(f) capacity(l, R). he capacity of the cuts provide an upper bound of the maximum flow. ize of maximum flow equals to capacity of smallest s-t cut. Raymond han, U erkeley Fall 7

MINIMUM U {} and {,,,, } forms a min cut. {,,,, } and {} forms another min cut. Minimum cut will contain only edges in the residual graph that goes from R to L. In the original graph, only edges from L to R in the minimum cut. hese edges are fully saturated (at full capacity). Raymond han, U erkeley Fall 7

REUION When using Max Flow to solve problems, make use of reduction. Reduction: solve problem by solving problem. uppose we have a problem, Preprocess input to fit inputs for problem (suppose max flow). olve problem. Postprocess output of problem to fit output of problem. Example. Use Max flow to solve network flows with supply and demand nodes. Raymond han, U erkeley Fall 7