CSE 421 Applications Yin Tat Lee 1 2 Project Selection Given a DAG G V E representing precedence constraints on tasks a task points to its predecessors a profit value p ID: 769626
Download Presentation The PPT/PDF document "CSE 421 Applications" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
CSE 421 ApplicationsYin Tat Lee 1
2 Project Selection Given a DAG G=(V,E) representing precedence constraints on tasks (a task points to its predecessors ) a profit value p(v) for each task vV (may be positive or negative)Find a set AV of tasks that is closed under predecessors, (i.e. if (u,v)E and uA then vA) that maximizes Profit(A)=SvA p(v) -1 4 3 12 10 8 -3 11 - 13 14 -5 -6 4 2 Each task points to its predecessor tasks
3 Extended Graph -1 4 3 12 10 8 -3 11 - 13 14 -5 -6 4 2 s t
4 Extended Graph G’ -1 4 3 12 10 8 -3 11 - 13 14 -5 -6 4 2 s t 5 10 For each vertex v If p ( v ) 0 add ( s , v ) edge with capacity p ( v ) If p ( v ) 0 add ( v , t ) edge with capacity –p ( v )
5 Extended Graph G’Want: Set capacities on edges of G so that for minimum s-t-cut in G’ , the set A=S-{s} satisfies precedence constraintshas maximum possible profit in GCut capacity with S={s} is just C=Sv: p(v)0 p(v)Profit(A) C for any set ATo satisfy constraints, don’t want any original edges of G going forward across the minimum cutThat would correspond to a task in A= S-{ s} that had a predecessor not in A=S-{s}Set capacity of each of the edges of G to .
6 Extended Graph G’ -1 4 3 12 10 8 -3 11 - 13 14 -5 -6 4 2 s t 5 10 Capacity C = S v : p(v) 0 p ( v )
7 Extended Graph G’ -1 4 3 12 10 8 -3 11 - 13 14 -5 -6 4 2 s t 5 10 Cut value = 13 + 3 + 2 + 3 + 4 = 13 + 3 + C - 4 - 8 - 10 - 11 - 12 - 14
8 Project Selection Claim Any s-t-cut in G’ such that A=S-{s} satisfies precedence constraints andhas capacity c(S,T)=C - SvA p(v) = C - Profit(A)Corollary A minimum cut in G’ yields an optimal solution A=S -{s } to the project selection problemAlgorithm Compute maximum flow f in G’, find the set S of nodes reachable from s in G’f and return S-{s}
9 Proof of Claim A=S-{s} satisfies precedence constraints No edge of G crosses forward out of A since those edges have capacity Only forward edges cut are of the form ( v,t) for vA or (s,v) for vAThe (v,t) edges for vA contribute SvA:p(v)0 -p(v) = - SvA:p(v)0 p (v) The (s,v) edges for vA contribute SvA: p(v)0 p (v)=C-SvA: p(v)0 p(v)Therefore the total capacity of the cut is c(S,T ) = C - SvA p(v) =C-Profit(A)
Image Segmentation Given an image we want to separate foreground from backgroundImportant problem in image processing. Divide image into coherent regions.10
Foreground / background segmentation Label each pixel as foreground/background. = set of pixels, = pairs of neighboring pixels. is the original image. means we prefer to label in foreground. is separation penalty for labeling one of and j as foreground, and the other as background.Goals:Find partition that minimizes: where is the foreground. 11
Min cut Formulation Add s to correspond to foreground;Add t to correspond to background;Use two anti-parallel edges instead of undirected edge. 12 p ij p ij p ij s t i j p ij if if
Min cut Formulation (cont’d) Consider min cut in G’. ( = foreground.) 13 Precisely, what we want to minimize. s t i j p ij if if
Reality The main difficulty is to come up with a good model.May want to have human interaction. Segmentation may be real-valued instead of {0,1}.There are many more than 1 objects.May need labeling.Augmenting path is not great for GPU. 14