CSE 421 Edge Disjoint Path / Image Segmentation / Project Selection - - PowerPoint PPT Presentation

β–Ά
cse 421
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

CSE 421

Edge Disjoint Path / Image Segmentation / Project Selection

Shayan Oveis Gharan

1

slide-2
SLIDE 2

Marriage Theorem

  • Pf. βˆƒπ‘‡ βŠ† π‘Œ s.t., |𝑂 𝑇 | < |𝑇| ⇐ G does not a perfect matching

Formulate as a max-flow and let (𝐡, 𝐢) be the min s-t cut G has no perfect matching => 𝑀 π‘”βˆ— < |π‘Œ|. So, π‘‘π‘π‘ž 𝐡, 𝐢 < |π‘Œ| Define π‘Œ4 = π‘Œ ∩ 𝐡, π‘Œ7 = π‘Œ ∩ 𝐢, 𝑍

4 = 𝑍 ∩ 𝐡

Then, π‘‘π‘π‘ž 𝐡, 𝐢 = π‘Œ7 + |𝑍

4|

Since min-cut does not use ∞ edges, 𝑂 π‘Œ4 βŠ† 𝑍

4

𝑂 π‘Œ4 ≀ 𝑍

4 = π‘‘π‘π‘ž 𝐡, 𝐢 βˆ’ π‘Œ7 = π‘‘π‘π‘ž 𝐡, 𝐢 βˆ’ π‘Œ + π‘Œ4 < |π‘Œ4|

2

s t

π‘Œ4 π‘Œ7 𝑍

7

𝑍

4

∞

slide-3
SLIDE 3

Bipartite Matching Running Time

Which max flow algorithm to use for bipartite matching? Generic augmenting path: O(m val(f*) ) = O(mn). Capacity scaling: O(m2 log C ) = O(m2). Shortest augmenting path: O(m n1/2). Non-bipartite matching. Structure of non-bipartite graphs is more complicated, but well-understood. [Tutte-Berge, Edmonds-Galai] Blossom algorithm: O(n4). [Edmonds 1965] Best known: O(m n1/2). [Micali-Vazirani 1980]

3

slide-4
SLIDE 4

Edge Disjoint Paths

slide-5
SLIDE 5

Edge Disjoint Paths Problem

Given a digraph G = (V, E) and two nodes s and t, find the max number of edge-disjoint s-t paths.

  • Def. Two paths are edge-disjoint if they have no edge in

common. Ex: communication networks.

5 s 2 3 4 5 6 7 t

slide-6
SLIDE 6

Max Flow Formulation

Assign a unit capacitary to every edge. Find Max flow from s to t.

  • Thm. Max number edge-disjoint s-t paths equals max flow value.
  • Pf. Β£

Suppose there are k edge-disjoint paths 𝑄

>, … , 𝑄@.

Set f(e) = 1 if e participates in some path 𝑄A ; else set f(e) = 0. Since paths are edge-disjoint, f is a flow of value k. β–ͺ

6

s t 1 1 1 1 1 1 1 1 1 1 1 1 1 1

slide-7
SLIDE 7

Max Flow Formulation

  • Thm. Max number edge-disjoint s-t paths equals max flow value.
  • Pf. β‰₯ Suppose max flow value is k

Integrality theorem Þ there exists 0-1 flow f of value k. Consider edge (s, u) with f(s, u) = 1.

  • by conservation, there exists an edge (u, v) with f(u, v) = 1
  • continue until reach t, always choosing a new edge

This produces k (not necessarily simple) edge-disjoint paths. β–ͺ

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

slide-8
SLIDE 8

Network Connectivity

slide-9
SLIDE 9

Network Connectivity

Given a digraph G = (V, E) and two nodes s and t, find min number of edges whose removal disconnects t from s.

  • Def. A set of edges F Í E disconnects t from s if all s-t paths

uses at least one edge in F. Ex: In testing network reliability

9 s 2 3 4 5 6 7 t

slide-10
SLIDE 10

Network Connectivity using Min Cut

  • Thm. [Menger 1927] The max number of edge-disjoint s-t paths is

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

  • A. In other words, every s-t cut (A,B)

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

slide-11
SLIDE 11

Image Segmentation

slide-12
SLIDE 12

Image Segmentation

Given an image we want to separate foreground from background

  • Central problem in image processing.
  • Divide image into coherent regions.

12

slide-13
SLIDE 13

Foreground / background segmentation

Label each pixel as foreground/background.

  • V = set of pixels, E = pairs of neighboring pixels.
  • 𝑏A β‰₯ 0 is likelihood pixel i in foreground.
  • 𝑐A β‰₯ 0 is likelihood pixel i in background.
  • π‘žA,F β‰₯ 0 is separation penalty for labeling one of i

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

slide-14
SLIDE 14

Image Seg: Min Cut Formulation

Difficulties:

  • Maximization (as opposed to minimization)
  • No source or sink
  • Undirected graph

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

slide-15
SLIDE 15

Min cut Formulation (cont’d)

G' = (V', E'). Add s to correspond to foreground; Add t to correspond to background Use two anti-parallel edges instead of undirected edge.

15

pij pij pij

s t

i j

pij aj bi

𝐻′

slide-16
SLIDE 16

Min cut Formulation (cont’d)

Consider min cut (A, B) in G’. (A = foreground.) Precisely the quantity we want to minimize.

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 𝐻′ 𝐡

slide-17
SLIDE 17

Project Selection

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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

  • pw

u v w x y z

Project Selection: Min Cut Formulation Β₯

pv

  • px

Β₯ Β₯ Β₯ Β₯ Β₯

py pu

  • pz

Β₯

slide-21
SLIDE 21

21

  • Claim. (A, B) is min cut iff A - { s } is optimal set of projects.

β–  Infinite capacity edges ensure A - { s } is feasible. β–  Max revenue because:

s t

  • pw

u v w x y z

Project Selection: Min Cut Formulation

pv

  • px

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