Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut...

41
Maximum Flows and Minimum Cuts II Lecture 6 COMP 610 January 24 2018

Transcript of Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut...

Page 1: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumFlowsandMinimumCutsII

Lecture6COMP610January242018

Page 2: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

Recall:ACapacitatedNetworkDirectedGraphG=(V,E),nonnegativecapacityc(e)(sometimesu(e)isused)foreachedgeeuniquesourcesandsinkt,noedgesintosoroutoft,

1/20/2018 media/31c/31cb1d64-6c66-4f2c-8996-519b583724d0/phpAq5Htc.png (1024×502)

http://d2vlcm61l7u1fs.cloudfront.net/media%2F31c%2F31cb1d64-6c66-4f2c-8996-519b583724d0%2FphpAq5Htc.png 1/1

Page 3: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

Recall:Ans-tFlow∀e∈Ehavef(e),0≤ f(e)≤c(e)(capacityconstraints)∀v∈V∑ 𝑓 𝑢𝑣 =)*∈+ ∑ 𝑓(𝑢𝑣)*)∈+ (flowconservationconstraints)

Page 4: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

Recall:Ans-tCutisapartition(A,B)ofVwiths∈ 𝐴, 𝑏 ∈ 𝐵.Itscapacityc(A,B)=∑ 𝑐(𝑢𝑣))*∈+,)∈5,*∈6

Page 5: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

Recall:Thevalueofaflowandflowacrossa cut

ForallS⊆ 𝑉: fout(S)=∑ 𝑓(𝑥𝑦))*∈+,)∈<,*∈=><

fin(S)=∑ 𝑓(𝑥𝑦))*∈+,)∈=><,*∈<

v(f)=fout({s})Foralls-tcuts(A,B),v(f)=fout(A)-fin(A)≤ c(A,B)Proof:v(f)=∑ (𝑓*∈5

out(v)-fin(v))=∑ 𝑓*∈5out(v)-∑ 𝑓?@*∈< (v)

=(fout(A)+∑ 𝑓(𝑣𝑤)*B∈+,*∈5,B∈5 )- (fin(A)+∑ 𝑓(𝑣𝑤)*B∈+,*∈5,B∈5 )=fout(A)-fin(A)≤ fout(A)≤ c(A,B)

Typeequationhere.

Page 6: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaxFlowMinCutTheorem

Foreverycapacitatednetwork.Themaximumvolumeofans-tflowisequaltotheminimumvolumeofans-tcut.

Theorem7.14KTIfallthecapacitiesareintegerthenthereisamaximumvolumes-tflowfwhichisintegervalued. CanfindthisflowinO(v(f)|E|)time.

Page 7: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

Recall:Matchings andCovers

AmatchingMisadisjointsetofedgesC⊆VisacoverifthereisnoedgewithbothendpointsinV-C.ForamatchingMandcoverCinanyG,|M|≤ |C|

Page 8: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ForBipartiteG:TheMaxSizeofaMatching=MinSizeofacover

Page 9: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinaDirectedGraphG

V(G’)=V(G),E(G’)=E(G)-{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}Findainteger-valuedmaxvalues-tflowfinG’.Findasetofv(f)edgedisjointpathsfroms-tinG,onlyusingeiff(e)=1.Foranys-tcut(A,B),c(A,B)=|{ab∈ E|a∈ A,b∈ B}|.Foranys-tcut(A,B),removingtheset{ab∈ E|a∈ A,b∈ B}separatessfromt(i.e.destroysalls-tpaths).Theorem:Themaximumsizeofasetofedgedisjoints-tpathsinadirectedgraphequalstheminimumsizeofasetofedgeswhoseremovalseparatessfromt.

Page 10: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinaDirectedGraphG

V(G’)=V(G),E(G’)=E(G)-{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}Findainteger-valuedmaxvalues-tflowfinG’.Findasetofv(f)edgedisjointpathsfroms-tinG,onlyusingeiff(e)=1.Foranys-tcut(A,B),c(A,B)=|{ab∈ E|a∈ A,b∈ B}|.Foranys-tcut(A,B),removingtheset{ab∈ E|a∈ A,b∈ B}separatessfromt(i.e.destroysalls-tpaths).Theorem:Themaximumsizeofasetofedgedisjoints-tpathsinadirectedgraphequalstheminimumsizeofasetofedgeswhoseremovalseparatessfromt.

Page 11: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinaDirectedGraphG

V(G’)=V(G),E(G’)=E(G)-{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}Findainteger-valuedmaxvalues-tflowfinG’.Findasetofv(f)edgedisjointpathsfroms-tinG,onlyusingeiff(e)=1.Foranys-tcut(A,B),c(A,B)=|{ab∈ E|a∈ A,b∈ B}|.Foranys-tcut(A,B),removingtheset{ab∈ E|a∈ A,b∈ B}separatessfromt(i.e.destroysalls-tpaths).Theorem:Themaximumsizeofasetofedgedisjoints-tpathsinadirectedgraphequalstheminimumsizeofasetofedgeswhoseremovalseparatessfromt.

Page 12: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinaDirectedGraphG

V(G’)=V(G),E(G’)=E(G)-{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}Findainteger-valuedmaxvalues-tflowfinG’.Findasetofv(f)edgedisjointpathsfroms-tinG,onlyusingeiff(e)=1.Foranys-tcut(A,B),c(A,B)=|{ab∈ E|a∈ A,b∈ B}|.Foranys-tcut(A,B),removingtheset{ab∈ E|a∈ A,b∈ B}separatessfromt(i.e.destroysalls-tpaths).Menger’s Theorem(1927):Themaximumsizeofasetofedgedisjoints-tpathsinadirectedgraphequalstheminimumsizeofasetofedgeswhoseremovalseparatessfromt.

Page 13: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvu.Howdowehandlethis????Iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 14: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvu.Howdowehandlethis????Iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 15: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvu.Howdowehandlethis????Iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 16: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvuinG’.Howdowehandlethis????Iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 17: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvuinG’.Howdowehandlethis????Iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 18: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

MaximumNumberofEdge-DisjointPathsinanUndirectedGraphGV(G’)=V(G),E(G’)={uv,vu| uv ∈ 𝐸 𝐺 }−{xs|xs∈ 𝐸(𝐺)} − {𝑡𝑥|𝑡𝑥 ∈E(G)}AsetFofkedgedisjoints-tpathsinGyieldans-tflowofvaluekinG’.Asbefore,thereisanalgorithmwhichgivenaninteger-valuedflowfofvaluekinG’yieldsasetFofkdisjoints-tpathsinG’.EachsuchpathyieldsanundirectedpathinG.Thesearedisjointexceptthatthepathusinguv inG’mayintersectwiththepathusingvuinG’.Howdowehandlethis????Foralluv ∈ 𝐸 𝐺 , iff(uv)=f(vu)=1,setf(uv)=f(vu)=0.ThenfindF.

Page 19: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineScheduling

Setofflights:(Origin,Destination,Departure Time,ArrivalTime)

Flightjisreachablefromflighti ifbetweenthearrivaltimeforflightiandthedeparturetimeforflightjthereistimetodueallscheduledmaintenanceandcleaning,andrelocatefromthedestinationofflightitotheoriginofflightj.

Wewanttofindoutifkplanescanhandlealltheflights.

Page 20: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineScheduling

Setofflights:(Origin,Destination,Departure Time,ArrivalTime)

Flightjisreachablefromflighti ifbetweenthearrivaltimeforflightiandthedeparturetimeforflightjthereistimetodueallscheduledmaintenanceandcleaning,andrelocatefromthedestinationofflightitotheoriginofflightj.

Wewanttofindoutifkplanescanhandlealltheflights.

Page 21: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineScheduling

Setofflights:(Origin,Destination,Departure Time,ArrivalTime)

Flightjisreachablefromflighti ifbetweenthearrivaltimeforflightiandthedeparturetimeforflightjthereistimetodueallscheduledmaintenanceandcleaning,andrelocatefromthedestinationofflightitotheoriginofflightj.

Wewanttofindoutifkplanescanhandlealltheflights.

Page 22: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineScheduling

Setofflights:(Origin,Destination,Departure Time,ArrivalTime)

Flightjisreachablefromflighti ifbetweenthearrivaltimeforflightiandthedeparturetimeforflightjthereistimetodueallscheduledmaintenanceandcleaning,andrelocatefromthedestinationofflightitotheoriginofflightj.

Wewanttofindoutifkplanescanhandlealltheflights.

Page 23: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 24: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 25: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 26: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 27: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 28: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaEdgeDisjointPaths

Buildadigraphwithtwoverticesui andvi foreachflight.Thereisanedgefromui tovi foreveryi.Thereisanedgefromvi touj ifflightjisreachablefromflighti.Thereisasourcesandanedgefromstoeveryui.Thereisasinktandanedgefromeveryvi tot.ApathPfromstotpointsoutasetofflightswhichcanbehandledbyoneplane(thoseforwhichuivi isanedgeofP).Wecanscheduletheflightsusingkplanesifthereisasetofatmostkedge-disjointpathsofGusingtheedgeuivi foreveryflighti.

Page 29: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaBipartiteMatching

Foranyscheduleusingexactlykplanestohandlefflights,thecorrespondingkedgedisjointpathsusekedgesoutofs,kedgesintot,thefedgesoftheformuivi,andf-kedgesoftheformviuj whereflightjisreachablefromflighti.Theselastf-kedgesformamatching.Thedesiredkpathsexistpreciselyifthereisamatchingofsizef-kinthegraphG’whoseedgesetis{vjui|flighti isreachablefromflightj}.Sothenumberofplanesneededistheminimumkforwhichthereisamatchingofsizen-kinG’.Giventhematchingwecanfindthescheduleeasily,sothetimetofindanoptimalscheduleisO(f^3).

Page 30: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaBipartiteMatching

Foranyscheduleusingexactlykplanestohandlefflights,thecorrespondingkedgedisjointpathsusekedgesoutofs,kedgesintot,thefedgesoftheformuivi,andf-kedgesoftheformviuj whereflightjisreachablefromflighti.Theselastf-kedgesformamatching.Thedesiredkpathsexistpreciselyifthereisamatchingofsizef-kinthegraphG’whoseedgesetis{vjui|flighti isreachablefromflightj}.Sothenumberofplanesneededistheminimumkforwhichthereisamatchingofsizen-kinG’.Giventhematchingwecanfindthescheduleeasily,sothetimetofindanoptimalscheduleisO(f^3).

Page 31: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaBipartiteMatching

Foranyscheduleusingexactlykplanestohandlefflights,thecorrespondingkedgedisjointpathsusekedgesoutofs,kedgesintot,thefedgesoftheformuivi,andf-kedgesoftheformviuj whereflightjisreachablefromflighti.Theselastf-kedgesformamatching.Thedesiredkpathsexistpreciselyifthereisamatchingofsizef-kinthegraphG’whoseedgesetis{vjui|flighti isreachablefromflightj}.Sothenumberofplanesneededistheminimumkforwhichthereisamatchingofsizen-kinG’.Giventhematchingwecanfindthescheduleeasily,sothetimetofindanoptimalscheduleisO(f^3).

Page 32: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

AirlineSchedulingViaBipartiteMatching

Foranyscheduleusingexactlykplanestohandlefflights,thecorrespondingkedgedisjointpathsusekedgesoutofs,kedgesintot,thefedgesoftheformuivi,andf-kedgesoftheformviuj whereflightjisreachablefromflighti.Theselastf-kedgesformamatching.Thedesiredkpathsexistpreciselyifthereisamatchingofsizef-kinthegraphG’whoseedgesetis{vjui|flighti isreachablefromflightj}.Sothenumberofplanesneededistheminimumkforwhichthereisamatchingofsizen-kinG’.Giventhematchingwecanfindthescheduleeasily,sothetimetofindanoptimalscheduleisO(f^3).

Page 33: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

SequentialSchedulingViaBipartiteMatching

Page 34: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationGraph.

GraphG=(V,E).Visthesetofpixels,Ejoinsneighbours.

Page 35: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationProblem

• ForeachpixelI,have:ai-likelihoodi isintheforegroundandbi-likelihoodi isinthebackground.

• Foreachedgeij oftheImageSegmentationgraphhaveseparationpenaltypijincurredifwemakedifferentchoicesfori andj.• WewanttofindapartitionofthepixelsintoasetFofforegroundpixelsandasetBofbackgroundpixelssoastomaximize:

∑ 𝑎??∈Y +∑ 𝑏??∈6 −∑ 𝑝?[?[∈+,?∈Y,[∈6

• Thisisthesameasminimizing∑ 𝑎??∈6 +∑ 𝑏??∈Y +∑ 𝑝?[?[∈+,?∈Y,[∈6

Page 36: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationProblem

• ForeachpixelI,have:ai-likelihoodi isintheforegroundandbi-likelihoodi isinthebackground.

• Foreachedgeij oftheImageSegmentationgraphhaveseparationpenaltypijincurredifwemakedifferentchoicesfori andj.• WewanttofindapartitionofthepixelsintoasetFofforegroundpixelsandasetBofbackgroundpixelssoastomaximize:

∑ 𝑎??∈Y +∑ 𝑏??∈6 −∑ 𝑝?[?[∈+,?∈Y,[∈6

• Thisisthesameasminimizing∑ 𝑎??∈6 +∑ 𝑏??∈Y +∑ 𝑝?[?[∈+,?∈Y,[∈6

Page 37: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationProblem

• ForeachpixelI,have:ai-likelihoodi isintheforegroundandbi-likelihoodi isinthebackground.

• Foreachedgeij oftheImageSegmentationgraphhaveseparationpenaltypijincurredifwemakedifferentchoicesfori andj.• WewanttofindapartitionofthepixelsintoasetFofforegroundpixelsandasetBofbackgroundpixelssoastomaximize:

∑ 𝑎??∈Y +∑ 𝑏??∈6 −∑ 𝑝?[?[∈+,?∈Y,[∈6

• Thisisthesameasminimizing∑ 𝑎??∈6 +∑ 𝑏??∈Y +∑ 𝑝?[?[∈+,?∈Y,[∈6

Page 38: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationProblem

• ForeachpixelI,have:ai-likelihoodi isintheforegroundandbi-likelihoodi isinthebackground.

• Foreachedgeij oftheImageSegmentationgraphhaveseparationpenaltypijincurredifwemakedifferentchoicesfori andj.• WewanttofindapartitionofthepixelsintoasetFofforegroundpixelsandasetBofbackgroundpixelssoastomaximize:

∑ 𝑎??∈Y +∑ 𝑏??∈6 −∑ 𝑝?[?[∈+,?∈Y,[∈6

• Thisisthesameasminimizing∑ 𝑎??∈6 +∑ 𝑏??∈Y +∑ 𝑝?[?[∈+,?∈Y,[∈6

Page 39: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationViaMinCut

• Constructacapacited networkwhosevertexsetisthepixels,sandt.• Addanedgesi foreverypixeli withcapacityai• Addanedgeti foreverypixeli withcapacitybi• Foreverytwoneighbouring pixelsij,addedgesij andji bothwithcapacitypij• Thereisabijection betweens-tcutsandchoicesfortheforegroundFandbackground.Thecutcorrespondingto(F,B)is(s+F,t+B).• Wearelookingfortheminimumcapacitycut.

Page 40: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationViaMinCut

• Constructacapacited networkwhosevertexsetisthepixels,sandt.• Addanedgesi foreverypixeli withcapacityai• Addanedgeti foreverypixeli withcapacitybi• Foreverytwoneighbouring pixelsij,addedgesij andji bothwithcapacitypij• Thereisabijection betweens-tcutsandchoicesfortheforegroundFandbackground.Thecutcorrespondingto(F,B)is(s+F,t+B).• Wearelookingfortheminimumcapacitycut.

Page 41: Maximum Flows and Minimum Cuts II - McGill School Of ...breed/2018COMP610/... · Max Flow Min Cut Theorem For every capacitated network. The maximum volume of an s-t flow is equal

ImageSegmentationViaMinCut

• Constructacapacited networkwhosevertexsetisthepixels,sandt.• Addanedgesi foreverypixeli withcapacityai• Addanedgeti foreverypixeli withcapacitybi• Foreverytwoneighbouring pixelsij,addedgesij andji bothwithcapacitypij• Thereisabijection betweens-tcutsandchoicesfortheforegroundFandbackground.Thecutcorrespondingto(F,B)is(s+F,t+B).• Wearelookingfortheminimumcapacitycut.