Design and Analysis of Algorithms

Slides:



Advertisements
Similar presentations
February 14, 2002 Putting Linear Programs into standard form
Advertisements

The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
Linear Programming (LP) (Chap.29)
SIMPLEX METHOD FOR LP LP Model.
Chapter 6 Linear Programming: The Simplex Method
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 8 Tuesday, 11/19/02 Linear Programming.
Dr. Sana’a Wafa Al-Sayegh
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc
Theory of Computing Lecture 14 MAS 714 Hartmut Klauck.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Computational Methods for Management and Economics Carla Gomes Module 6b Simplex Pitfalls (Textbook – Hillier and Lieberman)
The Simplex Method: Standard Maximization Problems
Operation Research Chapter 3 Simplex Method.
CS38 Introduction to Algorithms Lecture 15 May 20, CS38 Lecture 15.
5.5 Solution Possibilities
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 9 Wednesday, 11/15/06 Linear Programming.
Solving Linear Programs: The Simplex Method
Chapter 10: Iterative Improvement
Simplex Method LP problem in standard form. Canonical (slack) form : basic variables : nonbasic variables.
Optimization Linear Programming and Simplex Method
Linear Programming (LP)
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2008 Lecture 9 Tuesday, 11/18/08 Linear Programming.
LINEAR PROGRAMMING SIMPLEX METHOD.
The Simplex algorithm.
1. The Simplex Method.
OR Chapter 3. Pitfalls OR  Selection of leaving variable: a)No restriction in minimum ratio test : can increase the value of the entering.
8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation.
Simplex method (algebraic interpretation)
1 Linear programming Linear program: optimization problem, continuous variables, single, linear objective function, all constraints linear equalities or.
ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
Topic III The Simplex Method Setting up the Method Tabular Form Chapter(s): 4.
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming: The Simplex Method Chapter 5.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.
4  The Simplex Method: Standard Maximization Problems  The Simplex Method: Standard Minimization Problems  The Simplex Method: Nonstandard Problems.
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.
Chapter 4 Linear Programming: The Simplex Method
Chapter 3 Linear Programming Methods
1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
MIT and James Orlin © Chapter 3. The simplex algorithm Putting Linear Programs into standard form Introduction to Simplex Algorithm file Simplex2_AMII_05a_gr.
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
Part 3. Linear Programming 3.2 Algorithm. General Formulation Convex function Convex region.
1. 2 We studying these special cases to: 1- Present a theoretical explanation of these situations. 2- Provide a practical interpretation of what these.
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
Linear Programming: Formulations, Geometry and Simplex Method Yi Zhang January 21 th, 2010.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Linear Programming: An Algebraic Approach 4 The Simplex Method with Standard Maximization.
Simplex Method Review. Canonical Form A is m x n Theorem 7.5: If an LP has an optimal solution, then at least one such solution exists at a basic feasible.
1 Optimization Linear Programming and Simplex Method.
Approximation Algorithms based on linear programming.
The Simplex Method. and Maximize Subject to From a geometric viewpoint : CPF solutions (Corner-Point Feasible) : Corner-point infeasible solutions 0.
Linear Programming Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints. specify the.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Solving Linear Program by Simplex Method The Concept
Perturbation method, lexicographic method
Linear Programming.
Outline Simplex algorithm The initial basic feasible solution
Part 3. Linear Programming
Starting Solutions and Convergence
Chapter 8. General LP Problems
Chapter 8. General LP Problems
Chapter 10: Iterative Improvement
Chapter 8. General LP Problems
Practical Issues Finding an initial feasible solution Cycling
Chapter 2. Simplex method
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
Presentation transcript:

Design and Analysis of Algorithms Yoram Moses Lecture 7 April 22, 2010 http://www.ee.technion.ac.il/courses/046002

Linear Programming

Standard Form Maximization All constraints are ≤ inequalities All variables are non-negative Objective function Constraints Non-negativity constraints

Slack Form Maximization n+m variables and m constraints n “regular variables” and m “slack variables” All variables are non-negative All constraints, except for non-negativity, are equalities Slack variables appear only on LHS of equality constraints Each equality constraint has a single unique slack variable

Conversion to Slack Form: Example Standard LP Slack LP

Basic vs. Non-basic Variables Slack variables  basic variables Regular variables  non-basic variables B = set of basic variables, N = set of non-basic variables Ex: B = { 4,5,6 }, N = { 1,2,3 } |B| = m, |N| = n For a solution x, xB = basic part of x, xN = non-basic part of x

Short Matrix Form |B| = m, |N| = n Constraints can be indexed by members of B For a solution x, xB = basic part of x (i.e., xi for all i  B) xN = non-basic part of x (i.e., xj for all j  N)

Basic Solutions Every slack form is associated with a basic solution: All non-basics are set to 0 (i.e., xN = 0) All basics are set to corresponding free coefficients (i.e., xB = b) Ex: x1 = 0, x2 = 0, x3 = 0, x4 = 30, x5 = 24, x6 = 36

Tight Constraints & Constraint Violation Tight constraint: One in which the basic variable is forced to 0 in the basic solution The corresponding free coefficient is 0. Violated constraint: One in which the basic variable is forced to be negative in the basic solution. the corresponding free coefficient is negative.

Basic Feasible Solutions Basic Feasible Solution (BFS): A basic solution, which is feasible Easy fact: A basic solution is feasible if and only if all free coefficients are non-negative. Lemma: Every BFS corresponds to a vertex of the feasible region polytope.

Simplex Algorithm: Overview Works in iterations At each iteration: transform one slack form P into an equivalent slack form P’ Objective value of basic solution of P’ is always at least as good as that of P Stop when reaching a local optimum

Moving to an Equivalent Slack Form How to increase the objective value of the BFS? Increase from 0 the value of some non-basic variable, whose coefficient in the objective function is positive. By how much? As much as possible without violating any of the constraints. objective: 0 Can increase x1 by at most 9. Objective increases to 27.

Switching Basic with Non-basic Suppose that we increase a non-basic variable xi until some constraint j becomes tight xj, the basic variable of the constraint j, becomes 0 We can thus switch between xi and xj xi will become the basic variable of constraint j xj will become a non-basic When increasing x1 to 9, x6 becomes 0. We switch between x1 and x6.

Switching Basic with Non-basic We write x1 as a function of other non-basics and x6:

Switching Basic with Non-basic We rewrite the objective function:

Switching Basic with Non-basic We rewrite all the constraints as well, and obtain the following equivalent linear program:

Switching Basic with Non-basic The new LP is equivalent to the previous LP We just rewrote x1 in terms of other variables Basic solution: x1 = 9, x2 = 0, x3 = 0, x4 = 21, x5 = 6, x6 = 0 New objective value: 27

Example continued objective: 27 objective: 27.75 Choose x3 First constraint to become tight is constraint 3. objective: 27.75

Example continued objective: 27.75 objective: 28 Choose x2 First constraint to become tight is constraint 2. objective: 28

Example continued objective: 28 No more non-basics whose coefficient in the objective function is positive We stop and output basic solution as the optimal solution Solution: x1 = 8, x2 = 4, x3 = 0, x4 = 18, x5 = 0, x6 = 0. Value: 28.

Back to the Standard Form objective: 28 Solution: x1 = 8, x2 = 4, x3 = 0. Value: 28.

Pivoting Pivot: a single iteration of the simplex algorithm Choose a non-basic variable xi whose coefficient in the objective function is > 0 xi is called the “entering variable” If more than one exists, choose one according to some pivoting rule Find the first constraint j that will be violated when we increase the value of xi from 0 Make xi the basic variable of constraint j, and make xj a non-basic variable xj is called the “leaving variable” Write xi as a function of xj and the other non-basics Rewrite the objective function and the constraints

Pivoting: Geometric Intuition Lemma: Pivoting corresponds to moving from one vertex of the feasible region to a neighbor vertex, whose objective value is at least as good.

Unbounded Programs Sometimes it is possible to increase the value of the entering value unboundedly, without violating any constraint In this case the optimal solution of the LP is unbounded Pivot will return “unbounded”

The Simplex Algorithm find an initial BFS while there is a non-basic variable whose coefficient in the objective function is > 0 run pivot if pivot returns “unbounded” return “unbounded” return BFS of current slack form as the optimal solution Geometric view: Repeatedly move from a vertex of the feasible region to a better neighbor vertex, until a local maximum is reached. Initial BFS is found by solving an auxiliary linear program (read section in book)

Simplex Analysis: Correctness If LP is infeasible, S’x will fail to find an initial BFS If LP is unbounded, Pivot will return “unbounded” If LP has a bounded optimal solution, it has one at a vertex Simplex will reach a local maximum vertex Local maximum vertex must be a global maximum Hence, Simplex will output an optimal solution

Simplex Analysis: Running Time We have not specified the two “pivoting rules” For choosing the entering variable For choosing the leaving variable Degeneracy: objective value of BFS does not improve in an invocation of Pivot Unwise pivoting rules may lead to infinite loops (i.e., everlasting degeneracy)

Degeneracy objective: 0 entering: x1 leaving: x4

Pivoting Rules Bland’s rule: choose entering/leaving variable with smallest index. Lemma: If Simplex uses Bland’s rule, it never cycles. Conclusion: Simplex has at most iterations. Theorem [Kalai]: There is a randomized pivoting rule, with which Simplex runs for a sub-exponential number of iterations in expectation. Open problem: Is there a pivoting rule with which Simplex runs in polynomial time?

End of Lecture 8