Linear Programming and the Simplex method

Similar documents
Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

1 Review Session. 1.1 Lecture 2

OPERATIONS RESEARCH. Linear Programming Problem

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

Simplex Algorithm Using Canonical Tableaus

Dr. Maddah ENMG 500 Engineering Management I 10/21/07

Metode Kuantitatif Bisnis. Week 4 Linear Programming Simplex Method - Minimize

AM 121: Intro to Optimization

MATH2070 Optimisation

Introduction to the Simplex Algorithm Active Learning Module 3

Math Models of OR: Some Definitions

9.1 Linear Programs in canonical form

Summary of the simplex method

Math 273a: Optimization The Simplex method

21. Solve the LP given in Exercise 19 using the big-m method discussed in Exercise 20.

Systems Analysis in Construction

min 4x 1 5x 2 + 3x 3 s.t. x 1 + 2x 2 + x 3 = 10 x 1 x 2 6 x 1 + 3x 2 + x 3 14

February 17, Simplex Method Continued

Special cases of linear programming

Simplex Method for LP (II)

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

Prelude to the Simplex Algorithm. The Algebraic Approach The search for extreme point solutions.

IE 5531: Engineering Optimization I

Linear Programming, Lecture 4

LP Duality: outline. Duality theory for Linear Programming. alternatives. optimization I Idea: polyhedra

Algebraic Simplex Active Learning Module 4

TIM 206 Lecture 3: The Simplex Method

Review Solutions, Exam 2, Operations Research

Lesson 27 Linear Programming; The Simplex Method

1 Overview. 2 Extreme Points. AM 221: Advanced Optimization Spring 2016

Dual Basic Solutions. Observation 5.7. Consider LP in standard form with A 2 R m n,rank(a) =m, and dual LP:

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science

Lecture 2: The Simplex method

Ω R n is called the constraint set or feasible set. x 1

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming

Week_4: simplex method II

AM 121: Intro to Optimization Models and Methods

1. Algebraic and geometric treatments Consider an LP problem in the standard form. x 0. Solutions to the system of linear equations

The Simplex Method for Solving a Linear Program Prof. Stephen Graves

IE 400: Principles of Engineering Management. Simplex Method Continued

3 The Simplex Method. 3.1 Basic Solutions

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Chap6 Duality Theory and Sensitivity Analysis

The Simplex Algorithm

Lecture 6 Simplex method for linear programming

CO 602/CM 740: Fundamentals of Optimization Problem Set 4

Lecture 2: The Simplex method. 1. Repetition of the geometrical simplex method. 2. Linear programming problems on standard form.

3. THE SIMPLEX ALGORITHM

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Part 1. The Review of Linear Programming

CSCI 1951-G Optimization Methods in Finance Part 01: Linear Programming

MATH 445/545 Homework 2: Due March 3rd, 2016

Introduction to Operations Research

Understanding the Simplex algorithm. Standard Optimization Problems.

Chapter 4 The Simplex Algorithm Part II

Optimization methods NOPT048

UNIT-4 Chapter6 Linear Programming

"SYMMETRIC" PRIMAL-DUAL PAIR

Gauss-Jordan Elimination for Solving Linear Equations Example: 1. Solve the following equations: (3)


OPRE 6201 : 3. Special Cases

Introduce the idea of a nondegenerate tableau and its analogy with nondenegerate vertices.

Chapter 5 Linear Programming (LP)

THE UNIVERSITY OF HONG KONG DEPARTMENT OF MATHEMATICS. Operations Research I

Linear Programming. Chapter Introduction

Civil Engineering Systems Analysis Lecture XII. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics

OPERATIONS RESEARCH. Michał Kulej. Business Information Systems

IE 5531: Engineering Optimization I

CSCI5654 (Linear Programming, Fall 2013) Lecture-8. Lecture 8 Slide# 1

Chapter 1 Linear Programming. Paragraph 5 Duality

Duality in Linear Programming

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Lecture 11 Linear programming : The Revised Simplex Method

Optimization WS 13/14:, by Y. Goldstein/K. Reinert, 9. Dezember 2013, 16: Linear programming. Optimization Problems

Simplex method(s) for solving LPs in standard form

Chapter 2: Linear Programming Basics. (Bertsimas & Tsitsiklis, Chapter 1)

Ann-Brith Strömberg. Lecture 4 Linear and Integer Optimization with Applications 1/10

Lecture 10: Linear programming duality and sensitivity 0-0

Summary of the simplex method

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

ENGI 5708 Design of Civil Engineering Systems

Optimization (168) Lecture 7-8-9

Supplementary lecture notes on linear programming. We will present an algorithm to solve linear programs of the form. maximize.

Answer the following questions: Q1: Choose the correct answer ( 20 Points ):

(P ) Minimize 4x 1 + 6x 2 + 5x 3 s.t. 2x 1 3x 3 3 3x 2 2x 3 6

Chapter 4 The Simplex Algorithm Part I

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

Integer Programming. The focus of this chapter is on solution techniques for integer programming models.

2.098/6.255/ Optimization Methods Practice True/False Questions

MATHEMATICAL PROGRAMMING I

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

Linear programs Optimization Geoff Gordon Ryan Tibshirani

56:171 Operations Research Midterm Exam - October 26, 1989 Instructor: D.L. Bricker

Linear Programming Inverse Projection Theory Chapter 3

Chapter 3, Operations Research (OR)

ECE 307 Techniques for Engineering Decisions

TRANSPORTATION PROBLEMS

Part 1. The Review of Linear Programming Introduction

Transcription:

Linear Programming and the Simplex method Harald Enzinger, Michael Rath Signal Processing and Speech Communication Laboratory Jan 9, 2012 Harald Enzinger, Michael Rath Jan 9, 2012 page 1/37

Outline Introduction to Linear Programming Simplex Basics Computational Details Demonstration Dual problem of LP Harald Enzinger, Michael Rath Jan 9, 2012 page 2/37

Outline Introduction to Linear Programming Simplex Basics Computational Details Demonstration Dual problem of LP Harald Enzinger, Michael Rath Jan 9, 2012 page 3/37

Formulation of a Linear Program minimize subject to c T x Ax b Cx = d The objective function c T x is a linear function of n decision variables x 1 to x n There can be linear inequality and equality constraints The constraints define a feasible set of solutions The goal is to find a feasible solution that minimizes the objective function Harald Enzinger, Michael Rath Jan 9, 2012 page 4/37

Geometric Interpretation of a Linear Equation in 2D ( ) a T a1 x = b with a = a 2 x = ( x1 x 2 a 1 x 1 + a 2 x 2 = b x 2 = a 1 a 2 x 1 + b a 2 ) Harald Enzinger, Michael Rath Jan 9, 2012 page 5/37

Proof of Geometric Interpretation a T x = a T (x + x ) = a T x + a T x = a x cos(0 ) + a x cos(90 ) = a x = b x = b a Harald Enzinger, Michael Rath Jan 9, 2012 page 6/37

Generalization to more Dimensions a T x = b dim x = n n = 3: Plane n > 3: Hyperplane a T x b or a T x b Halfspace that is defined by (Hyper-) Plane Harald Enzinger, Michael Rath Jan 9, 2012 page 7/37

Set of Equations a 11 a 1n x 1... a m1 a mn x n = b 1. b m Ax = b solution is an affine subspace dimension of solution space: n rank(a) Ax b Intersection of m Halfspaces Harald Enzinger, Michael Rath Jan 9, 2012 page 8/37

Visualization of a Linear Program Polyhedron represents feasible region (Hyper-) planes represent constant objective function value Objective function value is proportional to distance from origin Optimal solution lies on the surface of the polyhedron Optimal solution lies in a corner of the polyhedron Optimal solution is a global optimum Harald Enzinger, Michael Rath Jan 9, 2012 page 9/37

Special Cases of feasible region No intersection of halfspaces Optimal solution is unbounded Harald Enzinger, Michael Rath Jan 9, 2012 page 10/37

Canonical Form of a Linear Program maximize subject to c T x Ax b x 0 minimization of c T x is equal to maximization of c T x constraint a T x b is equal to constraint a T x b constraint a T x = b is equal to constraints a T x b and a T x b unbounded variable x i can be split into two bounded variables: x i unbounded x i = x i1 x i2 x i1 0 x i2 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 11/37

Transformation to Standard Form Transform inequations to equations by introducing slack variables x n+1 to x n+m a T i x b i a T i x + x n+i = b i Ax b (A I)x = b a 11 a 1n 1 0... 1. a m1 a mn 0 1 x 1. x n x n+1. x n+m = b 1. b m Harald Enzinger, Michael Rath Jan 9, 2012 page 12/37

Basic Solutions a 11 a 1n 1 0 b 1... 1.. a m1 a mn 0 1 b m A basis is a subset of m linearly independent columns Basic variables x B are variables that belong to the basis Non-basic variables x N are the remaining variables A basic solution is found by setting x B = A 1 B b and x N = 0 e.g. x T B = (x n+1 x n+m ) x T N = (x 1 x n ) x B = b x N = 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 13/37

Corners of Polyhedron Relation of Basic Solutions and Corners Every basic solution corresponds to a corner of the polyhedron. x N = 0 Solution lies in intersection of hyperplanes H j, j N x B = A 1 B b is unique Solution is unique A unique intersection of n hyperplanes must be a corner. Additional Properties A basic solution / corner is feasible if all x B 0 A basic solution / corner is degenerated if there is an x B = 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 14/37

Example for Basic Solutions and Edges n = 2 variables m = 3 constraints x 1 + x 2 4 2x 1 x 2 3 x 2 1 x 1 0 x 2 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 15/37

Example for Basic Solutions and Edges 1 1 1 0 0 4 2 1 0 1 0 3 0 1 0 0 1 1 N = {1, 2} B = {3, 4, 5} Edge is feasible and not degenerated 1 0 0 x 3 4 0 1 0 x 4 = 3 x T = (0, 0, 4, 3, 1) 0 0 1 x 5 1 Harald Enzinger, Michael Rath Jan 9, 2012 page 16/37

Example for Basic Solutions and Edges 1 1 1 0 0 4 2 1 0 1 0 3 0 1 0 0 1 1 N = {1, 3} B = {2, 4, 5} Edge is not feasible and not degenerated 1 0 0 x 2 4 1 1 0 x 4 = 3 x T = (0, 4, 0, 7, 3) 1 0 1 x 5 1 Harald Enzinger, Michael Rath Jan 9, 2012 page 17/37

Example for Basic Solutions and Edges 1 1 1 0 0 4 2 1 0 1 0 3 0 1 0 0 1 1 N = {4, 5} B = {1, 2, 3} Edge is feasible and degenerated 1 1 1 x 1 4 2 1 0 x 2 = 3 x T = (2, 1, 0, 0, 0) 0 1 0 x 3 1 Harald Enzinger, Michael Rath Jan 9, 2012 page 18/37

Outline Introduction to Linear Programming Simplex Basics Computational Details Demonstration Dual problem of LP Harald Enzinger, Michael Rath Jan 9, 2012 page 19/37

The Simplex method Basic Idea Start at corner point initial basic solution Move along edge increase one variable at a time Select variable with largest improvement of z entering variable Move to next feasible corner point select leaving variable Repeat until optimal corner point reached no more improvement of z Harald Enzinger, Michael Rath Jan 9, 2012 page 20/37

The Simplex method Basic Idea Harald Enzinger, Michael Rath Jan 9, 2012 page 21/37

The Simplex method Requirements LP in standard form: maximize subject to Convert LP to standard form a i x b i: z = c x Ax = b x 0, b 0 Introduce slack variable a i x + s i = b i Example: 6x 1 + 4x 2 24 6x 1 + 4x 2 + s 1 = 24 a i x b i: Introduce surplus variable a i x S i = b i Example: x 1 + x 2 800 x 1 + x 2 S 1 = 800 Harald Enzinger, Michael Rath Jan 9, 2012 page 22/37

The Simplex method - Computational Details Initialization Build tableau for canonical form Use slack variables as starting basic solution Basic x 1... x n s 1... s m Solution z c 1... c n 0... 0 0 z-row s 1 a 11... a 1n 1... 0 b 1 s 1 -row............. s m a m1... a mn 0... 1 b m s m -row z-row corresponds to z c 1 x 1 c 2 x 2... c n x n = 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 23/37

The Simplex method - Computational Details Optimality condition Choose variable to enter the basic solution Take the one with the most negative coefficient in objective equation (z-row) If there is none with negative coefficient, optimality has been reached Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution z 5 4 0 0 0 0 0 z-row s 1 6 4 1 0 0 0 24 s 1 -row s 2 1 2 0 1 0 0 6 s 2 -row s 3 1 1 0 0 1 0 1 s 3 -row s 4 0 1 0 0 0 1 2 s 4 -row Harald Enzinger, Michael Rath Jan 9, 2012 page 24/37

The Simplex method - Computational Details Feasibility condition Choose variable to leave the basic solution Take the one with the minimum non-negative ratio Ratios of {solution/entering variable coefficient} correspond to intercerpts of constraints with entering variable Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution Ratio z 5 4 0 0 0 0 0 24 s 1 6 4 1 0 0 0 24 6 = 4 6 s 2 1 2 0 1 0 0 6 1 = 6 s 3 1 1 0 0 1 0 1 < 0 s 4 0 1 0 0 0 1 2 Harald Enzinger, Michael Rath Jan 9, 2012 page 25/37

The Simplex method - Computational Details Swapping Entering and Leaving Variable Replace leaving var. in basic solution with entering var. Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution z 5 4 0 0 0 0 0 s 1 6 4 1 0 0 0 24 s 1 -row s 2 1 2 0 1 0 0 6 s 2 -row s 3 1 1 0 0 1 0 1 s 3 -row s 4 0 1 0 0 0 1 2 s 4 -row Harald Enzinger, Michael Rath Jan 9, 2012 page 26/37

The Simplex method - Computational Details Swapping Entering and Leaving Variable New pivot row = Current pivot row / Pivot element Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution z 5 4 0 0 0 0 0 x 1 6 4 1 0 0 0 24 x 1 -row s 2 1 2 0 1 0 0 6 s 2 -row s 3 1 1 0 0 1 0 1 s 3 -row s 4 0 1 0 0 0 1 2 s 4 -row Harald Enzinger, Michael Rath Jan 9, 2012 page 26/37

The Simplex method - Computational Details Swapping Entering and Leaving Variable New row = (Current row) - (its pivot col.coeff.) (New pivot row) Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution z 5 4 0 0 0 0 0 x 1 1 2 3 1 6 0 0 0 4 x 1 -row s 2 1 2 0 1 0 0 6 s 2 -row s 3 1 1 0 0 1 0 1 s 3 -row s 4 0 1 0 0 0 1 2 s 4 -row Harald Enzinger, Michael Rath Jan 9, 2012 page 26/37

The Simplex method - Computational Details Swapping Entering and Leaving Variable Solution of iteration Basic x 1 x 2 s 1 s 2 s 3 s 4 Solution 5 z 0 2 3 6 0 0 0 20 2 1 x 1 1 3 6 0 0 0 4 x 1 -row 4 s 2 0 3 1 6 1 0 0 2 s 2 -row 5 1 s 3 0 3 6 0 1 0 5 s 3 -row s 4 0 1 0 0 0 1 2 s 4 -row Harald Enzinger, Michael Rath Jan 9, 2012 page 26/37

The Simplex method - Computational Details Getting initial basic feasible solution (BFS) For canonical form one can take slack variables for initial BFS (=) Constraints a i x = b i: Introduce artificial variable a i x + R i = b i ( ) Constraints a i x b i: Introduce surplus and artificial variable a i x S i + R i = b i Dealing with artificial variables Eliminate artificial variables using standard simplex to get BFS M-method or Two-phase Method Harald Enzinger, Michael Rath Jan 9, 2012 page 27/37

The Simplex method - Computational Details M-method Introduce high penalty into objective function for artificial variables Maximize z = c x MR Choose M accordingly to guarantee drop out of artificial variables Large M can result in roundoff errors that impair accuracy Basic x 1 x 2 x 3 R 1 R 2 Solution z 4 1 0 100 100 0 R 1 3 1 0 1 0 3 R 2 4 3 1 0 1 6 Normalization Basic x 1 x 2 x 3 R 1 R 2 Solution z 696 399 100 0 0 900....... Harald Enzinger, Michael Rath Jan 9, 2012 page 28/37

The Simplex method - Computational Details Two-phase Method Solve the LP in two phases: Phase 1: Introduce new objective function to minimize the sum of artificial variables {Minimize r = i R i} {Maximize r = i R i} Phase 2: Perform usual simplex with solution obtained from Phase 1 Basic x 1 x 2 x 3 R 1 R 2 Solution r 0 0 0 1 1 0 R 1 3 1 0 1 0 3 R 2 4 3 1 0 1 6 Normalization Basic x 1 x 2 x 3 R 1 R 2 Solution r 7 4 1 0 0 9....... Harald Enzinger, Michael Rath Jan 9, 2012 page 29/37

The Simplex method - Special Cases Degeneracy Happens if tie occurs for minimum ratio in Feasibility condition At least one basic variable will be zero in next iteration Model has at least one redundant constraint (overdetermined point) Cycling if objective value doesnt improve Alternative Optima Objective function parallel to constraint All points between corner points optimal solutions Harald Enzinger, Michael Rath Jan 9, 2012 page 30/37

The Simplex method - Demonstration Solving toy example graphically minimize x 1 x 2 subject to x 1 x 2 2 x 1 x 2 5 3x 1 x 2 18 3x 1 + x 2 27 x 1 + 5x 2 25 x 1 + x 2 3 4x 1 + x 2 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 31/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Harald Enzinger, Michael Rath Jan 9, 2012 page 32/37

Outline Introduction to Linear Programming Simplex Basics Computational Details Demonstration Dual problem of LP Harald Enzinger, Michael Rath Jan 9, 2012 page 33/37

Dual of LP Definition Dual of LP defined from primal (original) LP model Optimal solution of one problem also provides solution to the other Rules to construct dual problem Define dual variable for each primal constraint Define dual constraint for each primal variable Primal constraint coefficients define left-hand side coefficients of dual constraint and its objective coefficient defines the right-hand side Objective coefficients of dual equal right-hand side of primal constraint equations Type of optimization switches (max min) Dual constraint type is determined by primal optimization type (min, max ) Harald Enzinger, Michael Rath Jan 9, 2012 page 34/37

Dual of LP Example Use rules on primal in equation form (Standard form) Primal in equation form Dual variables Minimize z = 15x 1 + 12x 2 + 0x 3 + 0x 4 subject to x 1 + 2x 2 x 3 + 0x 4 = 3 y 1 2x 1 4x 2 + 0x 3 + x 4 = 5 y 2 x 1, x 2, x 3, x 4 0 Dual Problem subject to Maximize w = 3y 1 + 5y 2 y 1 +2y 2 15 2y 1 4y 2 12 y 1 0 y 2 0 Harald Enzinger, Michael Rath Jan 9, 2012 page 35/37

References Rainer Burkard, Lecture Notes: Mathematische Optimierung, http://www.opt.math.tu-graz.ac.at/ hatzl/vorlesung/mathoptss11/opt.pdf Juncheng Wei, Lecture Notes: Linear Programming, http://www.math.cuhk.edu.hk/ wei/lp11.html H.A. Taha, Operations Research: An Introduction, Pearson Prentice Hall, 8th Edition, 2007 Harald Enzinger, Michael Rath Jan 9, 2012 page 36/37