Presentation is loading. Please wait.

Presentation is loading. Please wait.

Analysis of Algorithms

Similar presentations


Presentation on theme: "Analysis of Algorithms"β€” Presentation transcript:

1 Analysis of Algorithms
Minimum Cost Flow Uri Zwick Tel Aviv University December 2015 Last modified: December 9, 2015

2 A Flow network A Flow 𝑁=(𝐺,π‘Ž,𝑐,𝑠,𝑑) 𝐺=(𝑉,𝐸) – A directed graph
π‘Ž:𝐸→ ℝ + – A cost function π‘ βˆˆπ‘‰ – A source vertex 𝑐:𝐸→ℝ – A capacity function π‘‘βˆˆπ‘‰ – A sink vertex A Flow 𝑓:𝐸→ ℝ + is a (feasible) flow iff (i) 0≀𝑓 𝑒 ≀𝑐(𝑒), for every π‘’βˆˆπΈ. (Capacity constraint) (ii) 𝑓 𝛿 βˆ’ 𝑣 =𝑓( 𝛿 + 𝑣 ), for every π‘£βˆˆπ‘‰βˆ–{𝑠,𝑑}. (Conservation) The value of a flow is π‘‰π‘Žπ‘™ 𝑓 = 𝑓 =𝑓 𝛿 + 𝑠 =𝑓( 𝛿 βˆ’ 𝑑 ). The cost of a flow is πΆπ‘œπ‘ π‘‘ 𝑓 =𝑐(𝑓)= π‘’βˆˆπΈ π‘Ž 𝑒 𝑓(𝑒) . Find a maximum flow of minimum cost.

3 Flows with demands/supplies
𝑁=(𝐺,π‘Ž,𝑏,𝑐) 𝑏:𝑉→ ℝ – A demand function. (Where 𝑏 𝑉 = 𝑣 𝑏 𝑣 =0.) 𝑓:𝐸→ ℝ + is a (feasible) flow iff (i) 0≀𝑓 𝑒 ≀𝑐(𝑒), for every π‘’βˆˆπΈ. (Capacity constraint) (ii) 𝑓 𝛿 βˆ’ 𝑣 βˆ’π‘“ 𝛿 + 𝑣 =𝑏(𝑣), for every π‘£βˆˆπ‘‰. (Demand/supply) Exercise: Show that the demand-supply version is equivalent to the sink-source version. Circulations A flow that satisfies the conservation constraint at all vertices. Exercise: Show that the min cost flow problem is equivalent to the problem of finding a min cost circulation.

4 Flow Decomposition Exercise: Prove the theorem.
Let 𝑁=(𝐺,π‘Ž,𝑐,𝑠,𝑑) be a flow network. If 𝑃 is a simple path from 𝑠 to 𝑑, let 𝑓 𝑃 be a flow such that 𝑓 𝑃 𝑒 =1 if π‘’βˆˆπ‘ƒ, and 𝑓 𝑃 𝑒 =0, otherwise. ( 𝑓 𝑃 is not necessarily feasible.) Similarly, if 𝐢 is a simple directed cycle in 𝐺, let 𝑓 𝐢 be a circulation in which one unit of flow flows on each edge of 𝐢. Theorem: Let 𝑓:𝐸→ ℝ + be a flow in 𝑁. Then, there is a collection of simple 𝑠-𝑑 paths 𝑃 1 , 𝑃 2 ,…, 𝑃 π‘˜ , and a collection of simple cycles 𝐢 1 , 𝐢 2 ,…, 𝐢 𝑙 , and constants 𝛼 1 , 𝛼 2 ,…, 𝛼 π‘˜ >0 and 𝛽 1 , 𝛽 2 ,…, 𝛽 𝑙 >0, such that π‘˜+π‘™β‰€π‘š and 𝑓= 𝑖=1 π‘˜ 𝛼 𝑖 𝑓 𝑃 𝑖 + 𝑗=1 𝑙 𝛽 𝑗 𝑓 𝐢 𝑗 . Furthermore, if 𝑓 is a circulation, i.e., 𝑓 =0, then π‘˜=0, i.e., the flow is decomposed into flows on directed cycles. Exercise: Prove the theorem.

5 Residual Network 1,βˆ’8 1,5,8 0,1,3 1, 3 4, 8 1,3,7 2, 7 1, βˆ’7 2, 5 0,2,5 1, βˆ’4 1,1,4 𝑁 𝑁 𝑓


Download ppt "Analysis of Algorithms"

Similar presentations


Ads by Google