Maximum Flow Chapter 26.

Slides:



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

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Network Optimization Models: Maximum Flow Problems
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
The Maximum Network Flow Problem. CSE Network Flows.
1 Maximum Flow 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 
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 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.
Applications of Maximum Flow and Minimum Cut Problems In this handout Transshipment problem Assignment Problem.
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.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
Maximum Flow Chapter 26.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
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.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
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.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
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,
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
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
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Network Flow What is a network? Flow network and flows
Maximum Flow Chapter 26.
The Maximum Network Flow Problem
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
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Graph Algorithms Minimum Spanning Tree (Chap 23)
CS4234 Optimiz(s)ation Algorithms
Algorithms and Networks Hans Bodlaender
Network flow problem [Adapted from M.Chandy].
Richard Anderson Lecture 23 Network Flow
ADVANCED ALGORITHMS GRAPH ALGORITHMS (UNIT-2).
Max Flow – Min Cut Problem
Instructor: Shengyu Zhang
Network Flows and Matching (Supplementary)
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
Network Flow and Connectivity in Wireless Sensor Networks
Flow Networks Topics Flow Networks Residual networks
Richard Anderson Lecture 21 Network Flow
Network Flows and Matching (Supplementary)
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Flow Networks General Characteristics Applications
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
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
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
MAXIMUM flow by Eric Wengert.
Lecture 22 Network Flow, Part 2
Advanced Graph Homer Lee 2013/10/31.
Presentation transcript:

Maximum Flow Chapter 26

Flow Concepts Source vertex s Sink vertex t where material is produced Sink vertex t where material is consumed For all other vertices – what goes in must go out Flow conservation Goal: determine maximum rate of material flow from source to sink

Introduction - network Representation Example: oil pipeline Flow network: directed graph G=(V,E) v1 v3 v1 v3 S S t t v2 v4 source v2 v4 sink

Introduction – max-flow problem Representation Example: oil pipeline Flow network: directed graph G=(V,E) v1 v3 v1 v3 S S t t v2 v4 source v2 v4 sink Informal definition of the max-flow problem: What is the greatest rate at which material can be shipped from the source to the sink without violating any capacity contraints?

Introduction - capacity Representation Example: oil pipeline Flow network: directed graph G=(V,E) 8 3 6 S t v1 v2 v3 v4 v1 v3 S t v2 v4 12 u v c(u,v)=12 c(u,v)=6 Big pipe u v 6 Small pipe

Introduction - capacity Representation Example: oil pipeline Flow network: directed graph G=(V,E) 3 v1 v3 v1 v3 6 8 3 S S t t 3 6 8 v2 v4 v2 v4 6 If (u,v)  E  c(u,v) = 0 6 v2 v4 v4 v3

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 8 3 6 S t v1 v2 v3 v4 v1 v3 S t v2 v4 6/12 u v f(u,v)=6 Flow below capacity 6/6 u v Maximum flow

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 8 3 6 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 8 3 6 6/8 6/6 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 8 3 6 6/8 6/6 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 3/8 3/3 3/6 6/8 6/6 3 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 3/8 3/3 3/6 6/8 6/6 3 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – flow Representation Example: oil pipeline Flow network: directed graph G=(V,E) 5/8 3/3 3/6 8/8 6/6 2/3 3 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – cancellation Representation Example: oil pipeline Flow network: directed graph G=(V,E) 5/8 3/3 3/6 8/8 6/6 2/3 3 S t v1 v2 v3 v4 v1 v3 S t v2 v4

Introduction – cancellation Representation Example: oil pipeline Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 6/8 3/3 4/6 8/8 5/6 6/6 1/3 v1 v3 S t v2 v4 u u u u 10 4 8/10 4 8/10 3/4 5/10 4 v v v v

Maximum Flow Problem Given: Directed graph G=(V, E), Supply (source) node O, demand (sink) node T Capacity function u: E  R . Goal: Given the arc capacities, send as much flow as possible from supply node O to demand node T through the network. Example: O A D B C T 4 5 6

Towards the Augmenting Path Algorithm Idea: Find a path from the source to the sink, and use it to send as much flow as possible. In our example, 5 units of flow can be sent through the path O  B  D  T ; Then use the path O  C  T to send 4 units of flow. The total flow is 5 + 4 = 9 at this point. Can we send more? A 4 4 5 5 O B 5 D 5 6 T 4 5 4 4 4 C 5

Towards the Augmenting Path Algorithm If we redirect 1 unit of flow from path O  B  D  T to path O  B  C  T, then the freed capacity of arc D  T could be used to send 1 more unit of flow through path O  A  D  T, making the total flow equal to 9+1=10 . To realize the idea of redirecting the flow in a systematic way, we need the concept of residual capacities. A 1 4 1 4 4 5 5 O B 5 4 D 5 6 T 4 5 4 4 1 4 5 C 5

Residual Network The network given by the undirected arcs and residual capacities is called residual network. In our example, the residual network before sending any flow: Note that the sum of the residual capacities on both ends of an arc is equal to the original capacity of the arc. How to increase the flow in the network based on the values of residual capacities? O A D B C T 4 5 6

Residual capacities Suppose we have an arc with capacity 6 and current flow 5: Then there is a residual capacity of 6-5=1 for any additional flow through B  D . On the other hand, at most 5 units of flow can be sent back from D to B, i.e., 5 units of previously assigned flow can be canceled. In that sense, 5 can be considered as the residual capacity of the reverse arc D  B . To record the residual capacities in the network, we will replace the original directed arcs with undirected arcs: 5 B D 6 1 5 B D The number at B is the residual capacity of BD; the number at D is the residual capacity of DB.

Augmenting paths An augmenting path is a directed path from the source to the sink in the residual network such that every arc on this path has positive residual capacity. The minimum of these residual capacities is called the residual capacity of the augmenting path. This is the amount that can be feasibly added to the entire path. The flow in the network can be increased by finding an augmenting path and sending flow through it.

Updating the residual network by sending flow through augmenting paths Continuing with the example, Iteration 1: O  B  D  T is an augmenting path with residual capacity 5 = min{5, 6, 5}. After sending 5 units of flow through the path O  B  D  T, the new residual network is: O A D B C T 4 4 5 6 1 5 4 4 5

Updating the residual network by sending flow through augmenting paths Iteration 2: O  C  T is an augmenting path with residual capacity 4 = min{4, 5}. After sending 4 units of flow through the path O  C  T, the new residual network is: O A D B C T 4 4 5 1 5 1 4 4 5 5 4

Updating the residual network by sending flow through augmenting paths Iteration 3: O  A  D  B  C  T is an augmenting path with residual capacity 1 = min{4, 4, 5, 4, 1}. After sending 1 units of flow through the path O  A  D  B  C  T , the new residual network is: O A D B C T 3 1 2 4 5 4 1 5 5 5 4

Terminating the Algorithm: Returning an Optimal Flow There are no augmenting paths in the last residual network. So the flow from the source to the sink cannot be increased further, and the current flow is optimal. Thus, the current residual network is optimal. The optimal flow on each directed arc of the original network is the residual capacity of its reverse arc: flow(OA)=1, flow(OB)=5, flow(OC)=4, flow(AD)=1, flow(BD)=4, flow(BC)=1, flow(DT)=5, flow(CT)=5. The amount of maximum flow through the network is 5 + 4 + 1 = 10 (the sum of path flows of all iterations).

Flow properties

Flow properties Flow network G = (V,E) Note: by skew symmetry 12/12 v1 v3 Note: by skew symmetry f (v3,v1) = - 12 11/16 15/20 10 1/4 7/7 S t 4/9 4/4 8/13 v2 v4 11/14

Net flow and value of a flow f(u,v) = 5 f(v,u) = -5 8/10 3/4 5/10 4 v v 3/3 v1 v3 4/6 6/8 3/3 S t 1/3 6/6 8/8 v2 v4 5/6

The max-flow problem Informal definition of the max-flow problem: What is the greatest rate at which material can be shipped from the source to the sink without violating any capacity contraints? Formal definition of the max-flow problem: The max-flow problem is to find a valid flow for a given weighted directed graph G, that has the maximum value over all valid flows.

The Ford-Fulkerson method a way how to find the max-flow This method contains 3 important ideas:        1) residual networks     2) augmenting paths     3) cuts of flow networks  

Ford-Fulkerson – pseudo code 1 initialize flow f to 0 2 while there exits an augmenting path p 3 do augment flow f along p 4 return f

Ford Fulkerson – residual networks The residual network Gf of a given flow network G with a valid flow f consists of the same vertices v  V as in G which are linked with residual edges (u,v)  Ef that can admit more strictly positive net flow. The residual capacity cf represents the weight of each edge Ef and is the amount of additional net flow f(u,v) before exceeding the capacity c(u,v) Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 v1 v3 v1 v3 5 11 11/16 15/20 10 1/4 7/7 S t S t 4/9 8 5 4/4 8/13 v2 v4 v2 v4 11/14 cf(u,v) = c(u,v) – f(u,v)

Ford Fulkerson – residual networks The residual network Gf of a given flow network G with a valid flow f consists of the same vertices v  V as in G which are linked with residual edges (u,v)  Ef that can admit more strictly positive net flow. The residual capacity cf represents the weight of each edge Ef and is the amount of additional net flow f(u,v) before exceeding the capacity c(u,v) Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 5 15/20 11 4 10 1/4 7/7 11 3 7 15 S t S t 4/9 5 5 4/4 4 8/13 8 3 v2 v4 v2 v4 11/14 11 cf(u,v) = c(u,v) – f(u,v)

Ford Fulkerson – augmenting paths Definition: An augmenting path p is a simple (free of any cycle) path from s to t in the residual network Gf Residual capacity of p cf(p) = min{cf (u,v): (u,v) is on p} Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 5 15/20 11 4 10 1/4 7/7 11 3 7 15 S t S t 4/9 5 5 4/4 4 8/13 8 3 v2 v4 v2 v4 11/14 11

Ford Fulkerson – augmenting paths Definition: An augmenting path p is a simple (free of any cycle) path from s to t in the residual network Gf Residual capacity of p cf(p) = min{cf (u,v): (u,v) is on p} Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 5 15/20 11 4 10 1/4 7/7 11 3 7 15 S t S t 4/9 5 5 4/4 4 8/13 3 v2 v4 8 v2 v4 11/14 11 Augmenting path

Ford Fulkerson – augmenting paths We define a flow: fp: V x V  R such as: cf(p) if (u,v) is on p fp(u,v) = - cf(p) if (v,u) is on p 0 otherwise Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 5 15/20 11 4 10 1/4 7/7 11 3 7 15 S t S t 4/9 5 5 4/4 4 8/13 v2 v4 8 3 v2 v4 11/14 11

Ford Fulkerson – augmenting paths We define a flow: fp: V x V  R such as: cf(p) if (u,v) is on p fp(u,v) = - cf(p) if (v,u) is on p 0 otherwise Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 4/5 15/20 11 4/4 10 1/4 7/7 11 3 7 -4/15 S t S t 4/9 -4/5 4/5 4/4 4 8/13 3 v2 v4 -4/8 v2 v4 11/14 11 Our virtual flow fp along the augmenting path p in Gf

Ford Fulkerson – augmenting paths We define a flow: fp: V x V  R such as: cf(p) if (u,v) is on p fp(u,v) = - cf(p) if (v,u) is on p 0 otherwise Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 4/5 15/20 11 4/4 10 1/4 7/7 11 3 7 -4/15 S t S t 4/9 -4/5 4/5 4/4 4 8/13 3 v2 v4 -4/8 v2 v4 11/14 11 Our virtual flow fp along the augmenting path p in Gf

Ford Fulkerson – augmenting the flow We define a flow: fp: V x V  R such as: cf(p) if (u,v) is on p fp(u,v) = - cf(p) if (v,u) is on p 0 otherwise Flow network G = (V,E) residual network Gf = (V,Ef) 12/12 12 v1 v3 v1 v3 5 11/16 4/5 19/20 11 4/4 10 1/4 7/7 11 3 7 15 S t S t 0/9 5 4/5 4/4 4 12/13 3 v2 v4 8 v2 v4 11/14 11 New flow: f´: V x V  R : f´=f + fp Our virtual flow fp along the augmenting path p in Gf

Ford Fulkerson – new valid flow proof of capacity constraint cf(p) if (u,v) is on p fp(u,v) = - cf(p) if (v,u) is on p 0 otherwise Lemma: f´ : V x V  R : f´ = f + fp in G cf(p) = min{cf (u,v): (u,v) is on p} Capacity constraint: For all u,v  V, we require f(u,v) < c(u,v) cf(u,v) = c(u,v) – f(u,v) Proof: fp (u ,v) < cf (u ,v) = c (u ,v) – f (u ,v)  (f + fp) (u ,v) = f (u ,v) + fp (u ,v) < c (u ,v)

The Ford-Fulkerson method Ford-Fulkerson(G,s,t) 1 for each edge (u,v) in G.E do 2 f(u,v) ¬ f(v,u) ¬ 0 3 while there exists a path p from s to t in residual network Gf do 4 cf = min{cf(u,v): (u,v) is in p} 5 for each edge (u,v) in p do 6 f(u,v) ¬ f(u,v) + cf 7 f(v,u) ¬ -f(u,v) 8 return f The algorithms based on this method differ in how they choose p in step 3. If chosen poorly the algorithm might not terminate.

Execution of Ford-Fulkerson (1) Left Side = Residual Graph Right Side = Augmented Flow

Execution of Ford-Fulkerson (2) Left Side = Residual Graph Right Side = Augmented Flow

Cuts Does the method find the minimum flow? a b t s c d Yes, if we get to the point where the residual graph has no path from s to t A cut is a partition of V into S and T = V – S, such that s  S and t  T The net flow (f(S,T)) through the cut is the sum of flows f(u,v), where s  S and t  T Includes negative flows back from T to S The capacity (c(S,T)) of the cut is the sum of capacities c(u,v), where s  S and t  T The sum of positive capacities Minimum cut – a cut with the smallest capacity of all cuts. |f|= f(S,T) i.e. the value of a max flow is equal to the capacity of a min cut. 8/13 a b 10/15 13/19 10 t s 2/4 9 5/5 6/14 8/11 3/3 c d Cut capacity = 24 Min Cut capacity = 21

Max Flow / Min Cut Theorem Since |f|  c(S,T) for all cuts of (S,T) then if |f| = c(S,T) then c(S,T) must be the min cut of G This implies that f is a maximum flow of G This implies that the residual network Gf contains no augmenting paths. If there were augmenting paths this would contradict that we found the maximum flow of G 1231 … and from 23 we have that the Ford Fulkerson method finds the maximum flow if the residual graph has no augmenting paths.

Worst Case Running Time Assuming integer flow Each augmentation increases the value of the flow by some positive amount. Augmentation can be done in O(E). Total worst-case running time O(E|f*|), where f* is the max-flow found by the algorithm. Example of worst case: Augmenting path of 1 Resulting Residual Network Resulting Residual Network

Application – Bipartite Matching Example – given a community with n men and m women Assume we have a way to determine which couples (man/woman) are compatible for marriage E.g. (Joe, Susan) or (Fred, Susan) but not (Frank, Susan) Problem: Maximize the number of marriages No polygamy allowed Can solve this problem by creating a flow network out of a bipartite graph

Bipartite Graph A bipartite graph is an undirected graph G=(V,E) in which V can be partitioned into two sets V1 and V2 such that (u,v)  E implies either u  V1 and v  V12 or vice versa. That is, all edges go between the two sets V1 and V2 and not within V1 and V2.

Model for Matching Problem Men on leftmost set, women on rightmost set, edges if they are compatible A A A X X X B B B Y Y Y C C C Z Z Z D D D Men Women A matching Optimal matching

Solution Using Max Flow Add a supersouce, supersink, make each undirected edge directed with a flow of 1 A A X X B B t Y s Y C C Z Z D D Since the input is 1, flow conservation prevents multiple matchings

Transshipment Problem Given: Directed network G=(V, E) Supply (source) nodes Si with supply amounts si, i=1,…,p Demand (sink) nodes Di with demand amounts di, i=1,…,q Total supply ≥ total demand Capacity function u: E  R Goal: Find a feasible flow through the network which satisfies the total demand (if such a flow exists). Ex.: 11 2 19 4 5 15 9 17 A D1 B C S1 D2 S2 8 16

Solving the Transshipment Problem via Maximum Flow The transshipment problem can be solved by creating and solving a related instance of maximum flow problem: Create a supersource O. For each supply node Si, add an arc O  Si with capacity equal to the supply amount of Si . Create a supersink T. For each demand node Di, add an arc Di  T with capacity equal to the supply amount of Di . Find the maximum flow from O to T in the resulting auxiliary network. If maximum flow value = total demand then the current maximum flow is a feasible flow for the transshipment problem,else the problem is infeasible 2 19 4 5 15 9 17 11 A D1 B C S1 D2 S2 17 11 T O 16 8 8 16

Solving the Transshipment Problem via Maximum Flow In our example, The maximum flow from O to T is obtained by applying the Augmenting Path algorithm. The maximum flow value is 25. The bold red numbers on the arcs show the flow values. Since the maximum flow value = 25 = 17+8 = total demand, the current maximum flow is a feasible flow for the transshipment problem. 17 8 13 18 1 2 4 5 17 9 16 11 4 A D1 B C S1 D2 S2 5 5 2 17 2 11 5 T O 16 2 15 5 8 4 19 9 8 16

Showing the infeasibility of an assignment problem using minimum-cut-based arguments The O-side of the minimum cut is {O, A, B, D, x, y, z} (the set of the nodes that are reachable from O via augmenting paths) Return to the original network (delete nodes O and T and the arcs incident to them). O 1 A C B people D E F 1 jobs x y z u v w 1 T

Solving the Assignment Problem via Maximum Flow The assignment problem can be solved by creating and solving a related instance of the transshipment problem: Each person-node is considered as a supply node with supply amount 1. Each job-node is considered as a demand node with demand amount 1. Assign capacity 1 to each arc. Solve the resulting transshipment problem by finding maximum flow in the auxiliary network. If maximum flow value = n then the current maximum flow gives a feasible assignment, else the assignment problem is infeasible. 1 A C B people D E jobs x y z u v 1

Solving the Assignment Problem via Maximum Flow In our example, the red numbers on the arcs show the optimal flow values. Since the maximum flow value is 5, the assignment problem is feasible. The feasible assignment is A  x , B  y, C  u , D  z , E  v . O 1 1 A C B people D E 1 jobs x y z u v 1 1 T

Showing the infeasibility of an assignment problem using maximum-flow-based arguments Let’s solve the assignment problem below via maximum flow. The red numbers on the arcs show the optimal flow values. Since the maximum flow value = 5 < 6 = number of jobs, the assignment problem is infeasible. O 1 A C B people D E F 1 jobs x y z u v w 1 T

Showing the infeasibility of an assignment problem using minimum-cut-based arguments The O-side of the minimum cut is {O, A, B, D, x, y, z} (the set of the nodes that are reachable from O via augmenting paths) Return to the original network (delete nodes O and T and the arcs incident to them). O 1 A C B people D E F 1 jobs x y z u v w 1 T