15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem.

Slides:



Advertisements
Similar presentations
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
Advertisements

Outline LP formulation of minimal cost flow problem
Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Introduction to Algorithms
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
Max Flows 2: The Excess Scaling Algorithm and Variants. James Orlin.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
Network Optimization Models: Maximum Flow Problems
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 19.
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
Chapter 7 Maximum Flows: Polynomial Algorithms
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
15.082J and 6.855J and ESD.78J November 4, 2010 The Network Simplex Algorithm.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.
and 6.855J The Capacity Scaling Algorithm.
15.082J and 6.855J and ESD.78J November 30, 2010 The Multicommodity Flow Problem.
1 Minimum Cost Flows Goal: Minimize costs to meet all demands in a network subject to capacities (combines elements of both shortest path and max flow.
Minimum Cost Flows. 2 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x.
1 Minimum Cost Flow - Strongly Polynomial Algorithms Introduction Minimum-Mean Cycle Canceling Algorithm Repeated Capacity Scaling Algorithm Enhanced Capacity.
15.082J and 6.855J and ESD.78J October 19, 2010 Max Flows 3 Preflow-Push Algorithms.
15.082J & 6.855J & ESD.78J September 23, 2010 Dijkstra’s Algorithm for the Shortest Path Problem.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
Max flows in O(nm) time, and sometimes less. by James B. Orlin MIT Sloan School.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
& 6.855J & ESD.78J Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem.
15.082J & 6.855J & ESD.78J October 7, 2010 Introduction to Maximum Flows.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
Class Plan 2-1.Minimum Spanning Tree 最小木
Supplementary: Feasible Labels and Linear Programming  Consider the LP formulation of the shortest s-t path problem: (P) Minimize  (i, j)  A c ij x.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
EMIS 8374 The Ford-Fulkerson Algorithm (aka the labeling algorithm) Updated 4 March 2008.
15.082J and 6.855J and ESD.78J Network Simplex Animations.
15.082J and 6.855J and ESD.78J October 21, 2010 Max Flows 4.
1 Maximum Flows CONTENTS Introduction to Maximum Flows (Section 6.1) Introduction to Minimum Cuts (Section 6.1) Applications of Maximum Flows (Section.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
Cycle Canceling Algorithm
Algorithms and Networks
Dijkstra’s Algorithm with two levels of buckets
James B. Orlin Presented by Tal Kaminker
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
Introduction to Maximum Flows
Dijkstra’s Algorithm for the Shortest Path Problem
Dijkstra’s Algorithm for the Shortest Path Problem
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Primal-Dual Algorithm
Successive Shortest Path Algorithm
EE5900 Advanced Embedded System For Smart Infrastructure
and 6.855J March 6, 2003 Maximum Flows 2
Algorithms and Networks
Network Optimization Flow Decomposition.
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Introduction to Maximum Flows
15.082J & 6.855J & ESD.78J Visualizations
Introduction to Minimum Cost Flows
Introduction to Maximum Flows
The Successive Shortest Path Algorithm
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Max Flows 3 Preflow-Push Algorithms
Class 11 Max Flows Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, the max flow.
Presentation transcript:

15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem

Overview of lecture Quick review of min cost flow and optimality conditions Pseudoflows The successive shortest path algorithm A polynomial time scaling algorithm 2

3 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x ij = amount shipped on arc (i,j) Minimize∑ (i,j) ∈ A c ij x ij ∑ j x ij - ∑ j x ji = b i for all i ∈ N. and 0 ≤ x ij ≤ u ij for all (i,j) ∈ A.

4 The Residual Network G(x) u ij ij c ij u ij - x ij ij x ij c ij -c ij 8 12 $10 Suppose x 12 = $10 -$10 Reducing the flow in (i, j) by 1 is equivalent to sending one unit of flow from j to i. It reduces the cost by c ij.

5 Pseudo-flows A pseudo-flow is a "flow" vector x such that 0  x  u. Let e(i) denote the excess (deficit) at node i Supplies/demands and capacities A pseudo-flow and excesses

6 Pseudo-flows and the residual network A pseudo-flow and excesses The residual network 3 2 The infeasiblity of the pseudo-flow is ∑ e(i)>0 e(i). e.g., 5.

7 Reduced Costs in G(x) $ $1 -$5 $3 – π 1 + π $1 – π 2 + π 3 -$5 – π 3 + π 1 Let π i denote the node potential for node i. For unit of flow out of node i, subtract π i from the cost. For unit of flow into node j, add π j to the cost.

Optimality Conditions Theorem. Suppose that x* is flow and π* is a vector of node potential. Then x* and π* are optimal if 1. the flow x* is feasible and 2. c π* ij ≥ 0 for all (i, j) ∈ G(x*). The second property is often called dual feasibility. 8

Optimality Conditions 9 The cycle canceling algorithm starts with a feasible flow and maintains a feasible flow at each iteration. It terminates with dual feasibility. The successive shortest path algorithm starts with (and maintains) an infeasible flow x and node potentials π that are dual feasible. It stops when it obtains a flow that is feasible. It’s main subroutine involves sending flow along a path from a node with excess to a node with deficit.

Augmenting paths Capacities and excesses in G(x) 3 2 A path P from i to j in G(x) is augmenting if e(i) > 0, e(j) < 0, and ∀ (v, w) ∈ P, c π vw = Excesses and reduced costs in G(x)

Augmenting along a path 11 The capacity of an augmenting path P from node i to node j is min { e(i), -e(j), min (v,w) ∈ P r vw } The augmenting path with residual capacities In this case, the capacity is min {5, 2, 3} = 2 To augment along a path P is to send δ units of flow from i to j in P, where δ = capacity(P).

Before and after the augmentation Capacities and excesses in G(x) before augmenting on P Capacities and excesses in G(x) after augmenting on P 1 4 2

The effect of augmentations Excesses and reduced costs before the augmentation Excesses and reduced costs after the augmentation Augmentations reduce the infeasiblity by at least 1. Augmentations maintain dual feasibility. Any arc added to G(x) is the reversal of an arc with a reduced cost of 0.

14 The Successive Shortest Path Algorithm Initialize with a dual feasible pseudo-flow (x, π) while x is infeasible do select a node i with e(i) > 0 adjust the node potentials so that it remains dual feasible and there is an augmenting path P from node i to a node j with e(j) < 0; (if the adjustment is not possible, then there is no feasible flow for the problem) augment along path P update the residual network and excesses; The SSP Algorithm

The next steps Show how to find an initial dual feasible pseudoflow. Show how to adjust the node potentials Show that the problem is infeasible if there is no possible adjustment of the node potentials Proof of finiteness Proof of correctness of the algorithm 15

Finding an initial dual feasible pseudoflow Let A’ = {(i, j) : u ij = ∞}. We first choose π so that c π ij ≥ 0 for (i, j) ∈ A’. Step 1. Let C = 1 + max { | c ij | : (i, j) ∈ A’}. If there is no directed path from 1 to j in A’, then add arc (1, j) to A’ with cost nC. Step 2. Use a shortest path algorithm to find the shortest path length from 1 to node j in A’. If there is a negative cost cycle, quit. One can send an infinite amount of flow around a negative cost cycle. Step 3. Let π(j) = -d(j) for all j. Step 4. For each arc (i, j) ∈ A\A’ with c π ij < 0, let x ij = u ij. 16

17 Finding an initial dual feasible pseudoflow 17 A’ = solid lines. They have infinite capacity. The costs are on the arcs. The dotted red line has a capacity of The numbers next to nodes are the shortest path distances from node 1. c π ij = c ij + d(i) – d(j) d(2) =

Adjusting node potentials Select node i with e(i) > 0. Let d(j) = shortest path from node i to node j in G(x). Replace π j by π j - d(j) for all j ∈ N Node potentials π j - d(j)and reduced costs G(x) with reduced costs on arcs and shortest path distances. e(1) >

On Node Potentials After adjusting node potentials, there is an path with 0- reduced cost arcs in G(x) from node i to each other node (assuming that there is a path from node 1) Node potentials π j - d(j)and reduced costs Excesses and capacities

Augment along a path from node i Select a node j with e(j) < 0 that is reachable from node i. Let P be the path from node i to node j. Send min {e(i), -e(j), min {r vw : (v, w) ∈ P} } units in P Excesses and capacities Send min {10, 3, 5} units of flow from 1 to 4. Update residual capacities and excesses

Proof of finiteness and correctness Finiteness comes from the fact that the infeasibility is always integer and nonnegative, and it decreases by at least one at each iteration. The algorithm usually terminates a feasible flow (and also with dual feasibility) and is thus optimal. It can also terminate if there is no path from a node i with e(i) > 0 to any node with negative excess. In the latter case, the problem is infeasible. 21

22 Analysis of the Successive Shortest Path Algorithm Each augmentation reduces the infeasibility by at least 1. Initial infeasibility is at most mU max + nb max The time per augmentation is the time to run Dijkstra’s algorithm (or any shortest path algorithm with non-negative distances.) Running time: O( (mU max + nb max ) m log nC)

Thomas Edison invented the light bulb. The invention helped him deal with a personal (non-professional) issue. What was it? He was afraid of the dark Apollo 11 did not have much fuel when it landed back on earth. How much fuel remained? About 20 seconds worth. How long does it take all of the stars of the Milky Way galaxy to revolve around the center of the galaxy? Around 200 million years. Mental Break 23

A neutron star is so dense that it can quickly spin on its axis an entire revolution without tearing itself apart. How fast? It can spin in 1/30 th of a second. A full moon is brighter than a half moon. How much brighter? 9 times as bright. In , MIT students developed the first interactive computer game. What was it called? Spacewar. Mental Break 24

25 The Capacity Scaling Algorithm u A polynomial time variant of the successive shortest path algorithm. u Relies on the generic scaling approach. u Send flow from a node i with e(i) ≥ Δ/2. u Send flow along paths with capacity ≥ Δ/2.

Δ-optimality A pseudoflow x and node potentials π are called Δ-optimal if 1. e(j) < Δ for all j 2. ∀ (i, j), if c π ij < 0, then r ij < Δ 26 Suppose Δ = 64. Which of the following are permitted if the pseudoflow is Δ-optimal? i e(i) = 64 j e(j) = -128 ij r ij = 63 c π ij = ij r ij = 64 c π ij = -1 not permitted permitted not permitted

The Capacity Scaling Algorithm 27 Capacity Scaling Algorithm let x, π be an initial dual feasible pseudo-flow and node potentials let e* = 1 + max {e(i) : i ∈ N }; Δ := 2 K, where K = log e* while Δ > 1 do y := ImproveApprox(x, Δ) x := y Δ := Δ/2 ImproveApprox(x, Δ) converts a Δ-optimal pseudo-flow into a Δ/2 optimal pseudo-flow.

Initializing ImproveApprox For any arc (i, j) with c π ij < 0 and r ij ≥ Δ/2, send r ij units of flow in (i, j). 28 i j r ij = 63 c π ij = Δ = 64 e(i) = αe(j) = β Δ = 32 i j r ji = 63 c π ji = 6300 e(i) = α-63e(j) = β+63 After this operation, if c π vw < 0, then r vw < Δ/2 for all (v, w) ∈ G(x).

29 ImproveApprox(x, Δ) for any arc (i, j) with c π ij < 0 and r ij ≥ Δ/2, send r ij units of flow in (i, j); update r and e( ); while there is a node i with e(i) ≥ Δ/2 do let G(x, Δ/2) = { (i, j) with r ij ≥ Δ/2}; select a node i with e(i) ≥ Δ/2; let d(j) = min cost of a path from i to j in G(x, Δ/2); replace π by π - d( ) augment along an augmenting path from i to some node j with e(j) < 0 (assume that the path exists). update the residual network and excesses;

An augmentation when Δ = e(1) ≥ 32 e(4) < 0 r 12 ≥ 32 r 23 ≥ 32 r 34 ≥ 32 c π 12 = 0 c π 23 = 0 c π 34 = After an augmentation from i to j, either the infeasibility decreases by at least Δ/2, or e(j) ≥ 0.

Number of Augmentations ∑ e(i) < nΔ at the beginning of the Δ-scaling phase 31 Recall that we send r ij units of flow in arcs with negative reduce costs. Each saturating push increases e(j) by at most Δ – 1. j e(j) = β+63 Δ = 64 ∑ e(i) < nΔ + mΔ after the saturating pushes at the beginning of the Δ-scaling phase. Each augmentation (i) eliminates a node with deficit or (ii) reduces ∑ e(i) by at least Δ/2 (i) occurs fewer than n times (ii) occurs fewer than 2m + 2n times.

Running time analysis The number of augmentations per scaling phase is O(m). The number of scaling phases is O(log M), where M < m u ma x + n b max. The running time per augmentation is the time to solve a single shortest path problem using Dijkstra’s algorithm. The total running time is O((m log M)(m + n log nC)). 32

33 Summary The successive shortest path algorithm. Maintains dual feasibility and moves towards a feasible flow. Capacity scaling algorithm: a scaling variant of the successive shortest path problem. The capacity scaling algorithm was the first polynomial time algorithm for the min cost flow problem. Edmonds-Karp 1972.

34 Some Final Remarks The number of augmentations can be reduced from O(m log M) to O(m log n) Orlin The algorithm is slightly different, and the analysis is more complex. Next lectures: Network flow applications and LP, and Network simplex algorithm.

MITOpenCourseWare J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit: