15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.

Slides:



Advertisements
Similar presentations
Outline LP formulation of minimal cost flow problem
Advertisements

Transportation Problem (TP) and Assignment Problem (AP)
Introduction to Algorithms
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Chapter 5 Shortest Paths: Label-Correcting Algorithms
MINIMUM COST FLOWS: NETWORK SIMPLEX ALGORITHM A talk by: Lior Teller 1.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
15.082J, 6.855J, and ESD.78J Sept 16, 2010 Lecture 3. Graph Search Breadth First Search Depth First Search Intro to program verification Topological Sort.
Combinatorial Algorithms
Lectures on Network Flows
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.
Network Simplex Method Fatme Elmoukaddem Jignesh Patel Martin Porcelli.
15.082J and 6.855J and ESD.78J November 4, 2010 The Network Simplex Algorithm.
and 6.855J The Capacity Scaling Algorithm.
10/11/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 22 Network.
Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.
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.
15.082J and 6.855J and ESD.78J Lagrangian Relaxation 2 Applications Algorithms Theory.
C&O 355 Mathematical Programming Fall 2010 Lecture 18 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
The minimum cost flow problem. Simplifying assumptions Network is connected (as an undirected graph). – We can consider each connected component separately.
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.
1 Combinatorial Algorithms Local Search. A local search algorithm starts with an arbitrary feasible solution to the problem, and then check if some small,
and 6.855J Lagrangian Relaxation I never missed the opportunity to remove obstacles in the way of unity. —Mohandas Gandhi.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
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)
Chapter 3 Algorithms Complexity Analysis Search and Flow Decomposition Algorithms.
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.
Network Simplex Animations Network Simplex Animations.
15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem.
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.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
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.
1 Chapter 2 Notation and Definitions Data Structures Transformations.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
The minimum cost flow problem. Solving the minimum cost flow problem.
15.082J and 6.855J and ESD.78J Network Simplex Animations.
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
The minimum cost flow problem
Network Simplex Animations
Lectures on Network Flows
Chapter 5. Optimal Matchings
Dijkstra’s Algorithm with two levels of buckets
James B. Orlin Presented by Tal Kaminker
Introduction to Maximum Flows
Dijkstra’s Algorithm for the Shortest Path Problem
Introduction Basic formulations Applications
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
and 6.855J Flow Decomposition
Algorithms (2IL15) – Lecture 7
Successive Shortest Path Algorithm
EE5900 Advanced Embedded System For Smart Infrastructure
and 6.855J March 6, 2003 Maximum Flows 2
Network Optimization Flow Decomposition.
Reading before Lecture 13
Network Optimization Topological Ordering
Network Simplex Animations
Eulerian Cycles in directed graphs
Introduction to Minimum Cost Flows
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, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations

Eulerian Walks in Directed Graphs in O(m) time. Step 1. Create a breadth first search tree into node 1. For j not equal to 1, put the arc out of j in T last on the arc list A(j). Step 2. Create an Eulerian cycle by starting a walk at node 1 and selecting arcs in the order they appear on the arc lists. 2

Proof of Correctness Relies on the following observation and invariant: Observation: The walk will terminate at node 1. Whenever the walk visits node j for j ≠ 1, the walk has traversed one more arc entering node j than leaving node j. Invariant: If the walk has not traversed the tree arc for node j, then there is a path from node j to node 1 consisting of nontraversed tree arcs. 3 Eulerian Cycle Animation

Eulerian Cycles in undirected graphs Strategy: reduce to the directed graph problem as follows: Step 1. Use dfs to partition the arcs into disjoint cycles Step 2. Orient each arc along its directed cycle. Afterwards, for all i, the number of arcs entering node i is the same as the number of arcs leaving node i. Step 3. Run the algorithm for finding Eulerian Cycles in directed graphs 4

5 Flow Decomposition and Transformations u Flow Decomposition u Removing Lower Bounds u Removing Upper Bounds u Node splitting u Arc flows: an arc flow x is a vector x satisfying: Let b(i) = ∑ j x ij - ∑ i x ji We are not focused on upper and lower bounds on x for now.

6 Flows along Paths Usual: represent flows in terms of flows in arcs. Alternative: represent a flow as the sum of flows in paths and cycles. Two units of flow in the path P One unit of flow around the cycle C P C

7 Properties of Path Flows Let P be a directed path. Let Flow( ,P) be a flow of  units in each arc of the path P. Observation. If P is a path from s to t, then Flow( ,P) sends units of δ flow from s to t, and has conservation of flow at other nodes P Flow(2, P)

8 Property of Cycle Flows u If p is a cycle, then sending one unit of flow along p satisfies conservation of flow everywhere

9 Representations as Flows along Paths and Cycles Let P be a collection of Paths; let f(P) denote the flow in path P Let C be a collection of cycles; let f(C) denote the flow in cycle C. One can convert the path and cycle flows into an arc flow x as follows: for each arc (i,j) ∈ A x ij = ∑ P ∋ (i,j) f(P) + ∑ C ∋ (i,j) f(C)

10 Flow Decomposition x:Initial flow y:updated flow G(y):subgraph with arcs (i, j) with y ij > 0 and incident nodes f(P)Flow around path P (during the algorithm) P : paths with flow in the decomposition C :cycles with flow in the decomposition INVARIANT x ij = y ij + ∑ P ∋ (i,j) f(P) + ∑ C ∋ (i,j) f(C) Initially, x = y and f = 0. At end, y = 0, and f gives the flow decomposition.

Deficit and Excess Nodes Let x be a flow (not necessarily feasible) If the flow out of node i exceeds the flow into node i, then node i is a deficit node. Its deficit is ∑ j x ij - ∑ k x ki. If the flow out of node i is less than the flow into node i, then node i is an excess node. Its excess is -∑ j x ij + ∑ k x ki. If the flow out of node i equals the flow into node i, then node i is a balanced node. 11

Flow Decomposition Algorithm Step 0. Initialize: y := x; f := 0; P := ∅ ; C := ∅ ; Step 1. Select a deficit node j in G(y). If no deficit node exists, select a node j with an incident arc in G(y); Step 2. Carry out depth first search from j in G(y) until finding a directed cycle W in G(y) or a path W in G(y) from s to a node t with excess in G(y). Step Let Δ = capacity of W in G(y). (See next slide) 2. Add W to the decomposition with f(W) = Δ. 3. Update y (subtract flow in W) and excesses and deficits 4. If y ≠ 0, then go to Step 1 12

13 Capacities of Paths and Cycles C The capacity of C is = min arc flow on C wrt flow y. capacity = 4 The capacity of P is denoted as  (P, y) = min[ def(s), excess(t), min (x ij : (i,j) ∈ P) ]  = 2 s429t 6435 P excess = 2 deficit = 3 Flow Decomposition Animation

14 Complexity Analysis u Select initial node: O(1) per path or cycle, assuming that we maintain a set of supply nodes and a set of balanced nodes incident to a positive flow arc u Find cycle or path O(n) per path or cycle since finding the next arc in depth first search takes O(1) steps. u Update step O(n) per path or cycle

15 Complexity Analysis (continued) Lemma. The number of paths and cycles found in the flow decomposition is at most m + n – 1. Proof. In the update step for a cycle, at least one of the arcs has its capacity reduced to 0, and the arc is eliminated. In an update step for a path, either an arc is eliminated, or a deficit node has its deficit reduced to 0, or an excess node has its excess reduced to 0. (Also, there is never a situation with exactly one node whose excess or deficit is non-zero).

16 Conclusion Flow Decomposition Theorem. Any non-negative feasible flow x can be decomposed into the following: i. the sum of flows in paths directed from deficit nodes to excess nodes, plus ii. the sum of flows around directed cycles. It will always have at most n + m paths and cycles. Remark. The decomposition usually is not unique.

17 Corollary A circulation is a flow with the property that the flow in is the flow out for each node. Flow Decomposition Theorem for circulations. Any non-negative feasible flow x can be decomposed into the sum of flows around directed cycles. It will always have at most m cycles.

18 An application of Flow Decomposition Suppose the arcs with positive flow have no cycle. Then the flow can be decomposed into unit flows along paths from node 1 to node j for each j ≠ 1. Consider a feasible flow where the supply of node 1 is n-1, and the supply of every other node is -1.

19 A flow and its decomposition The decomposition of flows yields the paths: 1-2, 1-3, and There are no cycles in the decomposition.

Application to shortest paths To find a shortest path from node 1 to each other node in a network, find a minimum cost flow in which b(1) = n-1 and b(j) = -1 for j ≠ 1. The flow decomposition gives the shortest paths. 20

21 Other Applications of Flow Decomposition u Reformulations of Problems. There are network flow models that use path and cycle based formulations. Multicommodity Flows u Used in proving theorems u Can be used in developing algorithms

Abraham Lincoln never lost an election for Congress. False. He lost 8 elections in total. Abraham Lincoln’s mother died by drinking the milk of a poisoned cow. True No President has obtained a Ph.D. (except honorary) False. Woodrow Wilson had a Ph.D. Mental Break

Adolph Hitler was once Time’s “Man of the year”. True. in While performing her official duties, the Queen of England occasionally puts on a fake beard. False. But it was true of Cleopatra The idea of the atom was introduced in 1050 AD False. It was introduced in 1051 AD. Just kidding. It was introduced in 450 BC Mental Break

24 The min cost flow problem (again) The minimum cost flow problem u ij = capacity of arc (i,j). c ij = unit cost of flow sent on (i,j). x ij = amount shipped on arc (i,j) Minimize  ∑ c ij x ij ∑ j x ij - ∑ k x ki = b i for all i ∈ N. and 0 ≤ x ij ≤ u ij for all (i,j) ∈ A.

The model seems very limiting The lower bounds are 0. The supply/demand constraints must be satisfied exactly There are no constraints on the flow entering or leaving a node. We can model each of these constraints using transformations. In addition, we can transform a min cost flow problem into an equivalent problem with no upper bounds. 25

26 Eliminating Lower Bound on Arc Flows Suppose that there is a lower bound l ij on the arc flow in (i,j) Minimize ∑ c ij x ij ∑ j x ij - ∑ k x ki = b i for all i ∈ N. and l ij ≤ x ij ≤ u ij for all (i,j) ∈  A. Then let y ij = x ij - l ij. Then x ij = y ij + l ij Minimize ∑ c ij (y ij + l ij ) ∑ j (y ij + l ij ) - ∑ k (y ij + l ij ) = b i for all i ∈ N. and l ij ≤ (y ij + l ij ) ≤ u ij for all (i,j) ∈ A. Then simplify the expressions.

27 Allowing inequality constraints Minimize ∑ c ij x ij ∑ j x ij - ∑ k x ki ≤ b i for all i ∈ N. and l ij ≤ x ij ≤ u ij for all (i,j) ∈  A. Let B = ∑ i b i. For feasibility, we need B ≥ 0 Create a “dummy node” n+1, with b n+1 = -B. Add arcs (i, n+1) for i = 1 to n, with c i,n+1 = 0. Any feasible solution for the original problem can be transformed into a feasible solution for the new problem by sending excess flow to node n+1.

28 Node Splitting Suppose that we want to add the constraint that the flow into node 4 is at most 7. Flow x Flow x’ can be obtained from flow x, and vice versa Method: split node 4 into two nodes, say 4’ and 4” Arc numbers are capacities ” 4’ 7

29 Eliminating Upper Bounds on Arc Flows The minimum cost flow problem Min ∑ c ij x ij s.t. ∑ j x i - ∑ k x ki = b i for all i ∈ N. and 0 ≤ x ij ≤ u ij for all (i,j) ∈ A. Before ij x ij u ij bibi bjbj ij After ij b i -u ij u ij bjbj x ij u ij -x ij ij

30 Summary 1. Efficient implementation of finding an eulerian cycle. 2. Flow decomposition theorem 3. Transformations that can be used to incorporate constraints into minimum cost flow problems.

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