Hopial problem Neork Flo Applicaion Injured people: n Hopial: k Each peron need o be brough o a hopial no more han 30 minue aay Each hopial rea no more han n/k" people Gien n, k, and informaion abou people locaion and hopial locaion, gie polynomail algorihm o deermine heher e can rea all people Algorihm Deign by Éa Tardo and Jon Kleinberg Copyrigh 2005 Addion Weley, Neil Rhode Slide by Kein Wayne. Modified by Neil Rhode 2 Ecape problem Ecape problem modified Gien: Direced graph G. Sube of node, S, are afe node Sube of node, X, are populaed node Wan an ecape roue from each X o ome afe node S Pah don hare any edge Gien G, S, X, decide in polynomial ime heher uch a e of ecape roue ei No, pah can hare node eiher Gien G, S, X, decide in polynomial ime heher a e of ecape roue ei 3 4
Dinner Scheduling Dinner Scheduling Reiied Dinner: d 1..d n. People p 1..p n. Each peron ha a e of unaailable nigh hen hey can cook. Come up ih biparie graph o ha G ha perfec maching iff eeryone cook on one nigh ha i aailable for hem Gien a dinner chedule here 2 people are aigned o one nigh, and nobody i aigned o ome oher nigh, fi he chedule (in O(n 2 ) ime). 5 6 Aderiing Aderier: m Uer: n Demographic group: G 1..G k Each uer belong o one or more demographic group U j Each aderier an i ad hon o r i uer, each of hom belong o a lea one of i demographic group X i Each uer ee a mo one ad Gie an efficien algorihm o deermine heher ad can be hon aifying aboe, and if o, ha ad hould be hon o hich uer? 7 Algorihm Deign by Éa Tardo and Jon Kleinberg Copyrigh 2005 Addion Weley, Neil Rhode Slide by Kein Wayne. Modified by Neil Rhode
Image egmenaion. Cenral problem in image proceing. Diide image ino coheren region. E: Three people anding in fron of comple background cene. Idenify each peron a a coheren objec. Foreground / background egmenaion. Label each piel in picure a belonging o foreground or background. V = e of piel, E = pair of neighboring piel. a i # 0 i likelihood piel i in foreground. b i # 0 i likelihood piel i in background. # 0 i eparaion penaly for labeling one of i and j a foreground, and he oher a background. Goal. Accuracy: if a i > b i in iolaion, prefer o label i in foreground. Smoohne: if many neighbor of i are labeled foreground, e hould be inclined o label i a foreground. Find pariion (A, B) ha maimize: # a i + b j i " A j " B foreground background # $ # 9 10 Formulae a min cu problem. Maimizaion. No ource or ink. Undireced graph. Turn ino minimizaion problem. Formulae a min cu problem. G' = (V', E'). Add ource o correpond o foreground; add ink o correpond o background Ue o ani-parallel edge inead of undireced edge. Maimizing # a i + b j i " A j " B # $ # i equialen o minimizing ( # i " V a + b i # j " V ) j 14442 4443 a conan $ # a i $ b j i" A j " B # + # AI{i,j} = 1 i a j j or alernaiely # a j + # b i + # j " B i " A b i G' 11 12
Projec Selecion Conider min cu (A, B) in G'. A = foreground. cap(a, B) = # a j + # bi + j"b i" A # pij i" A, j " B if i and j on differen ide, pij couned eacly once Preciely he quaniy e an o minimize. aj pij i j bi A G' 13 Algorihm Deign by Éa Tardo and Jon Kleinberg Copyrigh 2005 Addion Weley, Neil Rhode Slide by Kein Wayne. Modified by Neil Rhode Open Pi Mining Projec Selecion can be poiie or negaie Open-pi mining. (udied ince early 1960) Block of earh are eraced from urface o reriee ore. Each block ha ne alue p = alue of ore - proceing co. Can' remoe block before or. Projec ih prerequiie. Se P of poible projec. Projec ha aociaed reenue p. ome projec generae money: creae ineracie e-commerce inerface, redeign eb page oher co money: upgrade compuer, ge ie licene Se of prerequiie E. If (, ) $ E, can' do projec unle alo do projec. A ube of projec A % P i feaible if he prerequiie of eery projec in A alo belong o A. Projec elecion. Chooe a feaible ube of projec o maimize reenue. 15 16
Projec Selecion: Prerequiie Graph Projec Selecion: Min Cu Formulaion Prerequiie graph. Include an edge from o if can' do ihou alo doing. {,, } i feaible ube of projec. {, } i infeaible ube of projec. Min cu formulaion. Aign capaciy o all prerequiie edge. Add edge (, ) ih capaciy -p if p > 0. Add edge (, ) ih capaciy -p if p < 0. For noaional conenience, define p = p = 0. p u u -p p y y z -p z feaible infeaible p -p 17 18 Projec Selecion: Min Cu Formulaion Claim. (A, B) i min cu iff A ' { } i opimal e of projec. Infinie capaciy edge enure A ' { } i feaible. Ma reenue becaue: cap(a, B) = # p + #($ p ) " B: p > 0 " A: p < 0 = # p : p > 0 12 3 $ # p " A conan u A p u -p p p y y z -p 19