CSE 421
Project Selection / Reductions
Shayan Oveis Gharan
1
CSE 421 Project Selection / Reductions Shayan Oveis Gharan 1 - - PowerPoint PPT Presentation
CSE 421 Project Selection / Reductions Shayan Oveis Gharan 1 Image Segmentation Foreground / background segmentation Label each pixel as foreground/background. V = set of pixels, E = pairs of neighboring pixels. # 0 is
Shayan Oveis Gharan
1
Label each pixel as foreground/background.
and j as foreground, and the other as background. Goals. Accuracy: if ai > bi in isolation, prefer to label i in foreground. Smoothness: if many neighbors of i are labeled foreground, we should be inclined to label i as foreground. Find partition (A, B) that maximizes: *
#β,
π# + *
)β.
π
) β
*
#,) β0 #β,,)β.
π#,)
3
Foreground Background
Difficulties:
Step 1: Turn into Minimization *
#β,
π# + *
)β.
π
) β
*
#,) β0 #β,,)β.
π#,) Equivalent to minimizing Equivalent to minimizing
4
+ *
#β1
π# + *
)β1
π
)
Maximizing + *
)β.
π) + *
#β,
π# + *
#,) β0 #β,,)β.
π#,) β *
#β,
π# β *
)β.
π
) +
*
#,) β0 #β,,)β.
π#,)
5
pij pij pij
s t
i j
pij aj bi
π»β²
6 s t
i j
pij aj bi
πππ π΅, πΆ = *
)β.
π) + *
#β,
π# + *
#,) β0 #β,,)β.
π#,) π»β² π΅
8
Project Selection
Projects with prerequisites.
β Set P of possible projects. Project v has associated revenue pv.
β some projects generate money: create interactive e-commerce interface,
redesign web page
β others cost money: upgrade computers, get site license
β Set of prerequisites E. If (v, w) Γ E, can't do project v and unless
also do project w.
β A subset of projects A Γ P is feasible if the prerequisite of every
project in A also belongs to A. Project selection. Choose a feasible subset of projects to maximize revenue.
can be positive or negative
9
Project Selection: Prerequisite Graph
Prerequisite graph.
β Include an edge from v to w if can't do v without also doing w. β {v, w, x} is feasible subset of projects. β {v, x} is infeasible subset of projects.
v w x v w x
feasible infeasible
10
Min cut formulation.
β Assign capacity Β₯ to all prerequisite edge. β Add edge (s, v) with capacity -pv if pv > 0. β Add edge (v, t) with capacity -pv if pv < 0. β For notational convenience, define ps = pt = 0.
s t
u v w x y z
Project Selection: Min Cut Formulation Β₯
pv
Β₯ Β₯ Β₯ Β₯ Β₯
py pu
Β₯
11
β Infinite capacity edges ensure A - { s } is feasible. β Max revenue because:
s t
u v w x y z
Project Selection: Min Cut Formulation
pv
cap(A, B) = p v
vβ B: pv > 0
β + (βp v)
vβ A: pv < 0
β = p v
v: pv > 0
β
constant
ο± ο² ο³ β p v
vβ A
β
py pu
Β₯ Β₯ Β₯
A
13
14
15
B is Polynomial time solvable A is Polynomial time solvable No efficient Algorithm for A No efficient Algorithm for B
: πΆ: if and only if there is an algorithm for A given a
16
17
S is an independ set in G S is an Clique in Gβ
1 2 3 4 5 1 2 3 4 5
18
19
20
21