.4 Nework flow Problem involving he diribuion of a given produc (e.g., waer, ga, daa, ) from a e of producion locaion o a e of uer o a o opimize a given objecive funcion (e.g., amoun of produc, co,...). Many direc and indirec applicaion elecommunicaion ranporaion (public, freigh, railway, air, ) logiic E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
.4. Maximum flow problem Definiion: A nework i a direced and conneced graph G =(V, A) wih a ource V and a ink V wih, and a capaciy k ij 0 for each arc (i, j) A. 3 3 - ()= + ()=Ø capaciy k ij of arc (i, j) E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
A feaible flow x from o i a vecor x R m wih a componen x ij for each arc (i,j) A aifying he capaciy conrain 0 x ij k ij (i, j) A, 0,3 and he flow balance conrain in each, 0, inermediae node h V ( h, ) 0,3, Flow x of value φ= x ih x hj ( i, h) ( h) ( h, j) h) h V \{, } ( amoun enering in h = amoun exiing from h ) x j (, j) ( ) The value of flow x : φ wih + ()={ (, j) : (, j)a } E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 3
Given a nework and a feaible flow x, an arc (i, j) A i auraed x ij = k ij if empy x ij = 0, 0,3, 0, 0,3, empy auraed E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 4
Problem Given a nework G = (V, A) wih an ineger capaciy k ij for each arc (i,j) A, and node, V, deermine a feaible flow from o of maximum value. Obervaion: If here are many ource/ink wih a unique ype of produc : * * - (*)=Ø + (*)=Ø capaciy = availabiliy limi, if any capaciy = + E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 5
Linear programming model max φ.. x hj x ih ( h, j) ( h) ( i, h) ( h) φ if h = -φ if h = 0 oherwie amoun exiing from 0 x ij k ij (i,j) A x ij R, φ R where φ denoe he value of he feaible flow x E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 6
Definiion:.4. Cu, feaible flow and weak dualiy ) A cu eparaing from i δ(s) of G wih S V and V \S. Number of cu eparaing from? n- wih n= V ) Capaciy of he cu δ(s) induced by S: k ( S ) S ( i, j ) k ij ( S ) 3 3 capaciy k(s) = 7 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 7
3) Given a feaible flow x from o and a cu δ(s) wih S and S, he value of he feaible flow x hrough he cu δ(s) i ( S) ( i, j) x ij x ( S ) ij ( i, j) ( S ) S,,3 0,,,3, φ(s) = + 0 + - = 3 Wih hi noaion he value of he flow x i φ({}). E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 8
Propery Given a feaible flow x from o, for each cu δ(s) eparaing from, we have φ(s) = φ({}). S Implied by he flow balance equaion v V\{, }. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 9
Propery For each feaible flow x from o and each cu δ(s), wih S V, eparaing from, we have value of he flow φ(s) k(s) capaciy of he cu Proof Since φ(s) = k ij x ij ij ij ( i, j) ( S ) ( i, j) ( S ) ( i, j) ( S ) 0 x k = k(s) definiion of value of he flow hrough he cu δ(s) E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 0
Conequence: If φ(s) = k(s) for a ube S V wih S and S, hen x i a flow of maximum value and he cu δ(s) i of minimum capaciy. The propery φ(s) k(s) feaible flow x and cu δ(s) eparaing from, expree a weak dualiy relaionhip beween he wo problem: Primal problem: Given G = (V, A) wih ineger capaciie on he arc and, V, deermine a feaible flow of maximum value. Dual problem: Given G = (V, A) wih ineger capaciie on he arc and, V, deermine a cu (eparaing from ) of minimum capaciy. We hall ee ha uch a relaionhip hold for all LP! E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
.4.3 Ford-Fulkeron algorihm D. R. Fulkeron (94-976) Idea: Sar from a feaible flow x and ry o ieraively increae i value φ by ending, a each ieraion, an addiional amoun of produc along a(n undireced) pah from o wih a ricly poiive reidual capaciy., 0,3, 0, 0,3,,3,,3,,3,,,3, φ 0 = φ({}) = φ = δ = φ({}) = E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
Can he value of he curren feaible flow x be increaed?,,3,,,3, φ({}) = If (i, j) i no auraed (x ij k ij ), we can increae x ij If (i, j) i no empy (x ij 0), we can decreae x ij while repecing 0 x ij k ij,,3,,,3, φ({}) =,3,,3 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 3
,,3,,,3, φ({}) = forward arc,,,3,,3 backward arc, We can end δ = addional uni of produc from o : +δ along forward arc -δ along backward arc Raionale: The uni of produc ha wa going from o i redireced o and he miing uni in i upplied from.,, φ({}) = + δ + δ,3 - δ, + δ,3, E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 4
Definiion: A pah P from o i an augmening pah wih repec o he curren feaible flow x if x ij k ij for all forward arc and x ij 0 for all backward arc. Since he maximum addiional amoun of produc ha can be en along he augmening pah - - -,, φ({}) = + δ + δ,3 - δ, + δ,3 i equal o δ=, we obain he new feaible flow x,,, φ({}) = 3,3 0,,3, E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 5
Given a feaible flow x for G = (V, A), we conruc he reidual nework G = (V, A) aociaed o x, which accoun for all poible flow variaion wih repec o x. If (i, j) A i no auraed, (i, j) A wih k ij = k ij x ij 0. reidual capaciy If (i, j) A i no empy, (j, i) A wih k ji = x ij 0. G curren feaible flow x of value 3,4, capaciy,,3, E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 6 G 3 reidual capaciy
G, +δ,3 +δ,4 - δ,, New feaible flow x of value φ = 3 + δ (δ = ) A each ieraion: To look for an augmening pah from o in G, we earch for a pah from o in G. If an augmening pah from o, he curren flow x i no opimal (of maximum value). E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 7
Example G 0, 0, 0, 0, 5 6 4 0, 3 0, 0, 0, 0, 0, 0, Augmening pah along which we can end δ = addiional uni of produc 0,4 7 Iniial feaible flow x 0 = 0 of value φ 0 = 0 Obervaion: For x = 0, G = G G 5 6 δ = 4 3 7 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 8 4
G 0,, 0, 5 6 0, 0, 0, 3,, 0,4 δ = 7 feaible flow x of value φ = 0, 0, 0, 4 augmening pah wih δ = wih repec o he curren feaible flow x G 5 6 3 δ = 4 7 4 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 9
G,,, 5 6 0, 0, 0, 3,,,4 7 feaible flow x of value φ = 4 0, 0, 0, 4 augmening pah wih δ = wih repec o he curren feaible flow x G 5 6 3 δ = 7 4 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 0
G, 5 6,,, 4 3,,, S * = {, 4} ube of all he node reachable from he ource (node ), 3,4 7 G 5 6 feaible flow x 3 of value φ 3 = 5 3 4 G ( S * ) 7 i no reachable from (only 4 i reachable) STOP 3 7 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
G, 5 6,, 0,, 3,, 3,4 7 feaible flow x 3 of value φ 3 = 5, 0,, 4 Cu δ G (S * ) of capaciy = 5 and feaible flow x 3 of value φ 3 = 5! Obervaion: All ougoing arc of δ G (S * ) are auraed and all enering one are empy G S * = {, 4} 5 6 3 4 3 7 E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano
Propoiion: Ford-Fulkeron algorihm i exac. Proof A feaible flow x i of maximum value i no reachable from in he reidual nework G aociaed o x. ( ) If an aumening pah, x i no opimal. ( ) If i no reachable from, cu of G uch ha G ( S * ) By definiion of G, we have every (i, j) ( S * ) i auraed every (i, j) ( S * ) i empy. G G S * V E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 3
Therefore k ij 0 φ(s * ) = ( i, j) G = x ij * ( S ) ( i, j) G = x ij * ( S ) ( i, j) G k ij * ( S ) = k(s * ) all auraed all empy S * Weak dualiy: φ(s) k(s) x feaible S V, S, S he feaible flow x i of maximum value and he cu induced by S *, namely δ G (S * ), i of minimum capaciy. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 4
The algorihm implie: Theorem (Ford-Fulkeron) The value of a feaible fow of maximum value = he capaciy of a cu of minimum capaciy. Obervaion: rong dualiy If all he capaciie k ij are ineger ( Z + ), he flow x of maximum value ha all x ij ineger and an ineger value φ*. Ford-Fulkeron algorihm i no greedy (x ij alo decreaed). E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 5
Ford-Fulkeron algorihm Inpu G = (V, A), capaciy k ij >0 (i, j)a, ource V, ink V Oupu Feaible flow x from o of maximum value φ* BEGIN x:=0; φ:=0; opimum:=fale; /* iniializaion */ REPEAT Build reidual nework G aociaed o x; Deermine, if, a pah P from o in G; IF P doe no exi THEN opimum := rue; ELSE δ:= min {k ij : (i,j) P}; φ:= φ + δ; FOR EACH (i,j) P DO IF (i,j) i forward THEN x ij := x ij + δ; ELSE x ji := x ji δ; END-IF END-IF UNTIL opimum = rue; END Maximum number of cycle? O(m) O(n+m) O(n) O(n) E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 6
Complexiy Since δ > 0, he value φ increae a each ieraion (cycle). If all k ij are ineger, x andk ij ineger and δ a mo φ * increae. capaciy of he cu δ({}) Since φ * k({}) mk max where m = A and k max = max{k ij : (i, j) A} and each cycle i O(m), he overall complexiy i O(m k max ). Definiion: The ize of an inance I, denoed by I, i he number of bi needed o decribe he inance. Since log (i)+ bi needed o ore ineger i, I = O(m log (k max )) O(m k max ) grow exponenially wih I becaue k max = log (kmax). E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 7
In ome cae he algorihm i very inefficien: δ= M M M M +δ +δ +δ +δ -δ +δ M very large In he wor cae: M ieraion! Obervaion: The algorihm can be made polynomial by looking for augmening pah wih a minimum number of arc. Edmond and Karp O(nm ), Dinic O(n m), Alo valid for he cae where capaciie are no ineger. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 8
Polynomial ime algorihm for flow problem More efficien algorihm exi, baed on augmening pah, pre-flow (relaxing he node flow balance conrain) and capaciy caling. Problem Minimum co flow problem Given a nework wih a uni co c ij aociaed o each arc (i,j) and a value φ>0, deermine a feaible flow from o of value φ and of minimum oal co. Idea: Sar from a feaible flow x of value φ and end, a each ieraion, an addiional amoun of produc in he reidual nework (repecing he reidual capaciie and he value φ) along cycle of negaive co. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 9
.4.4 Indirec applicaion ) Aigmen (maching) problem Given m engineer, n ak and for each engineer he li of ak he/he can perform. Aign he ak o he engineer o ha: each engineer i aigned a mo one ak, each ak i aigned o a mo one engineer, and he number of ak ha are execued (engineer involved) i maximized. If he compeence of he engineer are repreened via a biparie graph, wha are we looking for in uch a graph? How can we reduce hi problem o he problem of finding a feaible flow of maximum value in an ad hoc nework? E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 30
Graphical model: Biparie graph of compeence engineer ak Definiion: Given an undireced biparie graph G = (V, E), a maching M E i a ube of non adjacen edge. Problem Given a biparie graph G=(V, E), deermine a maching wih a maximum number of edge. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 3
Thi problem can be reduced o he problem of finding a feaible flow of maximum value from o in he following nework: capaciy engineer ak capaciy k ineger Correpondence beween he feaible flow (from o ) of value φ and he maching conaining φ edge. Ineger capaciie opimal flow ha ineger x ij and ineger maximum value φ *. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 3
) Diribued compuing Aign n module of a program o proceor o a o minimize he oal co (execuion co + communicaion co). Suppoe we know: α i = execuion co of module i on proceor i n β i = execuion co of module i on nd proceor i n c ij = communicaion co if module i and j are aigned o differen proceor i, j n. Reduce hi problem o ha of finding a cu of minimum oal capaciy in an ad hoc direced nework. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 33
module c ij 5 4 4 6 0 5 4 proceor 6 3 0 proceor 8 3 4 3 α i β i 4 cu eparaing from aignmen of he n module o he proceor Correpondence beween he - cu of minimum capaciy and he minimum oal co aignmen of he module o he proceor. E. Amaldi Foundaion of Operaion Reearch Poliecnico di Milano 34