Docsity

Combinatorial Algorithms and Intractability | CSE 550, Study notes of Computer Science

Partial preview of the text

Download Combinatorial Algorithms and Intractability | CSE 550 and more Study notes Computer Science in PDF only on Docsity!

CSE 550 Combinatorial Algorithms and

Intractability (9/4)

Goran Konjevod

Department of Computer Science and Engineering Arizona State University

ASU, Fall 2007

Minimum-cost flow

Given: G = (V , E ) directed graph s ∈ V source, t ∈ V sink c : E → R+ capacity function k : E → R+ cost function φ > 0

Min-cost s-t flow problem: Find an s-t flow of value φ, minimizing cost(f ) =

e

k(e)f (e).

Min-cost flow ⇔ circulation

Reduction done on the board.

Circulation-related definitions

Residual graph: Gf = (V , Ef ), where Ef = {(u, v ) | f (u, v ) < c(u, v )} ∪ {(v , u) | d(u, v ) < f (u, v )}, and cf (u, v ) = max{c(u, v ) − f (u, v ), 0 }, cf (v , u) = max{f (u, v ) − d(u, v ), 0 }.

Cost for back-edges: k(v , u) = −k(u, v ). Take a directed cycle C in Gf. For (u, v ) ∈ E , if (u, v ) ∈ C , define χC^ (u, v ) = 1. if (v , u) ∈ C , define χC^ (u, v ) = −1. if (u, v ) 6 ∈ C and (v , u) 6 ∈ C , define χC^ (u, v ) = 0. For d, c : E → R+, a circulation f is feasible, if d ≤ f ≤ c.

Circulations and negative cycles

Theorem Let f be a feasible circulation in G. Then f is a minimum-cost feasible circulation if and only if each directed cycle of Gf has nonnegative cost.

⇒: Let C be a negative-cost directed cycle in Gf. Take a small  and consider f ′^ := f + χC^. First, f ′^ has lower cost. Second, for a small-enough , f ′^ is feasible. ⇐: Take any feasible circulation f ′. Then f ′^ − f is also.

f ′^ − f =

∑^ t

j=

λj χCj

(where Ci are directed cycles in Gf and λi > 0).

cost(f ′) − cost(f ) = cost(f ′^ − f ) =

∑^ t

j

λj k(Cj ) ≥ 0.

Algorithm idea

Improve f : Find a negative-cost cycle C in Gf. Reset f := f + τ χC^ for as large a τ as feasible. If no such C exists, f is minimum-cost. Two problems: (^1) Where to start? (^2) Not polynomial! (recall Ford-Fulkerson).

Finding a feasible circulation

If d = 0, easy. So, make d = 0! Let c′^ = c − d. Add source and sink, to turn into a max-flow problem. Deal with excess in d.

Algorithm idea

Improve f : Find a negative-cost cycle C in Gf. Reset f := f + τ χC^ for as large a τ as feasible. If no such C exists, f is minimum-cost. Two problems: (^1) Where to start? (^2) Not polynomial! (recall Ford-Fulkerson).

Minimum mean-cost cycle

The mean cost of a cycle C :

k(C ) |C |

Theorem (Goldberg-Tarjan) Choosing a minimum mean-cost cycle in the circulation improvement algorithm limits the number of iterations to at most 4 nm^2 dln ne.

Finding a minimum mean-cost cycle (Karp, 1978)

Let λ∗^ be the minimum mean cycle cost. For v ∈ V and i ≥ 0, let di (v ) be the cost of the cheapest i-edge walk ending at v. Theorem

λ∗^ = min v ∈V

max 0 ≤i<n

dn(v ) − di (v ) n − i

Left to prove:

Lemma If λ∗^ = 0, then

min v ∈V

max 0 ≤i≤n− 1

dn(v ) − di (v ) n − i

Lemma proof

≥ 0 Since λ∗^ = 0, there is no negative-cost cycle, but there is one of cost zero. Take a minimum-cost walk to v. Length < n (can remove cycles), cost π(v ). dn(v ) ≥ π(v ) = mini di (v ). In fact, dn(v ) − π(v ) = maxi dn(v ) − di (v ) ≥ 0. = 0 Let C be a 0-cost cycle, pick w ∈ V (C ). Let P(w ) be the mincost walk from s to w. P(w ) + tC is also a mincost walk from s to w. Every subwalk of a mincost walk is a mincost walk to its endpoint. Take the first n edges of P(w ) + tC , stop at w ′.

dn(w ′) = π(w ′).

Preliminaries

Circulations: f 0 , f 1 ,... Residual edge-sets: Ei := Efi. Cancelled cycles: Ci the cycle in Ei chosen to obtain Ei+1. Minimum mean-costs: i := −k(Ci )/|Ci |. i : minimum value that, added to each edge, makes all cycles nonnegative. i is the smallest value for which there exists a function pi : V → R such that

k(u, v ) + i ≥ pi (v ) − pi (u)

for every (u, v ) ∈ Ei.

Proof Overview

The basic steps: i+1 ≤ i i+m ≤ (1 − (^) m^1 )i For every i, there is an edge in Ci that is not in Ch for h > i + 2nmdln ne. From the last claim, at most 2m · 2 nmdln ne iterations Details: we’ll skip the details.