DM545 Linear and Integer Programming Lecture 12 Network Flows Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark
Network Flows Outline Duality 1. (Minimum Cost) Network Flows 2. Duality in Network Flow Problems 2
Network Flows Outline Duality 1. (Minimum Cost) Network Flows 2. Duality in Network Flow Problems 3
Network Flows Terminology Duality Network: • directed graph D = ( V , A ) • arc, directed link, from tail to head • lower bound l ij > 0, ∀ ij ∈ A , capacity u ij ≥ l ij , ∀ ij ∈ A • cost c ij , linear variation (if ij �∈ A then l ij = u ij = 0 , c ij = 0) • balance vector b ( i ) , b ( i ) < 0 supply node (source), b ( i ) > 0 demand node (sink, tank), b ( i ) = 0 transhipment node (assumption � i b ( i ) = 0) N = ( V , A , l , u , b , c ) − 3 1 1 / · / 4 , 3 b b d d 2 / · / 5 , 6 0 / · / 3 , 2 3 / · / 3 , 1 a a 0 / · / 3 , 1 5 / · / 8 , 4 f f − 3 2 b ( a ) 1 / · / 4 , 1 4 / · / 7 , 8 2 / · / 4 , 1 c c e e l ce / x ce / u ce , c ce 0 3 4
Network Flows Network Flows Duality Flow x : A → R balance vector of x : b x ( v ) = � x uv − � x vw , ∀ v ∈ V uv ∈ A vw ∈ A > 0 sink/target/tank b x ( v ) < 0 source = 0 balanced (generalizes the concept of path with b x ( v ) = { 0 , 1 , − 1 } ) feasible l ij ≤ x ij ≤ u ij , b x ( i ) = b ( i ) c T x = � cost ij ∈ A c ij x ij (varies linearly with x ) If iji is a 2-cycle and all l ij = 0, then at least one of x ij and x ji is zero. 5
Network Flows Example Duality − 3 1 1 / 3 / 4 , 3 b d 2 / 4 / 5 , 6 0 / 3 / 3 , 2 a 0 / 0 / 3 , 1 3 / 3 / 3 , 1 5 / 6 / 8 , 4 f − 3 2 1 / 1 / 4 , 1 4 / 5 / 7 , 8 2 / 2 / 4 , 1 c e 0 3 Feasible flow of cost 109 6
Network Flows Minimum Cost Network Flows Duality Find cheapest flow through a network in order to satisfy demands at certain nodes from available supplier nodes. Variables: x ij ∈ R + 0 Objective: min c T x � N x = b min c ij x ij 0 ≤ x ≤ u ij ∈ A Constraints: mass balance + flow bounds N node arc incidence � � x ij − x ji = b ( i ) ∀ i ∈ V matrix j : ij ∈ A j : ji ∈ A 0 ≤ x ij ≤ u ij (assumption: all values are integer, we can multiply if rational) 7
Network Flows Duality . . . . . . x e 1 x e 2 x ij x e m . . . . . . c e 1 c e 2 c ij c e m 1 − 1 . . . . . . . . . = b 1 2 . . . . . . . . . . = b 2 . . . ... . . . . . = . i 1 . . . . − 1 . . . . = b i . . . ... . . . . . = . j . . . . . 1 . . . . = b j . . . ... . . . . . = . n . . . . . . . . . . = b j e 1 − 1 ≥ − u 1 e 2 − 1 ≥ − u 2 . . . ... . . . . . ≥ . ( i , j ) − 1 ≥ − u ij . . . ... . . . . . ≥ . e m − 1 ≥ − u m 8
Network Flows Reductions/Transformations Duality Lower bounds N ′ = ( V , A , l ′ , u ′ , b ′ , c ) Let N = ( V , A , l , u , b , c ) b ′ ( i ) = b ( i ) + l ij b ′ ( j ) = b ( j ) − l ij u ′ ij = u ij − l ij l ′ ij = 0 b ( i ) b ( j ) l ij > 0 b ( i ) + l ij b ( j ) − l ij l ij = 0 j i j i u ij − l ij c T x ′ + � c T x c ij l ij ij ∈ A 9
Network Flows Duality Undirected arcs j j i i 10
Network Flows Duality Vertex splitting If there are bounds and costs of flow passing thorugh vertices where b ( v ) = 0 (used to ensure that a node is visited): N = ( V , A , l , u , c , l ∗ , u ∗ , c ∗ ) From D to D ST as follows: � v s , v t ∈ V ( D ST ) and v t v s ∈ A ( D ST ) ∀ v ∈ V ∀ xy ∈ A ( D ) � x s y t ∈ A ( D ST ) 11
Network Flows Duality ∀ v ∈ V and v t v s ∈ A ST � h ′ ( v t , v s ) = h ∗ ( v ) , h ∗ ∈ { l ∗ , u ∗ , c ∗ } ∀ xy ∈ A and x s y t ∈ A ST � h ′ ( x s y t ) = h ( x , y ) , h ∈ { l , u , c } If b ( v ) = 0, then b ′ ( v s ) = b ′ ( v t ) = 0 If b ( v ) < 0, then b ′ ( v t ) = 0 and b ′ ( v s ) = b ( v ) If b ( v ) > 0, then b ′ ( v t ) = b ( v ) and b ′ ( v s ) = 0 (Note this slide is made with the different convenition that sources have positive balance. What should change to make it compliant with our convention of negative balance?) 12
Network Flows Duality ( s , t ) -flow: − k if v = s b x ( v ) = if v = t , | x | = | b x ( s ) | k 0 otherwise 5 // 5 b d − 3 b d 3 0 // − b ( b ) 0 // b ( d ) s b ( s ) 1 // 2 t b ( t ) 1 // 2 0 // 2 0 // − b ( c ) 0 // b ( e ) c e − 6 c e 8 6 // 6 b ( s ) = � v : b ( v ) < 0 b ( v ) = − M b ( t ) = � v : b ( v ) > 0 b ( v ) = M ∃ feasible flow in N ⇐ ⇒ ∃ ( s , t ) -flow in N st with | x | = M ⇐ ⇒ max flow in N st is M 13
Network Flows Residual Network Duality Residual Network N ( x ) : given that a flow x already exists, how flow excess can be moved in G ? Replace arc ij ∈ N with arcs: residual capacity cost ij : r ij = u ij − x ij c ij ji : r ji = x ij − c ij ( N ( x ) , c ′ ) ( N , c , u , x ) 14
Network Flows Special cases Duality Shortest path problem path of minimum cost from s to t with costs ⋚ 0 b ( s ) = − 1 , b ( t ) = 1 , b ( i ) = 0 if to any other node? b ( s ) = − ( n − 1 ) , b ( i ) = 1 , u ij = n − 1 Max flow problem incur no cost but restricted by bounds steady state flow from s to t b ( i ) = 0 ∀ i ∈ V , c ij = 0 ∀ ij ∈ A ts ∈ A c ts = − 1 , u ts = ∞ Assignment problem min weighted bipartite matching, | V 1 | = | V 2 | , A ⊆ V 1 × V 2 c ij b ( i ) = − 1 ∀ i ∈ V 1 b ( i ) = 1 ∀ i ∈ V 2 u ij = 1 ∀ ij ∈ A 15
Network Flows Special cases Duality Transportation problem/Transhipment distribution of goods, warehouses-costumers | V 1 | � = | V 2 | , u ij = ∞ for all ij ∈ A � min c ij x ij � x ij ≥ b j ∀ j i � x ij ≤ a i ∀ i j x ij ≥ 0 16
Network Flows Duality Multi-commodity flow problem ship several commodities using the same network, different origin destination pairs separate mass balance constraints, share capacity constraints, min overall flow k c k x k min � N x k ≥ b k ∀ k k x k � ij ≤ u ij ∀ ij ∈ A 0 ≤ x k ij ≤ u k ij What is the structure of the matrix now? Is the matrix still TUM? 17
Application Example Network Flows Duality Ship loading problem Plenty of applications. See Ahuja Magnanti Orlin, Network Flows, 1993 • A cargo company (eg, Maersk) uses a ship with a capacity to carry at most r units of cargo. • The ship sails on a long route (say from Southampton to Alexandria) with several stops at ports in between. • At these ports cargo may be unloaded and new cargo loaded. • At each port there is an amount b ij of cargo which is waiting to be shipped from port i to port j > i • Let f ij denote the income for the company from transporting one unit of cargo from port i to port j . • The goal is to plan how much cargo to load at each port so as to maximize the total income while never exceeding ship’s capacity. 18
Network Flows Application Example: Modeling Duality • n number of stops including the starting port and the terminal port. • N = ( V , A , l ≡ 0 , u , c ) be the network defined as follows: • V = { v 1 , v 2 , ..., v n } ∪ { v ij : 1 ≤ i < j ≤ n } • A = { v 1 v 2 , v 2 v 3 , ... v n − 1 v n } ∪ { v ij v i , v ij v j : 1 ≤ i < j ≤ n } • capacity: u v i v i + 1 = r for i = 1 , 2 , ..., n − 1 and all other arcs have capacity ∞ . • cost: c v ij v i = − f ij for 1 ≤ i < j ≤ n and all other arcs have cost zero (including those of the form v ij v j ) • balance vector: b ( v ij ) = − b ij for 1 ≤ i < j ≤ n and the balance vector of v i = b 1 i + b 2 i + ... + b i − 1 , i for i = 1 , 2 , ..., n 19
Network Flows Application Example: Modeling Duality 20
Network Flows Application Example: Modeling Duality Claim: the network models the ship loading problem. • suppose that t 12 , t 13 , ..., t 1 n , t 23 , ..., t n − 1 , n are cargo numbers, where t ij ( ≤ b ij ) is the amount of cargo the ship will transport from port i to port j and that the ship is never loaded above capacity. • total income is � I = t ij f ij 1 ≤ i < j ≤ n • Let x be the flow in N defined as follows: • flow on an arc of the form v ij v i is t ij • flow on an arc of the form v ij v j is | b ij | − t ij • flow on an arc of the form v i v i + 1 , i = 1 , 2 , ..., n − 1, is the sum of those t ab for which a ≤ i and b ≥ i + 1. • since t ij , 1 ≤ i < j ≤ n , are legal cargo numbers then x is feasible with respect to the balance vector and the capacity restriction. • the cost of x is − I . 21
Network Flows Application Example: Modeling Duality • Conversely, suppose that x is a feasible flow in N of cost J . • we construct a feasible cargo assignment s ij , 1 ≤ i < j ≤ n as follows: • let s ij be the value of x on the arc v ij v i . • income − J 22
Network Flows Outline Duality 1. (Minimum Cost) Network Flows 2. Duality in Network Flow Problems 23
Network Flows Maximum ( s , t ) -Flow Duality Adding a backward arc from t to s : z = max x ts � � x ji − x ij = 0 ∀ i ∈ V ( π i ) j : ji ∈ A j : ij ∈ A x ij ≤ u ij ∀ ij ∈ A ( w ij ) x ij ≥ 0 ∀ ij ∈ A Dual problem: g LP = min � u ij w ij ij ∈ A π i − π j + w ij ≥ 0 ∀ ij ∈ A π t − π s ≥ 1 w ij ≥ 0 ∀ ij ∈ A 25
Recommend
More recommend