CSE 421
Edge Disjoint Path / Image Segmentation / Project Selection
Shayan Oveis Gharan
1
CSE 421 Edge Disjoint Path / Image Segmentation / Project Selection - - PowerPoint PPT Presentation
CSE 421 Edge Disjoint Path / Image Segmentation / Project Selection Shayan Oveis Gharan 1 Marriage Theorem Pf. s.t., | | < || G does not a perfect matching Formulate as a max-flow and let (, ) be the
Shayan Oveis Gharan
1
4 = π β© π΅
4|
4
4 = πππ π΅, πΆ β π7 = πππ π΅, πΆ β π + π4 < |π4|
2
s t
π4 π7 π
7
π
4
β
3
5 s 2 3 4 5 6 7 t
>, β¦ , π@.
6
s t 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7
s t 1 1 1 1 1 1 1 1 1 1 1 1 1 1 We can return to u so we can have cycles. But we can eliminate cycles if desired
9 s 2 3 4 5 6 7 t
equal to the min number of edges whose removal disconnects t from s. Pf. i) We show that max number edge disjoint s-t paths = max flow. ii) Max-flow Min-cut theorem => min s-t cut = max-flow iii) For a s-t cut (A,B), cap(A,B) is equal to the number of edges out of
corresponds to cap(A,B) edges whose removal disconnects s from t. So, max number of edge disjoint s-t paths = min number of edges to disconnect s from t.
10
s 2 3 4 5 6 7 t
A
Given an image we want to separate foreground from background
12
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: G
Aβ4
πA + G
Fβ7
π
F β
G
A,F βI Aβ4,Fβ7
πA,F
13
Foreground Background
Difficulties:
Step 1: Turn into Minimization G
Aβ4
πA + G
Fβ7
π
F β
G
A,F βI Aβ4,Fβ7
πA,F Equivalent to minimizing Equivalent to minimizing
14
+ G
AβJ
πA + G
FβJ
π
F
Maximizing + G
Fβ7
πF + G
Aβ4
πA + G
A,F βI Aβ4,Fβ7
πA,F β G
Aβ4
πA β G
Fβ7
π
F +
G
A,F βI Aβ4,Fβ7
πA,F
15
pij pij pij
s t
i j
pij aj bi
π»β²
16 s t
i j
pij aj bi
πππ π΅, πΆ = G
Fβ7
πF + G
Aβ4
πA + G
A,F βI Aβ4,Fβ7
πA,F π»β² π΅
18
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
19
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
20
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
Β₯
21
β 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