15.082J and 6.855J and ESD.78J November 4, 2010 The Network Simplex Algorithm.

Slides:



Advertisements
Similar presentations
The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
Advertisements

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.
Transportation Problem (TP) and Assignment Problem (AP)
Introduction to Algorithms
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
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.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Trees and BFSs Page 1 The Network Simplex Method Spanning Trees and Basic Feasible Solutions.
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.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Network Simplex Method Fatme Elmoukaddem Jignesh Patel Martin Porcelli.
Spreadsheet Modeling & Decision Analysis:
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
LINEAR PROGRAMMING SIMPLEX METHOD.
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.
Special Conditions in LP Models (sambungan BAB 1)
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.
15.082J & 6.855J & ESD.78J September 23, 2010 Dijkstra’s Algorithm for the Shortest Path Problem.
Linear Programming Erasmus Mobility Program (24Apr2012) Pollack Mihály Engineering Faculty (PMMK) University of Pécs João Miranda
1 1 Slide © 2005 Thomson/South-Western Linear Programming: The Simplex Method n An Overview of the Simplex Method n Standard Form n Tableau Form n Setting.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Chapter 4 Minimum Cost Flow Problems (MCF)
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 3: Uninformed Search
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.
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science 5 th edition Cliff T. Ragsdale.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
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.
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.
The minimum cost flow problem. Solving the minimum cost flow problem.
15.082J and 6.855J and ESD.78J Network Simplex Animations.
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.
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Cycle Canceling Algorithm
School of Computing Clemson University Fall, 2012
The minimum cost flow problem
Network Simplex Animations
Lectures on Network Flows
Jonathan Kalechstain Tel Aviv University
The Network Simplex Method
James B. Orlin Presented by Tal Kaminker
Chap 3. The simplex method
Chapter 3 The Simplex Method and Sensitivity Analysis
Dijkstra’s Algorithm for the Shortest Path Problem
Dijkstra’s Algorithm for the Shortest Path Problem
Successive Shortest Path Algorithm
and 6.855J March 6, 2003 Maximum Flows 2
Flow Feasibility Problems
Network Optimization Flow Decomposition.
Network Simplex Animations
The Network Simplex Method
Introduction to Minimum Cost Flows
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 November 4, 2010 The Network Simplex Algorithm

Overview first 1/3 of the lecture Quick Review of Linear Programming: some geometry extreme points (corner points) an overview of the simplex algorithm Networks extreme points basic feasible solutions The Network Simplex Algorithm 2

3 A Two Variable Linear Program x, y ≥ 0 2x + 3y ≤ 10 x + 2y ≤ 6 y ≤ 3 x ≤ 4 z = 3x + 5y objective (1) (2) (3) (4) (5) Constraints

Graph the Constraints: 2x+ 3y ≤ 10 (1) x ≥ 0, y ≥ 0. (5) x y 2x + 3y = 10 Graphing the Feasible Region

Add the Constraint: x + 2y ≤ 6 (2) x y x + 2y = 6

Add the Constraints: x ≤ 4; y ≤ 3 x y We have now graphed the feasible region.

7 x y The geometrical method for optimizing 3x + 5y Graph points such that 3x + 5y = p for various values of p. 3x + 5y = 11 Choose p maximal 3x + 5y = 8 Isocost lines

8 x y Find the maximum value p such that there is a feasible solution with 3x + 5y = p. Move the line with profit p parallel as much as possible. 3x + 5y = 8 3x + 5y = 11 3x + 5y = 16 The optimal solution occurs at an extreme point.

9 Extreme Points (Corner Points) An extreme point (also called n corner point) of the feasible region is a point that is not the midpoint of two other points of the feasible region. Where are the extreme points of this feasible region?

10 The Simplex Method x y Start at any feasible extreme point. Move along an edge (or extreme ray) in which the objective value is continually improving. Stop at the next extreme point. (If moving along an extreme ray, the objective value is unbounded.) Continue until no adjacent extreme point has a better objective value. Max z = 3 x + 5 y 3 x + 5 y = 19

Comments about the simplex algorithm Each step is called a pivot. Pivots are carried out using linear algebra Pivots for network flow problems can be carried out directly by changing flows in arcs. Typically, the simplex method finds the optimal solution after a “small” number of pivots (but can be exponential in the worst case). The simplex algorithm is VERY efficient in practice. 11

Back to networks We will work with the arcs of the original network (not the residual network) We will soon describe extreme flows. Connection between spanning tree flows and extreme flows. 12

Networks: sending flow around a cycle C Assume that cycles are oriented in a direction. The forward arcs of the cycle are the arcs in the same orientation. The backward arcs are in the opposite direction. A flow of 1 unit around C refers to a flow of 1 unit in the forward arcs and a flow of -1 units in the arcs in the backward arcs. Arcs (1,2) and (4, 1) are forward arcs. Arcs (3, 2) and (4, 3) are backward arcs. +1

What is an extreme point solution of a network flow problem? 14 Let x be a feasible flow for a minimum cost flow problem. An arc (i, j) is called free if 0 < x ij < u ij. One can increase or decrease the flow in a free arc by a small amount and still satisfy bound constraints. Theorem. A feasible flow x is an extreme point solution if and only if there is no (undirected) cycle of free arcs. Proof. Suppose that C is a free cycle. We will show that x is not extreme C Let y C be a flow of 1 unit around C. x” = x – ε y C is feasible. x is the midpoint of x’ and x”. Since all arcs of C are free wrt x, there is some ε > 0 so that x’ = x + ε y C is a feasible flow and so that

Proof continued 15 Suppose that x is not an extreme point. Suppose that x = (x’ + x”)/2 and for feasible flows x’ and x”. We will show that there is a free cycle. Consider arc (i, j). x ij = (x’ ij + x” ij )/2. if x ij = 0 then x’ ij = x” ij = 0 (Otherwise x’ ij < 0 or x” ij < 0). If x ij = u ij then x’ ij = x” ij = u ij (Otherwise x’ ij > u ij or x” ij > u ij ) C So, x differs from x’ and x” on free arcs. x’ – x is a circulation, and so it is expressible as the sum of flows around cycles. It follows that there is a cycle of free arcs.

Basic feasible solutions 16 A basis structure consists of a spanning tree T, a set L of arcs, and a set U of arcs, such that T ∪ L ∪ U = A. For each (i,j) ∈ L, x ij = 0. For each (i,j) ∈ U, x ij = u ij. The arc flows in T are selected so that each node satisfies its supply/demand constraint. The basis structure is feasible if the arc flows also satisfy the upper and lower bounds. (Not all basis structures are feasible.) The feasible flow is called basic.

17 Calculating A Spanning Tree Flow A tree with supplies and demands. (Assume that all other arcs have a flow of 0) What is the flow in arc (4,3)? See the animation: slide 2

18 What would happen if the flows in non- tree arcs were not 0? Suppose that non- tree arcs had a non- zero flow. How would this change the computations? 2 1 3

19 What would happen if the flows in non- tree arcs were not 0? Adjust the supplies/demands. They will be interpreted as excesses and deficits The compute flows as in the previous method; e.g., what is the flow in (4,3)?

20 What would happen if the flow were negative? If the direction of (4,3) were reversed, the flow in (3,4) would be negative A spanning tree flow is guaranteed to satisfy the supply/demand constraints. It may violate an upper or lower bound. A spanning tree flow is called feasible if it satisfies its upper and lower bound. Otherwise, it is infeasible.

21 Another way of calculating flows in arcs The total supply in subset S = (3,4,5) of nodes is 6. How can one satisfy the supply/demand constraints for S? Case 1. If (i, j) is not in the tree, then x ij = 0.

22 Another way of calculating flows in arcs Deleting an arc (i,j) of T splits the nodes into two subsets, S and N-S. To compute the flow in (i,j), compute ∑ j ∈ S b(j).

23 Another way of calculating flows in arcs, general case Deleting an arc (i,j) of T splits the nodes into two subsets, S and N-S ∑ j ∈ S b(j) - f(S, N-S). To compute the flow in (i, j), compute Let f(S, N-S) denote the flow across the cutset (S, N-S) from the non-tree arcs. Case 2. If (i,j) is not in the tree, then x ij = 0 or u ij

Simplex Multipliers Simplex multipliers for the network simplex algorithm are a special case of node potentials. They are selected so that the reduced costs of every tree arc is 0. In the simplex algorithm for linear programs, basic variables have a reduced cost of 0. 24

25 Calculating Simplex Multipliers for a Spanning Tree What is the node potential for node 2? To calculate node potentials, 1. Let π 1 = 0; 2. Choose other multipliers so that for each arc (i,j) in the tree c ij - π i + π j = 0. 0 See the animation page 9.

26 An alternative approach for calculating simplex multipliers What is the simplex multiplier for node 4? Let π i be the cost of the path from node i to node 1 (the root node) in T. If (j,k) is backward, then use cost -c jk. 0 What is the simplex multiplier for node 6?

How tall is a baby giraffe at birth? Around 6 feet In 1859, 24 rabbits were released in Australia. How many were there 6 years later? More than 2 million. The female American oyster lays lots of eggs per year even though only one of the bunch reaches maturity. Approximately how many eggs does the oyster lay? About 500 million Mental Break 27

Human beings typically mate face-to-face. How many other kinds of land animals mate face-to-face. One other: the 2-toed sloth. Humans have around 600 muscles. How many muscles do caterpillars have? Around 6000 What do bats do upon exiting a cave? They turn left. Mental Break 28

29 Optimality Conditions (again) Optimality Conditions for Spanning Tree Solutions: The following are conditions under which x is an optimal solution for the minimum cost flow problem and  is optimal for the dual problem: 1. The basic flow x is feasible 2.  is the vector of simplex multipliers. 3. For each non-tree arc (i, j) a. if c  ij > 0, then x ij = 0 b. if c  ij < 0, then x ij = u ij What is the flow on arc (5,6) if arc (5,6) satisfies the optimality conditions?

30 Violating Arcs (T, L, U) : a spanning tree structure. x: basic feasible flow π : simplex multipliers. c  ij reduced costs A non-tree arc is a violating arc and eligible for entering the basis if i.c  ij < 0 and x ij = 0 or ii.c  ij > 0 and x ij = u ij.

31 The Network Simplex Pivot 1. Choose a violating non-tree arc. If no such arc exists, then the solution x is optimal. 2. Add (i,j) to T creating a unique cycle C. Send a maximum flow around C while maintaining feasibility. Suppose the exiting arc is (p,q). 3. Update the multipliers so that the reduced costs of all tree arcs are 0 after the pivot. T-(p,q) partitions into two subtrees, T 1 and T 2 with the root node in T 1. Let d = |c  ij |. If i ∈ T 1, then add |c  ij | to each node v ∈ T 2. If i ∈  T 2, then subtract d from each node in T 2.

32 The Steps for the network simplex 1. Select the entering arc. Key data structure: maintain the simplex multipliers. O(1) step to determine if (i,j) is violating. 2. Determine the basic cycle C. Determine the flow around the basic cycle. Send the flow. 3. Determine the subtree T 2 obtained upon deleting the exiting arc from the current spanning tree. Update all multipliers in T 2. See page 17 of animation

On implementations The time it takes is sensitive to the data structures used to implement the algorithm. All reasonable implementations take O(n) time per pivot. Some work slightly better in practice (as described in the text.) 33

34 Some Remaining Issues How can we avoid cycling in the simplex method? (Or what do we do if the amount of flow sent around a cycle is 0). What is the worst case performance of the simplex method? What are some good heuristics to speed up performance in practice?

35 Summary 1. Network simplex is extremely fast in practice. 2. Relying on network data structures, rather than matrix algebra, causes the speedups. It leads to simple rules for selecting the entering and exiting variables. 3. A good pivot rule can dramatically reduce running time in practice.

36 Optional Material: Data Structures for the Network Simplex Algorithm 1. Hang the tree from a root node. 2. For each node, store pred(i), the parent of i in the tree. 3. For each node i store the depth(i), the number of arcs on the path from i to the root. 4. For each node i, store a pointer to the next node on the depth first search ordering of T. This data structure is called the thread.

37 A spanning tree, as part of a spanning tree solution Node 1 is the root node. The tree “hangs” from the root node.

38 The Depth of Nodes, and Predecessors 1 Pred(2) = 5, Pred(3) = 1, etc

39 The Thread The thread is obtained by performing a depth first search of the tree. Each node points to the next one on the dfs.

40 Finding the Cycle procedure IDENTIFY CYCLE; begin set i : = k and j : = l; while i ≠ j do begin if depth(i) > depth(j) then i : = pred(i) else if depth(j) > depth(i) then j : = pred(j) else i : = pred(i) and j : = pred(j); end; set w : = i; end; Running time is O(|C|)

41 Updating the Multipliers Suppose: (i,j) is pivoted in and that (p,q) is pivoted out. Suppose that T 2 consists of node p plus the descendents of p in the tree. Use the thread to trace out T 2. Stop when depth(CurrentNode) ≤ depth(p). Running time = O( | T 2 | ). Updating the data structures. O( |C| + | T 2 | ).

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