Docsity

Maximum Flow Applications - Algorithm and Complexity Analysis - Lecture Slides, Slides of Computer Science

Toggle sidebar
bg1
Maximum Flow Applications
2
Maximum Flow Applications Contents
Max flow extensions and applications.
■Disjoint paths and network connectivity.
■Bipartite matchings.
■Circulations with upper and lower bounds.
■Census tabulation (matrix rounding).
■Airline scheduling.
■Image segmentation.
■Project selection (max weight closure).
■Baseball elimination.
3
Disjoint path network: G = (V, E, s, t).
■Directed graph (V, E), source s, sink t.
■Two paths are edge-disjoint if they have no arc in common.
Disjoint path problem: find max number of edge-disjoint s-t paths.
■Application: communication networks.
s
2
3
4
Disjoint Paths
5
6
7
t
4
Disjoint path network: G = (V, E, s, t).
■Directed graph (V, E), source s, sink t.
■Two paths are edge-disjoint if they have no arc in common.
Disjoint path problem: find max number of edge-disjoint s-t paths.
s
2
3
4
Disjoint Paths
5
6
7
t
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Maximum Flow Applications - Algorithm and Complexity Analysis - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Maximum Flow Applications

Maximum Flow Applications Contents

Max flow extensions and applications.

n^

Disjoint paths and network connectivity. n^

Bipartite matchings. n^

Circulations with upper and lower bounds. n^

Census tabulation (matrix rounding). n^

Airline scheduling. n^

Image segmentation. n^

Project selection (max weight closure). n^

Baseball elimination.

3

Disjoint path network: G = (V, E, s, t).

n^

Directed graph (V, E), source s, sink t. n^

Two paths are edge-disjoint if they have no arc in common.

Disjoint path problem: find max number of edge-disjoint s-t paths.

n^

Application: communication networks.s

2 3 4

Disjoint Paths

5 6 7

t

Disjoint path network: G = (V, E, s, t).

n^

Directed graph (V, E), source s, sink t. n^

Two paths are edge-disjoint if they have no arc in common.

Disjoint path problem: find max number of edge-disjoint s-t paths.

s

2 3 4

Disjoint Paths

5 6 7

t

Docsity.com

5

Max flow formulation: assign unit capacity to every edge.Theorem. There are k edge-disjoint paths from s to t if and only if themax flow value is k.Proof.

n^

Suppose there are k edge-disjoint paths P

,... , P 1

.k

n^

Set f(e) = 1 if e participates in some path P

; otherwise, set f(e) = 0.i

n^

Since paths are edge-disjoint, f is a flow of value k.

Disjoint Paths

s^

t

1 1 1

1 1

1 1

(^111)

1 1

1 1

Max flow formulation: assign unit capacity to every edge.Theorem. There are k edge-disjoint paths from s to t if and only if themax flow value is k.Proof.

n^

Suppose max flow value is k. By integrality theorem, there exists{0, 1} flow f of value k. n^

Consider edge (s,v) with f(s,v) = 1.

-^

by conservation, there exists an arc (v,w) with f(v,w) = 1

-^

continue until reach t, always choosing a new edge

n^

Produces k (not necessarily simple) edge-disjoint paths.

Disjoint Paths

s^

t

1 1 1

1 1

1 1

(^111)

1 1

1 1

7

Network connectivity network: G = (V, E, s, t).

n^

Directed graph (V, E), source s, sink t. n^

A set of edges F

E disconnects t from s if all s-t paths uses at

least on edge in F.

Network connectivity: find min number of edges whose removaldisconnects t from s.

Network Connectivity

s

2 3 4

5 6 7

t

Network connectivity network: G = (V, E, s, t).

n^

Directed graph (V, E), source s, sink t. n^

A set of edges F

E disconnects t from s if all s-t paths uses at

least on edge in F.

Network connectivity: find min number of edges whose removaldisconnects t from s.

Network Connectivity

s

2 3 4

5 6 7

t

Docsity.com

13

Bipartite Matching

Bipartite matching.

n^

Input: undirected, bipartite graph G = (L

R, E).

n^

M

E is a matching if each node appears in at most edge in M.

n^

Max matching: find a max cardinality matching.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

Matching 1-2’, 3-1’, 4-5’

R
L

Bipartite Matching

Bipartite matching.

n^

Input: undirected, bipartite graph G = (L

R, E).

n^

M

E is a matching if each node appears in at most edge in M.

n^

Max matching: find a max cardinality matching.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

Matching

1-1’, 2-2’, 3-3’, 4-4’ R

L

15

Max flow formulation.

n^

Create directed graph G’ = (L

R

{s, t}, E’ ).

n^

Direct all arcs from L to R, and give infinite (or unit) capacity. n^

Add source s, and unit capacity arcs from s to each node in L. n^

Add sink t, and unit capacity arcs from each node in R to t.

Bipartite Matching

s

1 3 5

1’ 3’ 5’

t

2 4

2’ 4’

R
L

Claim. Matching in G of cardinality k induces flow in G’ of value k.

n^

Given matching M = { 1 - 2’, 3 - 1’, 4 - 5’ } of cardinality 3. n^

Consider flow that sends 1 unit along each of 3 paths:s- 1- 2’- t, s- 3- 1’- t, s - 4- 5’- t. n^

f is a flow, and has cardinality 3.

Bipartite Matching: Proof of Correctness

s

1 3 5

1’ 3’ 5’

t

2 4

2’ 4’

1

1

1 3 5

1’ 3’ 5’

2 4

2’ 4’

Docsity.com

17

Claim. Flow f of value k in G’ induces matching of cardinality k in G.

n^

By integrality theorem, there exists {0, 1}-valued flow f of value k. n^

Consider M = set of edges from L to R with f(e) = 1.

-^

each node in L and R participates in at most one edge in M

-^

|M| = k: consider cut (L

s, R

t)

Bipartite Matching: Proof of Correctness

s

1 3 5

1’ 3’ 5’

t

2 4

2’ 4’

1

1

1 3 5

1’ 3’ 5’

2 4

2’ 4’

Perfect matching.

n^

Input: undirected graph G = (V, E). n^

A matching M

E is perfect if each node appears in exactly one

edge in M.

Perfect bipartite matching.

n^

Input: undirected, bipartite graph G = (L

R, E), |L| = |R| = n.

n^

Can determine if bipartite graph has perfect matching by runningmatching algorithm.

Is there an easy way to convince someone that a bipartite graph doesnot have a perfect matching?

n^

Need good characterization of such graphs.

Perfect Matching

19

Let X be a subset of nodes, and let N(X) be the set of nodes adjacentto nodes in x.Observation. If a bipartite graph G = (L

R, E), has a perfect

matching, then |N(X)|

|X| for every X

L.

n^

Each node in X has to be matched to a different node in N(X).

Perfect Matching

1 3 5

1’ 3’ 5’

2 4

2’ 4’

R
L

No perfect matching:X = {2, 4, 5}, N(X) = {2’, 5’}.

Hall’s Theorem. Let G = (L

R, E) be a bipartite graph with |L| = |R|.

Then, either

n^

(i) G either has a perfect matching, or n^

(ii) There exists a subset X

L such that |N(X)| < |X|.

Perfect Matching

1 3 5

1’ 3’ 5’

2 4

2’ 4’

R
L

Docsity.com

25

Vertex Cover

Given an undirected graph G = (V, E), a vertex cover is a subset ofvertices C

V such that:

n^

Every arc (v, w)

E has either v

C or w

C orboth.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

C = { 3, 4, 5, 1’, 2’ }|C| = 5

Vertex Cover

Given an undirected graph G = (V, E), a vertex cover is a subset ofvertices C

V such that:

n^

Every arc (v, w)

E has either v

C or w

C orboth.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

C = { 3, 1’, 2’, 5’ }|C| = 4

27

Vertex Cover

Given an undirected graph G = (V, E), a vertex cover is a subset ofvertices C

V such that:

n^

Every arc (v, w)

E has either v

C or w

C orboth.

Observation. Let M be a matching, and let C be a vertex cover.Then, |M|

|C|.

n^

Each vertex can cover at most one edge in any matching.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

M = { 1-2’, 3-1’, 4-5’ }|M| = 3

Vertex Cover: König-Egerváry Theorem

Given an undirected graph G = (V, E), a vertex cover is a subset ofvertices C

V such that:

n^

Every arc (v, w)

E has either v

C or w

C orboth.

König-Egerváry Theorem: In a bipartite, undirected graph the maxcardinality of a matching is equal to the min cardinality of a vertexcover.

1 3 5

1’ 3’ 5’

2 4

2’ 4’

R
L
M* = { 1-1', 2-2', 3-3', 5-5' }|M*| = 4
C* = { 3, 1', 2', 5' }|C*| = 4

Docsity.com

29

Vertex Cover: Proof of König-Egerváry TheoremKönig-Egerváry Theorem: In a bipartite, undirected graph, the sizes ofmax matching and min vertex cover are equal.^ n

Suffices to find matching M* and cover C* such that |M| = |C|. n^

Use max flow formulation,and let (S, T) be min cut. n^

Define L

S^

= L
S, L

T^

= L
T,
R

S

= R
S, R

T^

= R

T , and C* = L

T

R

S^

n^

Claim 1. C* is a vertex cover.

-^

consider (v, w)

E

-^

v

L

S

, w

R

T^

impossible since infinite capacity

-^

thus, v

L

T^

or w

R

S

or both s

1 3 5

1’ 3’ 5’

t

2 4

2’ 4’

Vertex Cover: Proof of König-Egerváry TheoremKönig-Egerváry Theorem: In a bipartite, undirected graph, the sizes ofmax matching and min vertex cover are equal.^ n

Suffices to find matching M* and cover C* such that |M| = |C|. n^

Use max flow formulation,and let (S, T) be min cut. n^

Define L

S^

= L
S, L

T^

= L
T,
R

S

= R
S, R

T^

= R

T , and C* = L

T

R

S^

n^

Claim 1. C* is a vertex cover. n^

Claim 2. |C| = |M|.

-^

max-flow min-cut theorem

|M*| = cap(S, T)

-^

only arcs of form (s, v) or (w, t) contribute to cap(S, T)

-^

|M*| = u(S, T) = |L

| + |RT
| = |C*|.S

s

1 3 5

1’ 3’ 5’

t

2 4

2’ 4’

31

Which max flow algorithm to use for bipartite matching / vertex cover?

n^

Generic augmenting path: O( m |f *| ) = O(mn). n^

Capacity scaling: O(m

2

log U ) = O(m

n^

Shortest augmenting path: O(m n

Seems to indicate "more clever" algorithms are not as good as wefirst thought.

Bipartite Matching and Vertex Cover

No - just need more clever analysis! For bipartite matching,shortest augmenting path algorithm runs in O(m n

1/

) time.

Unit Capacity Simple Networks

Unit capacity simple network.

n^

Every arc capacity is one. n^

Every node has either:(i) at most one incoming arc, or(ii) at most one outgoing arc. n^

If G is simple unit capacity, then so isG

, assuming f is {0, 1} flow.f

Shortest augmenting path algorithm.

n^

Normal augmentation: length of shortest path doesn’t change. n^

Special augmentation: length of shortest path strictly increases.

Theorem. Shortest augmenting path algorithm runs in O(m n

1/

) time.

n^

L1. Each phase of normal augmentations takes O(m) time. n^

L2. After at most n

1/

phases, | f |

| f *| - n

1/

n^

L3. After at most n

1/

additional augmentations, flow is optimal.

1

1

1

Docsity.com

37

Unit Capacity Simple Networks

Lemma 1. Phase of normal augmentations takes O(m) time.

n^

Start at s, advance along an arc in L

G

until reach t or get stuck.

-^

if reach t, augment and delete ALL arcs on path

-^

if get stuck, delete node and go to previous node

n^

O(m) running time.

-^

O(m) to create level graph

-^

O(1) per arc, since each arc traversed at most once

-^

O(1) per node deletion

Unit Capacity Simple Networks

ARRAY pred[v

V]
L

G^

level graph of G

f

v

s, pred[v]

nil

REPEAT

WHILE (there exists (v,w)

L
)G

pred[w]

v, v

w

IF (v = t)

P

path defined by pred[]

f

augment(f, P)

update L

G

v

s, pred[v]

nil

delete v from L

G

UNTIL (v = s)RETURN f

AdvanceRetreat(V, E, f, s, t)

advance retreat

augment

39

Unit Capacity Simple Networks

Lemma 2. After at most n

1/

phases, | f |

| f *| - n

1/

n^

After n

1/

phases, length of shortest augmenting path is > n

1/

n^

Level graph has more than n

1/

levels.

n^

Let 1

h

n

1/

be layer with min number of nodes: |V

|h

n

1/

V

h

V

0

V

n

1/

Level graph

V

1

Unit Capacity Simple Networks

Lemma 2. After at most n

1/

phases, | f |

| f *| - n

1/

n^

After n

1/

phases, length of shortest augmenting path is > n

1/

n^

Level graph has more than n

1/

levels.

n^

Let 1

h

n

1/

be layer with min number of nodes: |V

|h

n

1/

n^

S := {v :

l

(v) < h}

{v :

l

(v) = h and v has

1 outgoing residual arc}.

n^

cap

(S, T)f^

|V

|h

n

1/

| f |

| f *| - n

1/

V

h

V

0

V

n

1/

V

1

Level graph

Residual arcs

Docsity.com

41

Baseball Elimination

Over on the radio side the producer’s saying,

n^

"See that thing in the paper last week about Einstein?... Somereporter asked him to figure out the mathematics of the pennantrace. You know, one team wins so many of their remaining games,the other teams win this number or that number. What are themyriad possibilities? Who’s got the edge?" n^

"The hell does he know?" n^

"Apparently not much. He picked the Dodgersto eliminate the Giants last Friday."

43

Baseball Elimination

Which teams have a chance of finishing the season with most wins?

n^

Montreal eliminated since it can finish with at most 80 wins, butAtlanta already has 83. n^

w

  • ri^

< wi^

j^

team i eliminated.

n^

Only reason sports writers appear to be aware of. n^

Sufficient, but not necessary!

Team

i

Against = r

ij

Wins

w

i

To play

ri

Losses

li

Atl

Phi

NY

Mon

Montreal

New York

-^

Philly

-^

Atlanta

-^

Baseball Elimination

Which teams have a chance of finishing the season with most wins?

n^

Philly can win 83, but still eliminated... n^

If Atlanta loses a game, then some other team wins one.

Answer depends not just on how many games already won and left toplay, but also on whom they’re against.

Team

i

Against = r

ij

Wins

w

i

To play

ri

Losses

li

Atl

Phi

NY

Mon

Montreal

New York

-^

Philly

-^

Atlanta

-^

Docsity.com

49

Baseball Elimination: Explanation for Sports Writers

Which teams have a chance of finishing the season with most wins?

n^

Detroit could finish season with 49 + 27 = 76 wins.

Consider subset R = {NY, Bal, Bos, Tor}

n^

Have already won w(R) = 278 games. n^

Must win at least r(R) = 27 more.

Average team in R wins at least 305/4 > 76 games.

Team

i

Against = r

ij

Wins

w

i

To play

ri

Losses

li^

NY

Bal

Bos

Tor

Toronto

Boston

-^

Baltimore

-^
NY
-^

Detroit

Det

AL East: August 30, 1996

Baseball Elimination: Explanation for Sports Writers

Certificate of elimination.If

then x is eliminated (by R).

Theorem (Hoffman-Rivlin, 1967). Team x is eliminated if and only ifthere exists a subset R that eliminates x.

n^

Proof idea. Let R = team nodes on source side of min cut.

games

remaining #

, 12

wins #^

R
R V
R
R U
T
V
U
T

∈

∈

R j i^

ij

R i^

i^

r R r w R w X R

x

x^

r
w
R
R
r
R
w
R
R V
R
R U
T

won

games#

avg on LB

51

Baseball Elimination: Explanation for Sports Writers

Proof of Theorem.

n^

Use max flow formulation, and consider min cut (S, T). n^

Define R = team nodes on source side of min cut = T

S.

n^

Claim. i-j

S if and only if i

R and j

R.

-^

infinite capacity arcs ensure if i-j

S then i

S and j

S

-^

if i

S and j

S but i-j

T, then adding i-j to S decreases

capacity of cut s

2 4

t

1-2 1-4 2-

1

r^24

= 7

∞ ∞

w

3

  • r

3

  • w

4

team 4 can still win thismany more games

games left

Baseball Elimination: Explanation for Sports Writers

Proof of Theorem.

n^

Use max flow formulation, and consider min cut (S, T). n^

Define R = team nodes on source side of min cut = T

S.

n^

Claim. i-j

S if and only if i

R and j

R.

s

2 4

t

1-2 1-4 2-

1

r^24

= 7

∞ ∞

w

3

  • r

3

  • w

4

team 4 can still win thismany more games

games left

∈

R i^

i

x

x^

w r w R r x X r
T
S
cap
x
X
r

Docsity.com

53

Baseball Elimination: Explanation for Sports Writers

Proof of Theorem.

n^

Use max flow formulation, and consider min cut (S, T). n^

Define R = team nodes on source side of min cut = T

S.

n^

Claim. i-j

S if and only if i

R and j

R.

n^

Rearranging terms:

R
R r R w r w

x

x

x

x

R i^

i

x

x

r w R R w R r x X r
w r w R r x X r
T
S
cap
x
X
r

∈

Circulation with Demands

Circulation with demands.

n^

Directed graph G = (V, E). n^

Arc capacities u(e), e

E.

n^

Node supply and demands d(v), v

V.

-^

demand if d(v) > 0; supply if d(v) < 0; transshipment if d(v) = 0

A circulation is a function f: E

that satisfies:

n^

For each e

E:

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

Circulation problem: given (V, E, u, d), does there exist a circulation?

of out

to in

v d

e f

e f^

v

e

v

e

∑

∑

55

A circulation is a function f: E

that satisfies:

n^

For each e

E:

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

1

2 3

5 6

8

10 3

6

11

4

7 9

3

10

0

7

4 4

6

6

1 7

4

2

Capacity

Flow

Circulation with Demands Demand

of out

to in

v d

e f

e f^

v

e

v

e

∑

∑

A circulation is a function f: E

that satisfies:

n^

For each e

E:

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

Necessary condition: sum of supplies = sum of demands.

n^

Proof: sum conservation constraints for every demand node v.

D

v d

v d

v d v v d v

0 ) ( : 0 ) ( :

∑

∑

<

Circulation with Demands

of out

to in

v d

e f

e f^

v

e

v

e

∑

∑

Docsity.com

61

Circulation with Demands and Lower Bounds

Feasible circulation.

n^

Directed graph G = (V, E). n^

Arc capacities u(e) and lower bounds

l

(e), e

E.

-^

force flow to make use of certain edges

n^

Node supply and demands d(v), v

V.

A circulation is a function f: E

that satisfies:

n^

For each e

E:

l(e)

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

Given (V, E,

l

, u, d), is there a circulation?

of out

to in

v d

e f

e f^

v

e

v

e

∑

∑

Circulation with Demands and Lower Bounds

A circulation is a function f: E

that satisfies:

n^

For each e

E:

l(e)

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

Idea: model lower boundswith supply / demands.Create network G’.

to in

of out

v d

e f

e f^

v

e

v

e

∑

∑

v^

w

2,

Lower bound

9

Capacity

2

Flow

v^

w

7

Capacity

d(v)

d(w)

d(v) + 2

d(w) - 2

∑

∑

v

e

v

e

e e v d v d

e

e u

e u

to in

of out

l

l

l

63

Circulation with Demands and Lower Bounds

A circulation is a function f: E

that satisfies:

n^

For each e

E:

l(e)

f(e)

u(e)

(capacity)

n^

For each v

V:

(conservation)

Create network G’.Theorem. There exists a circulation in G if and only if there exists acirculation in G’. If all demands, capacities, and lower bounds in G areintegers, then there is a circulation in G that is integer-valued.

n^

Proof idea: f(e) is a circulation in G if and only if f’(e) = f(e) -

l

(e) is

a circulation in G’.

to in

of out

v d

e f

e f^

v

e

v

e

∑

∑

∑

∑

v

e

v

e

e e v d v d

e

e u

e u

to in

of out

l

l

l

Matrix Rounding

Feasible matrix rounding.

n^

Given a p x q matrix D = {d

i j

} of real numbers.

n^

Row i sum = a

, column j sum bi

.j

n^

Round each d

, aij

, bi

j^

up or down to integer so that sum of rounded

elements in each row (column) equal row (column) sum. n^

Original application: publishing US Census data.

Theorem: for any matrix, there exists a feasible rounding.

Original Data

Possible Rounding

Docsity.com

65

Matrix Rounding

Feasible matrix rounding.

n^

Given a p x q matrix D = {d

i j

} of real numbers.

n^

Row i sum = a

, column j sum bi

.j

n^

Round each d

, aij

, bi

j^

up or down to integer so that sum of rounded

elements in each row (column) equal row (column) sum. n^

Original application: publishing US Census data.

Theorem: for any matrix, there exists a feasible rounding.

n^

Note: "threshold rounding" doesn’t work.

Original Data

Possible Rounding

Matrix Rounding

Max flow formulation.

n^

Original data provides circulation (all demands 0). n^

Integrality theorem

there always exists feasible rounding!

s

1 2 3

1’ 2’ 3’

t

Row

Column

17, 18

12, 1311, 12

16, 1710, 11 14, 15

3, 4^ ∞

Lowerbound

Upperbound

67

Airline Scheduling

Airline scheduling.

n^

Complex computational problem faced by nation’s airline carriers. n^

Produces schedules for thousands of routes each day that areefficient in terms of:

-^

equipment usage, crew allocation, customer satisfaction

-^

in presence of unpredictable issues like weather, breakdowns

n^

One of largest consumers of high-powered algorithmic techniques.

"Toy problem."

n^

Manage flight crews by reusing them over multiple flights. n^

Input: list of cities V. n^

Travel time t(v, w) from city v to w. n^

Flight i: (o

, di

, ti

) consists of origin and destination cities, andi

departure time.

Airline Scheduling

Max flow formulation.

n^

For each flight i, include two nodes u

and vi

.i

n^

Add source s with demand -c, and arcs (s, u

) with capacity 1.i

n^

Add sink t with demand c, and arcs (v

, t) with capacity 1.j

n^

For each i, add arc (u

, vi

) with lower bound and capacity 1.i

n^

if flight j reachable from i, add arc (v

, ui

) with capacity 1.i

s

u^1

u^2

u^3

v^1

v^3

v^2

t

0, 1

1, 1

u^4

v^4

0, 1

0, 1

crew can beginday with any flight

flight is performed

crew can end daywith any flight

same crew can do flights 2 and 4

-c

c

use c crews

Docsity.com

73

Image Segmentation

Formulate as min cut problem.

n^

Maximization. n^

No source or sink. n^

Undirected graph.

Turn into minimization problem.

n^

Since

is a constant,

maximizingis equivalent to minimizing

∑

∑

∈

∈

V v

v

V v

v^

b

a

∑

∑

∑

=

∈

∈

∈

1

} , } { , {

w v

S

E

w v

vw

S v

v

T v

v

p

b

a

I

∑

∑

∑

=

∈

∈

∈

1

} , } { , {

w v

S

E

w v

vw

T v

v

S v

v

p

b

a

I

Image Segmentation

Formulate as min cut problem: G’ = (V’, E’).

n^

Maximization. n^

No source or sink.

-^

add source to correspond to foreground

-^

add sink to correspond to background

n^

Undirected graph.

-^

add two anti-parallel arcs s^

t

v pvw w

b

v

p

vw p

vw p

vw

av

75

Image Segmentation

Consider min cut (S, T) in resulting graph.

n n^

Precisely the quantity we want to minimize.

-^

note if v and w on different sides, p

vw

counted exactly once

s^

t

v w

av

b

v

∑

∑

∑

∈

∈

∈

∈

∈

T w S v

E

w v

vw

S v

v

T v

v

p

b

a

T
S

cap

), , (

p

vw

G’

Project Selection

Projects with prerequisites.

n^

Set P of possible projects. Project v has associated revenue p

.v

-^

some projects generate money: create interactive e-commerceinterface, redesign cs web page

-^

others cost money: upgrade computers, get site license forencryption software

n^

Set of prerequisites E. If (v, w)

E, can’t do project v and unless

also do project w.

-^

can’t start on e-commerce opportunity unless you’ve gotencryption software

n^

A subset of projects A

P is feasible if the prerequisite of every

project in A also belongs to A.

-^

for each v

P, and (v, w)

E, we have w

P

Project selection (max weight closure) problem: choose a feasiblesubset of projects to maximize revenue.

Docsity.com

77

Project Selection

Prerequisite graph.

n^

Include an arc from v to w if can’t do v without also doing w. n^

{v, w, x} is feasible subset of projects. n^

{v, x} is infeasible subset of projects.

v

w x

v

w x

Feasible

Infeasible

Project selection formulation.

n^

Assign infinite capacity to all prerequisite arcs. n^

Add arc (s, v) with capacity p

v^

if p

v^

n^

Add arc (v, t) with capacity -p

v^

if p

v^

n^

For notational convenience, define p

s^

= p

t^

s^

t

-p

w

u v

w x

y^

z

Project Selection

p

v^

-p

x

79

Claim. (S, T) is min cut if and only if S \ {s} is optimal set of projects.

n^

Infinite capacity arcs ensure S \ {s} is feasible. n^

Max revenue because:

s^

t

-p

w

u

w v

x

y^

z

Project Selection

p

v^

-p

∑ x

∑

∑

∑

∈

<

∈

∈

S v

v

p v

v

p S v

v

p T v

v

p

p

p

p

T
S

cap

v

v

v^0

:

0

:

0

:

constant

p

y p

u

Open-pit mining (studied since early 1960’s).

n^

Blocks of earth are extracted from surface to retrieve ore. n^

Each block v has net value p

v^

= value of ore - processing cost.

n^

Can’t remove block v before w or x.

Project Selection

v

x

w

Docsity.com