discrete optimization 2010 lecture 4 minimum-cost flowsuetzm/do/do_lecture4.pdf · dualityflow...

31
Duality Flow Decomposition Min-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows Marc Uetz University of Twente [email protected] Lecture 4: sheet 1 / 31 Marc Uetz Discrete Optimization

Upload: others

Post on 09-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Discrete Optimization 2010Lecture 4

Minimum-Cost Flows

Marc UetzUniversity of Twente

[email protected]

Lecture 4: sheet 1 / 31 Marc Uetz Discrete Optimization

Page 2: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Outline

1 Remarks on Max-Flow and Min-Cut

2 Flow Decomposition

3 Min-Cost Flows

Lecture 4: sheet 2 / 31 Marc Uetz Discrete Optimization

Page 3: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Max-Flow Min-Cut Theorem(s)

Weak Duality Theorem

The value of any flow is at most equal to the capacity of any cut.So for any flow x and any cut [S ,T ],

v(x) ≤ u(S ,T ) .

Strong Duality Theorem

There is a flow x and a cut [S ,T ] such that

v(x) = u(S ,T ) .

Lecture 4: sheet 3 / 31 Marc Uetz Discrete Optimization

Page 4: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Harris & Ross (for Air Force): ‘Interdiction’ Problem, 1955

Figure 2From Harris and Ross [1955]: Schematic diagram of the railway network of the Western So-viet Union and Eastern European countries, with a maximum flow of value 163,000 tons fromRussia to Eastern Europe, and a cut of capacity 163,000 tons indicated as ‘The bottleneck’.

The max-flow min-cut theorem

In the RAND Report of 19 November 1954, Ford and Fulkerson [1954] gave (next to definingthe maximum flow problem and suggesting the simplex method for it) the max-flow min-cut theorem for undirected graphs, saying that the maximum flow value is equal to theminimum capacity of a cut separating source and terminal. Their proof is not constructive,but for planar graphs, with source and sink on the outer boundary, they give a polynomial-time, constructive method. In a report of 26 May 1955, Robacker [1955a] showed that themax-flow min-cut theorem can be derived also from the vertex-disjoint version of Menger’stheorem.

As for the directed case, Ford and Fulkerson [1955] observed that the max-flow min-cuttheorem holds also for directed graphs. Dantzig and Fulkerson [1955] showed, by extendingthe results of Dantzig [1951a] on integer solutions for the transportation problem to the

25

(declassified by Pentagon in 1999, on request of Lex Schrijver)

Lecture 4: sheet 4 / 31 Marc Uetz Discrete Optimization

Page 5: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Reminder: LP Duality (I)

Primal LP (P)

max ct · x dual variables

s.t. Ax ≤ b α

x ≥ 0

Dual LP (D)

min bt · αs.t. Atα ≥ c

α ≥ 0

Theorem (LP Duality)

For all feasible x and α, we have ct · x ≤ bt · α, and “=” foroptimal primal and dual solutions (if both are finite)

Lecture 4: sheet 5 / 31 Marc Uetz Discrete Optimization

Page 6: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Reminder: LP Duality (II)

max c t · x dual variables

s.t. Ax = b π

Bx ≤ u α

x ≥ 0

min (bt , ut) ·(πα

)s.t. [At ,B t ]

(πα

)≥ c

α ≥ 0

Theorem (LP Duality)

For all feasible x and

(πα

), we have c t · x ≤ (bt , ut) ·

(πα

), and

“=” for optimal primal and dual solutions (if both are finite)

Lecture 4: sheet 6 / 31 Marc Uetz Discrete Optimization

Page 7: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Reminder: LP Duality (II)

Complementary Slackness

Consider primal and dual solutions x and

(πα

), if

xi > 0 ⇒ [At ,Bt ]i

(πα

)= ci

primal “≥ 0” variable nonzero ⇒ dual constraint with =

αj > 0 ⇒ [B]jx = uj

dual “≥ 0”-variable nonzero ⇒ primal constraint with =

then x and

(πα

)are optimal solutions for the primal and dual

(P) and (D), respectively, and ct · x = (bt , ut) ·(πα

).

Lecture 4: sheet 7 / 31 Marc Uetz Discrete Optimization

Page 8: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Maximum Flow: Simplification

Question: is MinCut indeed the LP-dual of MaxFlow?

introduce arc (t, s) with capacity ∞then flow balance = 0 at all nodes

objective is maximize flow on arc (t, s)

!"#$%&%'()*+,'-./0*'"'1$%2.$3$4"+$/5

!"#$%&'()*+$(*,#-./*01#2*(+3+(1#4*!5#*+66*"%&).7*86%0*9+6+"()*:;+66*"%&).7*86%0*9+6+"()*:;-*<+=1<1>)*?6%0*+6%"@*,#-./

2 5

43

t=6s=1

6

6

1

3

2

4

7

3 5

!

Lecture 4: sheet 8 / 31 Marc Uetz Discrete Optimization

Page 9: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

LP Formulation

xij = amount of flow through arc (i , j)

max xts

s.t.∑

j :(i ,j)∈A

xij −∑

j :(j ,i)∈A

xji = 0 ∀ i ∈ V (1)

xij ≤ uij ∀ (i , j) ∈ A (2)

x ≥ 0 (3)

(1) is flow balance

(2) arc capacities

(3) non-negativity

Lecture 4: sheet 9 / 31 Marc Uetz Discrete Optimization

Page 10: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Node-Arc Incidence Matrix!"#$%&'"'()*%+#(,-.'/(-,

i

s

j

t

-1000t

0-1-10j

110-1i

-1

1

0

00011s

(j,t)(i,t)(i,j)(s,j)(s,i) !"#

!"$

!#$

!#%

!$%

!%"

&'(')*+,-./0'#)0#+,)0,'1.%/#2

2'('34*5'6,0%*/

%7,)'84*5'9.4.)0,'#"''$:"%'01%2%301%2%3

(

;

;

;

;

(t,s)

1

0

0

-1

Lecture 4: sheet 10 / 31 Marc Uetz Discrete Optimization

Page 11: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

LP Formulation Max Flow

A = node-arc incidence matrix

E = identity matrix

u = vector of arc capacities

x = flow vector

max xts

s.t. Ax = 0 π = (πi )i∈V

Ex ≤ u α = (αij)(i ,j)∈A

x ≥ 0

Lecture 4: sheet 11 / 31 Marc Uetz Discrete Optimization

Page 12: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Lecture 4: sheet 12 / 31 Marc Uetz Discrete Optimization

Page 13: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Dual LP Formulation

πi = node variables, αij = arc variables

min∑

(i ,j)∈A

αijuij

s.t. αij ≥ π(j)− π(i) (i , j) 6= (t, s)

αts ≥ π(s)− π(t) + 1

α ≥ 0

Observations

may assume w.l.o.g. π(s) = 0why? because if (π, α) is solution, so is (π ± const, α)

since uts =∞, need αts = 0, so π(t) ≥ π(s) + 1 = 1

hence: in dual LP, like to set all αij = 0, but due to theconstraints, need to set αij ≥ 1 on some (s, t)-cut

Lecture 4: sheet 13 / 31 Marc Uetz Discrete Optimization

Page 14: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Intuition: Dual of MaxFlow is the MinCut Problem

!"#$%&'%()*%+#,-.$&/%01&2$*3

!"!"#$!"%"#&

' (#'(

#'(! !)("*+ !)'"*

,-!*./012*'%*3'456*78*9:;!'!'<6*<=*6<>5%*?'!@*!)'"#&*:6>*!)("#$

The cut [S ,T ] is given by partition of nodes with π = 0 and π = 1

Lecture 4: sheet 14 / 31 Marc Uetz Discrete Optimization

Page 15: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Integrality of Optimum Flows

Theorem

The primal and dual linear programming problems for maximumflow and minimum cut, respectively, have integer optimal solutions(if all uij integer).

Proof: (Primal) Augmenting path algorithm solves the problem,and only augments by integer amounts.

(Dual) And, for any maximum flow, we can construct a cut, i.e.,an integer solution of the dual of the same value

Lecture 4: sheet 15 / 31 Marc Uetz Discrete Optimization

Page 16: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Irrational Capacities

Theorem

There are instances (with irrational capacities) where the Ford-Fulkerson augmenting path algorithm may fail to converge to theoptimum.

An example (not treated in all detail in the lecture) is available viathe link http://dx.doi.org/10.1016/0304-3975(95)00022-O

Note: The Edmonds-Karp algorithm works nevertheless, andcomputes the optimum after O( nm ) flow augmentations.

Lecture 4: sheet 16 / 31 Marc Uetz Discrete Optimization

Page 17: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Outline

1 Remarks on Max-Flow and Min-Cut

2 Flow Decomposition

3 Min-Cost Flows

Lecture 4: sheet 17 / 31 Marc Uetz Discrete Optimization

Page 18: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Flow Decomposition Theorem

Theorem

Given an network G = (V , a) with n nodes and m arcs. Every flowx in G can be decomposed into flow on at most n + m paths andat most m cycles. (not unique)

!"#$%&'(#)*#+,-,#.%/0'#1')

!"#$%#&'()*+#,(-*.%/0"(1*2"(! ,$-#3(/,-(" /%435(6+#%7(89$1(#4/,(:#(-#4$&0$3#-(*,2$(89$1($,(0/2"3(/,-(4749#35(;$%#$+#%<(/2(&$32(" 4749#3(/,-(/2(&$32(! =(" 0/2"3(4/%%7(,$,,#./2*+#(89$15

2 5

43

t=6s=1

3

2

1

1

1

4

3

3 1

>

?

@ >>

2 5

43

t=6s=1

-#4$&0$3*2*$,(0$33*:9#((*,(@(0/2"(89$13(/,-(A(4749#(89$13(

Lecture 4: sheet 18 / 31 Marc Uetz Discrete Optimization

Page 19: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Proof: Flow Decomposition Theorem

Excess node if outflow > inflow, deficit node if outflow < inflow

Start with any (s, t)-flow (then s = excess node, t = deficit node)

start at any excess node and go along flow carrying arc (s, v)

by flow balance, v has outgoing flow (or is deficit node)

continue until

ends up at a deficit node (path flow P)ends at previously visited node (cycle flow C )

decrease flow along P or C by maximum possible amount

Path flow P: either some arc gets 0-flow, or one excess ordeficit node has balance 0 ⇒ ≤ n+m path flows

Cycle flow C : an arc gets 0-flow ⇒ ≤ m cycle flows

After ≤ n + m iterations, have overall 0-flow

Lecture 4: sheet 19 / 31 Marc Uetz Discrete Optimization

Page 20: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Outline

1 Remarks on Max-Flow and Min-Cut

2 Flow Decomposition

3 Min-Cost Flows

Lecture 4: sheet 20 / 31 Marc Uetz Discrete Optimization

Page 21: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Tolstoi: Minimum Cost Transportation Problem, 1930

Figure 1Figure from Tolstoı [1930] to illustrate a negative cycle.

After 10 steps, when the transports from all 10 factories have been set, Tolstoı ‘verifies’the solution by considering a number of cycles in the network, and he concludes that hissolution is optimum:

Thus, by use of successive applications of the method of di!erences, followed by a verificationof the results by the circle dependency, we managed to compose the transportation plan whichresults in the minimum total kilometrage.

The objective value of Tolstoı’s solution is 395,052 kiloton-kilometers. Solving the problemwith modern linear programming tools (CPLEX) shows that Tolstoı’s solution indeed isoptimum. But it is unclear how sure Tolstoı could have been about his claim that hissolution is optimum. Geographical insight probably has helped him in growing convincedof the optimality of his solution. On the other hand, it can be checked that there existfeasible solutions that have none of the negative-cost cycles considered by Tolstoı in theirresidual graph, but that are yet not optimum.

Later, Tolstoı [1939] described similar results in an article entitled Methods of remov-ing irrational transportations in planning in the September 1939 issue of SotsialisticheskiıTransport. The methods were also explained in the book Planning Goods Transportationby Pariıskaya, Tolstoı, and Mots [1947].

According to Kantorovich [1987], there were some attempts to introduce Tolstoı’s workby the appropriate department of the People’s Commissariat of Transport.

Kantorovich 1939

Apparently unaware (by that time) of the work of Tolstoı, L.V. Kantorovich studied ageneral class of problems, that includes the transportation problem. The transportationproblem formed the big motivation for studying linear programming. In his memoirs,Kantorovich [1987] wrote how questions from practice motivated him to formulate theseproblems:

12

Lecture 4: sheet 21 / 31 Marc Uetz Discrete Optimization

Page 22: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Minimum Cost Flow Problem

arc capacities uij and per-unit arc costs cij

min∑

(i ,j)∈A

cijxij

s.t.∑

j :(s,j)∈A

xsj −∑

j :(j ,s)∈A

xjs = v send v units

∑j :(i ,j)∈A

xij −∑

j :(j ,i)∈A

xji = 0 ∀ i 6= s, t

0 ≤ xij ≤ uij

!"#$%&'()&*+,+-+#,

!"#$%&'($)'*(+,-.&/$&-$0"12#$13.42$1

!!"!

"#$# "$%%

%$$#

"#%# "%##

#%%#&$'%

"#%#

%#%#

()

*))

))

)+

!!"

#$

#"

%

% %

% %

%

%

& &

& &

&

0

s.t.

min

),(: ),(:

),(: ),(:

},\{

),(:

2 5

43

t=6s=1

(30,6)

(22,6)

(17,1)

(15,3)

(10,2)

(24,4)

(43,7)

(13,3)(11,5)

),( :arcsat numbers !! (+

Lecture 4: sheet 22 / 31 Marc Uetz Discrete Optimization

Page 23: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Minimum Cost Flow Problem

Or, more generally. . .

A = node arc incidence matrix

c = vector of arc costs

u = vector of arc capacities

b = vector of node balances, with∑

i∈V bi = 0

min c · xs.t. Ax = b

x ≤ u

x ≥ 0

Previous special case: bs = v , bt = −v , bi = 0 otherwise

Lecture 4: sheet 23 / 31 Marc Uetz Discrete Optimization

Page 24: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Min-Cost Flow: Assumptions & Remarks

Arc costs c and capacities u are integers, and u ≥ 0

Can restrict to (s, t)-flow problem of value v(any general problem can be transformed into this version)

There exists a feasible solution(can be checked beforehand by Max-Flow algorithm)

There exists a path between any two nodes(otherwise, add dummy arcs with high costs)

Lecture 4: sheet 24 / 31 Marc Uetz Discrete Optimization

Page 25: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

The Residual Graph

For given flow x , have

forward arcs: possible flow increase, capacity uij − xij , cost cij

backward arcs: possible flow decrease, capacity xij , cost −cij

!"#$%&'()*"+,-./)!0"1

!"#$%$&'()*$+,"-$!.$/0)$*)/-"#1$" 2"*/%'*3$%#23$"()#$-0'20$/0)$+,"-$2%*$4)$'*2#)%3)5$%*56"#$5)2#)%3)57$8#23$"()#$-0'20$/0)$+,"-$2%*$4)$5)2#)%3)5$%#)$#)()#3)5$-'/0$2%9%2'/:$);<%,$/"$/0)$%="<*/$"+$9"33'4,)$5)2#)%3)7$

>2"3/3.$2%9%2'/')3?

!"(#"!$%&"! )

'"!

'"!(%)

!"(#"!$ &"!* '"!)

'"!+%&"!

!"(*#"!$ '"!)

Lecture 4: sheet 25 / 31 Marc Uetz Discrete Optimization

Page 26: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Optimality Condition I

Theorem (Negative Cost Cycle Optimality Condition)

A flow x (of value v) is a minimum cost flow if and only if theresidual graph G (x) has no negative cost directed cycle.

Lecture 4: sheet 26 / 31 Marc Uetz Discrete Optimization

Page 27: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Negative Cost Cycle Condition

Necessity

Obvious!

Sufficiency

Given x , 6 ∃ negative cost cycle in G (x), consider feasible flow x ′

show that x ′ − x is feasible in G (x)non-trival, but straightforward, just check constraints

x ′ − x has flow balance 0 at all nodesboth have flow value v

hence, x ′ − x is a sum of cycle flows (flow decomposition)

each has nonnegative costs, by our assumption

thus, cx ′ = c(x ′ − x + x) = c(x ′ − x) + cx ≥ cx

Lecture 4: sheet 27 / 31 Marc Uetz Discrete Optimization

Page 28: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Cycle Canceling Algorithm

Algorithm 1: Cycle Canceling

input : network (G , u) capacities u ≥ 0, costs c , flow valuev , and nodes s, t ∈ V

output: x = minimum-cost (s, t)-flow with value vcompute (s, t)-flow x with value v [e.g., augmenting paths];while (∃ negative cost dicycle C in G (x)) do

xC = maximum flow along C ;reduce cost by updating flow, x = x + xC ;update residual capacities, i.e., re-compute G (x);

Termination if 6 ∃ negative cost cycle with unboundedcapacity: because each time the cost decreases by ≥ 1

Correctness follows from negative cycle condition

Computation time not polynomial in general (Exercise)

Lecture 4: sheet 28 / 31 Marc Uetz Discrete Optimization

Page 29: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Optimality Condition II

Theorem (Reduced Cost Optimality Condition)

A flow x (of value v) is a minimum cost flow if and only if forsome set of node labels π(i), i ∈ V , the reduced cost optimalitycondition holds in the residual graph G (x):

cπij := cij − π(i) + π(j) ≥ 0 ∀(i , j) ∈ G (x)

Compare to reduced cost optimality condition for LP (Simplex):“No column with negative reduced costs”

Lecture 4: sheet 29 / 31 Marc Uetz Discrete Optimization

Page 30: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Intuition about Reduced Cost Condition

−π(i) −π(j)

cij

−π(i) = min. cost of getting 1 unit flow into i in G (x)

then the −π’s should better fulfill 4-inequality,

−π(j) ≤ −π(i) + cij

⇔ cπij = cij − π(i) + π(j) ≥ 0

Such −π′s (called a node potential) can only exist in G (x) if x is amin-cost flow, for otherwise there is a negative cost directed cycle

Note: min-cost flow would never use an arc with cπij > 0 (why?)

Lecture 4: sheet 30 / 31 Marc Uetz Discrete Optimization

Page 31: Discrete Optimization 2010 Lecture 4 Minimum-Cost Flowsuetzm/do/DO_Lecture4.pdf · DualityFlow DecompositionMin-Cost Flows Discrete Optimization 2010 Lecture 4 Minimum-Cost Flows

Duality Flow Decomposition Min-Cost Flows

Reduced Cost Optimality Condition

Necessity

Consider min-cost flow x , know G (x) has no negative cost cycle

Compute cheapest (s, i) path lengths =: d(i) in G (x) [exist]

define π(i) = −d(i), then d(j) ≤ d(i) + cij (4-ineq.)

⇔ cπij = cij − π(i) + π(j) ≥ 0

Sufficiency (via neg. cycle condition)

Let x be flow and π be node labels that fulfill the condition thatcπij = cij − π(i) + π(j) ≥ 0 in G (x). Consider any cycle C inresidual graph G (x), costs are∑

(i ,j)∈C

cij =∑

(i ,j)∈C

[cij − π(i) + π(j)] =∑

(i ,j)∈C

cπij ≥ 0

Lecture 4: sheet 31 / 31 Marc Uetz Discrete Optimization