Systems Analysis in Construction

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

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

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

Review Solutions, Exam 2, Operations Research

Simplex Algorithm Using Canonical Tableaus

Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Linear Programming, Lecture 4

Summary of the simplex method

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

February 17, Simplex Method Continued

OPERATIONS RESEARCH. Linear Programming Problem

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

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

Week_4: simplex method II

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

AM 121: Intro to Optimization

Special cases of linear programming

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

Lesson 27 Linear Programming; The Simplex Method

CPS 616 ITERATIVE IMPROVEMENTS 10-1

The Simplex Method. Formulate Constrained Maximization or Minimization Problem. Convert to Standard Form. Convert to Canonical Form

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

OPRE 6201 : 3. Special Cases

MATH2070 Optimisation

MATH 445/545 Test 1 Spring 2016

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

The Simplex Method. Standard form (max) z c T x = 0 such that Ax = b.

Part 1. The Review of Linear Programming

IE 400: Principles of Engineering Management. Simplex Method Continued

ORF 307: Lecture 2. Linear Programming: Chapter 2 Simplex Methods

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS

3 The Simplex Method. 3.1 Basic Solutions

9.1 Linear Programs in canonical form

Understanding the Simplex algorithm. Standard Optimization Problems.

AM 121: Intro to Optimization Models and Methods

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

Lecture 11: Post-Optimal Analysis. September 23, 2009

Non-Standard Constraints. Setting up Phase 1 Phase 2

AM 121: Intro to Optimization Models and Methods Fall 2018

Lecture 5. x 1,x 2,x 3 0 (1)

The Big M Method. Modify the LP

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

Linear programs Optimization Geoff Gordon Ryan Tibshirani

In Chapters 3 and 4 we introduced linear programming

Simplex Method for LP (II)

LINEAR PROGRAMMING 2. In many business and policy making situations the following type of problem is encountered:

Lecture 11 Linear programming : The Revised Simplex Method

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

Summary of the simplex method

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

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Linear Programming and the Simplex method

Introduction to the Simplex Algorithm Active Learning Module 3

UNIT-4 Chapter6 Linear Programming

The Primal-Dual Algorithm P&S Chapter 5 Last Revised October 30, 2006

Slide 1 Math 1520, Lecture 10

TIM 206 Lecture 3: The Simplex Method

1 Review Session. 1.1 Lecture 2

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

Math Models of OR: Some Definitions

Sensitivity Analysis

Lecture 2: The Simplex method

Introduction to Mathematical Programming

The augmented form of this LP is the following linear system of equations:


Chap6 Duality Theory and Sensitivity Analysis

Simplex tableau CE 377K. April 2, 2015

4. Duality and Sensitivity

Part 1. The Review of Linear Programming

maxz = 3x 1 +4x 2 2x 1 +x 2 6 2x 1 +3x 2 9 x 1,x 2

Example. 1 Rows 1,..., m of the simplex tableau remain lexicographically positive

IP Cut Homework from J and B Chapter 9: 14, 15, 16, 23, 24, You wish to solve the IP below with a cutting plane technique.

Optimisation and Operations Research

Week 3: Simplex Method I

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

March 13, Duality 3

Chapter 1 Linear Programming. Paragraph 5 Duality

February 22, Introduction to the Simplex Algorithm

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

Variants of Simplex Method

MATH 4211/6211 Optimization Linear Programming

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

Lecture 5 Simplex Method. September 2, 2009

M.SC. MATHEMATICS - II YEAR

Linear Programming: Chapter 5 Duality

The Simplex Algorithm

OPERATIONS RESEARCH. Michał Kulej. Business Information Systems

MAT016: Optimization

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur

3. Duality: What is duality? Why does it matter? Sensitivity through duality.

1 Simplex and Matrices

F 1 F 2 Daily Requirement Cost N N N

Introduction to Mathematical Programming IE406. Lecture 10. Dr. Ted Ralphs

IE 5531: Engineering Optimization I

Chapter 3, Operations Research (OR)

4.4 The Simplex Method and the Standard Minimization Problem

Math 354 Summer 2004 Solutions to review problems for Midterm #1

The simplex algorithm

Example Problem. Linear Program (standard form) CSCI5654 (Linear Programming, Fall 2013) Lecture-7. Duality

Transcription:

Systems Analysis in Construction CB312 Construction & Building Engineering Department- AASTMT by A h m e d E l h a k e e m & M o h a m e d S a i e d

3. Linear Programming Optimization Simplex Method 135

Linear Programming: the Simplex Method 136 An Overview of the Simplex Method Standard Form Tableau Form Setting Up the Initial Simplex Tableau Improving the Solution Calculating the Next Tableau Solving a Minimization Problem Special Cases

Introduction to Simplex Method The Simplex Method: It is the general method to solve any LP (Fleet Assignment at Delta Air Lines deals with 60,000 variables and 40,000 constraints); It is an analytical method at which a set of simultaneous linear Equations is solved together; The number of variables (n) is greater that the number of equations (m), accordingly (n-m) variables should be assumed as zeros to have a solution; The variables assumed to be zeros are called Non-Basic and the ones obtained from solving the equations are called Basic; Simplex is an iterative procedure method for moving from one Basic Feasible Solution (extreme point) to another until the optimal solution is reached; 137

Introduction to Simplex Method The Simplex Method: Steps Leading to the Simplex Method Formulate Problem as LP Put In Standard Form Put In Tableau Form Execute Simplex Method 138

Simplex Method: Standard Form Convert from Inequalities to Equations ( > or < = ) + ve RHS + ve Variables, i.e., (x1, x2,. > 0) Max or Min 2x 1-3x 2-4x 3 s. t. x 1 + x 2 + x 3 30 2x 1 + x 2 + 3x 3 60 x 1 - x 2 + 2x 3 = -20 x 1 0 x 2 0 139

Simplex Method: Standard Form An LP is in standard form when: RHS of constraints are non-negative All constraints are equalities (Equations) All variables are non-negative. Putting an LP formulation into standard form involves: Use of Mathematical Modeling Transformation Adding slack variables to < constraints Subtracting surplus variables from > constraints Using substitution rules. 140

Simplex Method: Standard Form Max or Min 2x 1-3x 2-4x 3 s. t. x 1 + x 2 + x 3 30 2x 1 + x 2 + 3x 3 60 x 1 - x 2 + 2x 3 = -20 x 1 0 x 2 0 x 3?? 2-Add slack 2-Subtrack surplus 1- Multiply by -1 3- Substitution 4- Substitution 141

Simplex Method: Standard Form Max or Min 2x 1-3x 2-4x 3 s. t. x 1 + x 2 + x 3 30 2x 1 + x 2 + 3x 3 60 x 1 - x 2 + 2x 3 = -20 x 1 0 Max or Min 2x 1-3x 2-4x 3 s. t. x 1 + x 2 + x 3 + s 1 = 30 2x 1 + x 2 + 3x 3 - s 2 = 60 -x 1 + x 2-2x 3 = 20 142 x 1, s 1, s 2 > 0

Simplex Method: Standard Form Max or Min 2x 1-3x 2-4x 3 s. t. x 1 + x 2 + x 3 + s 1 = 30 2x 1 + x 2 + 3x 3 - s 2 = 60 -x 1 + x 2-2x 3 = 20 x 1, s 1, s 2 > 0 x 2 < 0, Assume x 2 = -y 2 and y 2 > 0 143 Max or Min 2x 1 + 3y 2-4x 3 s. t. x 1 - y 2 + x 3 + s 1 = 30 2x 1 - y 2 + 3x 3 - s 2 = 60 -x 1 - y 2-2x 3 = 20 x 1, y 2 s 1, s 2 > 0

Simplex Method: Standard Form Max or Min 2x 1 + 3y 2-4x 3 s. t. x 1 - y 2 + x 3 + s 1 = 30 2x 1 - y 2 + 3x 3 - s 2 = 60 -x 1 - y 2-2x 3 = 20 x 1, y 2 s 1, s 2 > 0 Assume x 3 = w 3 -y 3 w 3,y 3 > 0 Max or Min 2x 1 + 3y 2 4w 3 + 4y 3 s. t. x 1 - y 2 + w 3 - y 3 + s 1 = 30 2x 1 - y 2 + 3w 3-3y 3 - s 2 = 60 - x 1 - y 2-2w 3 + 2y 3 = 20 144 x 1, y 2, w 3, y 3, s 1, s 2 > 0

Simplex Method: Standard Form Max or Min 2x 1 + 3y 2 4w 3 + 4y 3 s. t. x 1 - y 2 + w 3 - y 3 + s 1 = 30 2x 1 - y 2 + 3w 3-3y 3 - s 2 = 60 - x 1 - y 2-2w 3 + 2y 3 = 20 x 1, y 2, w 3, y 3, s 1, s 2 > 0 145

Simplex Method: Solving Equations 3x - y + z = 9 x + y - 3z = -9 2x - y + 3z = 15 3-1 1 1 1-3 2-1 3 x y z = 9-9 15 146

Simplex Method: 3-1 1 1 1-3 2-1 3 x y z = 9-9 15 3-1 1 9 1 1-3 -9 2-1 3 15 R1 R2 R3 R2 + R3, R2 x (-3) +R1 3-1 1 9 1 1-3 -9 2-1 3 15 1 0 0 v 1 0 1 0 v 2 0 0 1 v 3 x y z = v 1 v 2 v 3 147

Simplex Method: 3-1 1 9 1 1-3 -9 2-1 3 15 1 0 0 v 1 0 1 0 v 2 0 0 1 v 3 x y z = v 1 v 2 v 3 0 1 0 v 2 1 0 0 v 1 0 0 1 v 3 x y z = v 1 v 2 v 3 Select pivot element, make it 1 and the rest in the column = 0 148

Simplex Method: 3-1 1 9 1 1-3 -9 2-1 3 15 1 0 0 v 1 0 1 0 v 2 0 0 1 v 3 3 1 2 Selected as pivot element make it 1 and the rest zeros 1 0 0 149 3 1 2 0 0 1 How?

Simplex Method: a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 b 1 R 1 b 2 R 2 b 3 R 3 Step 1 R 1 /a 11 a 12 b 1 Step 2 a 13 1 a 11 a 11 a 21 a 22 a 23 a 31 a 32 a 33 a 11 R b 2 R 2 b 3 R 3 To make a 21 = 0 (-1xa 21 ) x R* + R 2 To make a 31 = 0 (-1xa 31 ) x R* + R 3 To make a i1 = 0 (-1xa i1 ) x R* + R i 150

Simplex Method: 3-1 1 9 R 1 1 1-3 -9 R 2 2-1 3 15 R 3 1-1/3 1/3 9/3 R* =R 1 /3 1 1-3 -9 R 2 2-1 3 15 R 3 + -1 1/3-1/3-3 (-1)xR* -2 2/3-2/3-6 (-2)xR* 1-1/3 1/3 3 R* 0 4/3-10/3-12 (-1)xR* +R 2 0-1/3 7/3 9 (-2)xR* +R 3 151

Simplex Method: 1-1/3 1/3 3 R 1 0 4/3-10/3-12 R 2 0-1/3 7/3 9 R 3 1-1/3 1/3 3 R 1 0 1-5/2-9 R*=R 2 /(4/3) 0-1/3 7/3 9 R 3 + 0 1/3-5/6-3 (- -1/3)xR* 0 1/3-5/6-3 (- -1/3)xR* 1 0-1/2 0 (1/3)xR*+R 1 0 1-5/2-9 R* 0 0 3/2 6 (1/3)xR*+R 3 152

Simplex Method: 1 0-1/2 0 R 1 0 1-5/2-9 R 2 0 0 3/2 6 R 3 1 0 0 2 (1/2)R*+R 1 0 1 0 1 (5/2)R*+R 2 0 0 1 4 R*=R 3 /(3/2) + 0 0 1/2 2 (1/2)xR* 0 0 5/2 10 (5/2)xR* 3-1 1 9 1 1-3 -9 2-1 3 15 1 0 0 2 0 1 0 1 0 0 1 4 x y z = 2 1 4 153

Simplex Method: Standard Form Max or Min 2x 1 + 3y 2 4w 3 + 4y 3 s. t. x 1 - y 2 + w 3 - y 3 + s 1 = 30 2x 1 - y 2 + 3w 3-3y 3 - s 2 = 60 - x 1 - y 2-2w 3 + 2y 3 = 20 x 1, y 2, w 3, y 3, s 1, s 2 > 0 6 variables & 3 Equations 154

Simplex Method: Tableau Form 6 variables & 3 Equations x1 y2 w3 y3 s1 s2 Basis C 2 3-4 4 RHS 1-1 1-1 1 30 2-1 3-3 -1 60-1 -1-2 2 20 155

Simplex Method: Tableau Form 6 variables & 3 Equations x1 y2 w3 y3 s1 s2 Basis C 2 3-4 4 0 0 RHS 1-1 1-1 1 0 30 2-1 3-3 0-1 60-1 -1-2 2 0 0 20 z c-z 156

Simplex Method: Tableau Form The Simplex Method: It is the general method to solve any LP (Fleet Assignment at Delta Air Lines deals with 60,000 variables and 40,000 constraints); It is an analytical method at which a set of simultaneous linear Equations is solved together; The number of variables (n) is greater that the number of equations (m), accordingly (n-m) variables should be assumed as zeros to have a solution; The variables assumed to be zeros are called Non-Basic and the ones obtained from solving the equations are called Basic; Simplex is an iterative procedure method for moving from one Basic Feasible Solution (extreme point) to another until the optimal solution is reached; 157

Example 1 Max 5x 1 + 7x 2 s.t. x 1 < 6 2x 1 + 3x 2 < 19 x 1 + x 2 < 8 x 1, x 2 > 0 158

Example 1: Standard Form Max 5x 1 + 7x 2 + 0s 1 + 0s 2 + 0s 3 s. t. 1x 1 + 0x 2 + 1s 1 + 0s 2 + 0s 3 = 6 2x 1 + 3x 2 + 0s 1 + 1s 2 + 0s 3 = 19 1x 1 + 1x 2 + 0s 1 + 0s 2 + 1s 3 = 8 x 1, x 2, s 1, s 2, s 3 > 0 5 variables & 3 Equations 159 2 =(5-3) variables are Non-Basic with values = 0 and 3 variables are Basic with values > 0 (can get by solving the 3 equations)

Example 1: Max (z) 5x 1 + 7x 2 1x 1 + 1s 1 = 6 2x 1 + 3x 2 + 1s 2 = 19 1x 1 + 1x 2 + 1s 3 = 8 160 If we assumed that s 1 and s 3 = 0 then x 1 = (6-1*0) = 6 x 2 = (8-1*6-1*0) = 2 s 2 = (19-2*6-3*2) = 1 z = 5*6 +7*2 = 44 Basic-Feasible Solution

Example 1: Max (z) 5x 1 + 7x 2 1x 1 + 1s 1 = 6 2x 1 + 3x 2 + 1s 2 = 19 1x 1 + 1x 2 + 1s 3 = 8 161 If we assumed that s 1 and s 2 = 0 then x 1 = (6-1*0) = 6 x 2 = (19-1*0-2*6)/3 = 7/3 Non-Feasible s 3 = (8-1*6-1*7/3) = -1/3 < 0 Solution z = 5*6 +7*7/3 = 46.333

Example 1: Simplex is an iterative procedure method for moving from one Basic- Feasible - Solution (extreme point) to another until the optimal solution is reached. Basic-Feasible Solutions 162 Assume x 1 & x 2 = 0

Simplex Method: Tableau Form How to assume Basic-Feasible variables or determine the Non-Basic variables for an Initial Tableau 163

Simplex Method: Tableau Form The simplex tableau is a convenient means for performing the calculations required by the simplex method. A set of equations is in tableau form if for each equation: Its right hand side (RHS) is non-negative, and There is a basic variable. (A basic variable for an equation is a variable whose coefficient in the equation is +1 and whose coefficient in all other equations of the problem is 0.) 164 To generate an initial tableau form: An artificial variable must be added to each constraint that does not have a basic variable.

Example 1: Standard Form Max 5x 1 + 7x 2 + 0s 1 + 0s 2 + 0s 3 s. t. 1x 1 + 0x 2 + 1s 1 + 0s 2 + 0s 3 = 6 2x 1 + 3x 2 + 0s 1 + 1s 2 + 0s 3 = 19 1x 1 + 1x 2 + 0s 1 + 0s 2 + 1s 3 = 8 x 1, x 2, s 1, s 2, s 3 > 0 5 variables & 3 Equations 165 3 variables are Basic with values > 0 (s 1, s 2, & s 3 for the initial table) 2 variables are Non-Basic with values = 0 (Rest of variables x 1 & x 2 ).

Simplex Method: Tableau Form x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z c-z s 1, s 2, s 3 Basic & x 1, x 2 Non-Basic 166

Simplex Method: Tableau Form x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z c-z x 1 = 0 & x 2 = 0 s 1, s 2 & s 3 = 6, 19 & 8 167

Simplex Method: Initial Tableau x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 z 1 = 0 x 1 + 0 x 2 + 0 x 1 = 0 168

Simplex Method: Initial Tableau x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 169

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 The complete solution is: s 1 = 6, s 2 = 19, s 3 = 8, x 1 = 0, x 2 = 0 & Z = 0 170 Is this solution optimum? Why?

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 x 2 is assumed to be 0 (non-basic) if moved to basic (each increase in x 2 by 1 unit will affect Z by +7 units, i.e., add to Z maximization). 171 x 1 is assumed to be 0 (non-basic) if moved to basic (each increase in x 1 by 1 unit will affect Z by +5 units, i.e., add to Z maximization).

Simplex Method: Improving the Solution Pivot Element make it 1 and the reset of the column 0s x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 19/3 8/1 172 Entering Column at maximum +ve (c-z) make x 2 Basic variable Leaving Row at minimum RHS/EC make s 2 Non-Basic variable

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 s 2 0 2 3 0 1 0 19 s 3 0 1 1 0 0 1 8 z 0 0 0 0 0 0 c-z 5 7 0 0 0 173 x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 x 2 7 2/3 1 0 1/3 0 19/3 s 3 0 1 1 0 0 1 8 z c-z R* R 1 R 3

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 x 2 7 2/3 1 0 1/3 0 19/3 s 3 0 1 1 0 0 1 8 z c-z R 1 R* R 3-2/3-1 0-1/3 0-19/3-1 x R* 174 x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 x 2 7 2/3 1 0 1/3 0 19/3 s 3 0 1/3 0 0-1/3 1 5/3 z 14/3 7 0 7/3 0 44.33 c-z 1/3 0 0-7/3 0 The complete solution: s 1 = 6, s 2 = 0, s 3 = 5/3, x 1 = 0, x 2 = 19/3 & Z = 44.33-1xR*+ R 3

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 1 0 1 0 0 6 x 2 7 2/3 1 0 1/3 0 19/3 s 3 0 1/3 0 0-1/3 1 5/3 z 14/3 7 0 7/3 0 44.33 c-z 1/3 0 0-7/3 0 6/1 19/2 5 x 1 IN & s 3 OUT 175 x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 0 0 1 1-3 1 x 2 7 0 1 0 1-2 3 x 1 5 1 0 0-1 3 5 z 5 7 0 2 1 46 c-z 0 0 0-2 -1 -R* + R 1-2/3 R* + R 2 R* No more improvements then optimum solution reached

Simplex Method: Improving the Solution x 1 x 2 s 1 s 2 s 3 Basis C 5 7 0 0 0 RHS s 1 0 0 0 1 1-3 1 x 2 7 0 1 0 1-2 3 x 1 5 1 0 0-1 3 5 z 5 7 0 2 1 46 c-z 0 0 0-2 -1 The complete solution: s 1 = 1, s 2 = 0, s 3 = 0, x 1 = 5, x 2 = 3 & Z = 46 176

Simplex Method: missing basic variables Max 2x 1 + 3y 2 4w 3 + 4y 3 + 0s 1 + 0s 2 s. t. x 1 - y 2 + w 3 - y 3 + s 1 = 30 2x 1 - y 2 + 3w 3-3y 3 - s 2 = 60 - x 1 - y 2-2w 3 + 2y 3 = 20 x 1, y 2, w 3, y 3, s 1, s 2 > 0 s 1 is a basic variable for equation 1, What about equations 2 and 3? 177

Simplex Method: missing basic variables Max 2x 1 + 3y 2 4w 3 + 4y 3 + 0s 1 + 0s 2 Ma 2 Ma 3 s. t. x 1 - y 2 + w 3 - y 3 + s 1 = 30 2x 1 - y 2 + 3w 3-3y 3 - s 2 + a 2 = 60 - x 1 - y 2-2w 3 + 2y 3 + a 3 = 20 x 1, y 2, w 3, y 3, s 1, s 2, a 2, a 3 > 0 178 a 2 and a 3 are artificial variables with no meaning Penalized the objective function by subtracting M (big number) multiplied by the artificial variable, accordingly it will not affect the objective function if a = 0.

Simplex Method: Tableau Form x 1 y 2 w 3 y 3 s 1 s 2 a 2 a 3 Basis C 2 3-4 4 0 0 -M -M RHS s 1 0 1-1 1-1 1 0 0 0 30 a 2 -M 2-1 3-3 0-1 1 0 60 a 3 -M -1-1 -2 2 0 0 0 1 20 z -M 2M -M M 0 M -M -M -80M c-z M+2 3-2M M-4 4-M 0 -M 0 0 179

Simplex Method: Tableau Form x 1 y 2 w 3 y 3 s 1 s 2 a 2 a 3 Basis C 2 3-4 4 0 0 -M -M RHS s 1 0 1-1 1-1 1 0 0 0 30 a 2 -M 2-1 3-3 0-1 1 0 60 a 3 -M -1-1 -2 2 0 0 0 1 20 z -M 2M -M M 0 M -M -M -80M c-z M+2 3-2M M-4 4-M 0 -M 0 0 a 2 column can be removed in the next table as it equals 0 180

Simplex Method: Artificial Variables Example Max 50x 1 + 40x 2 s. t. 3x 1 + 5x 2 < 150 (Assembly time) 1x 2 < 20 (Ultra Portable display) 8x 1 + 5x 2 < 300 (Warehouse space) 1x 1 + 1x 2 > 25 (Minimum total production) x 1, x 2 > 0 181

Simplex Method: Artificial Variables Example Max 50x 1 + 40x 2 + 0s 1 + 0s 2 + 0s 3 + 0s 4 Ma 4 s. t. 3x 1 + 5x 2 + 1s 1 + 0s 2 + 0s 3 + 0s 4 + 0a 4 = 150 0x 1 + 1x 2 + 0s 1 + 1s 2 + 0s 3 + 0s 4 + 0a 4 = 20 8x 1 + 5x 2 + 0s 1 + 0s 2 + 1s 3 + 0s 4 + 0a 4 = 300 1x 1 + 1x 2 + 0s 1 + 0s 2 + 0s 3-1s 4 + 1a 4 = 25 x 1, x 2, s 1, s 2, s 3, s 4, a 4 > 0 182

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 a 4 Basis C 50 40 0 0 0 0 -M RHS s 1 0 3 5 1 0 0 0 0 150 s 2 0 0 1 0 1 0 0 0 20 s 3 0 8 5 0 0 1 0 0 300 a 4 -M 1 1 0 0 0-1 1 25 z -M -M 0 0 0 M -M -25M c-z 50+M 40+M 0 0 0 -M 0 183

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 a 4 Basis C 50 40 0 0 0 0 -M RHS s 1 0 3 5 1 0 0 0 0 150 150/3 s 2 0 0 1 0 1 0 0 0 20 s 3 0 8 5 0 0 1 0 0 300 a 4 -M 1 1 0 0 0-1 1 25 300/8 25/1 z -M -M 0 0 0 M -M -25M c-z 50+M 40+M 0 0 0 -M 0 184 a 4 is assumed to have a value (basic variable) however as being a leaving variable, it should be moved to non-basic variables with value of 0. But as an artificial variable (no meaning for it), there is no longer need for it.

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 Basis C 50 40 0 0 0 0 RHS s 1 0 0 2 1 0 0 3 75 s 2 0 0 1 0 1 0 0 20 s 3 0 0-3 0 0 1 8 100 x 1 50 1 1 0 0 0-1 25-3R*+R1 No change -8R*+R3 R* z 50 50 0 0 0-50 1250 c-z 0-10 0 0 0 50 The complete solution: s 1 = 75, s 2 = 20, s 3 = 100, x 1 = 25, x 2 = 0, s 4 = 0 & Z = 1250 185

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 Basis C 50 40 0 0 0 0 RHS s 1 0 0 2 1 0 0 3 75 75/3 s 2 0 0 1 0 1 0 0 20 s 3 0 0-3 0 0 1 8 100 100/8 x 1 50 1 1 0 0 0-1 25 z 50 50 0 0 0-50 1250 c-z 0-10 0 0 0 50 186

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 Basis C 50 40 0 0 0 0 RHS s 1 0 0 25/8 1 0-3/8 0 37.5 s 2 0 0 1 0 1 0 0 20 s 4 0 0-3/8 0 0 1/8 1 12.5 x 1 50 1 5/8 0 0 1/8 0 37.5-3R*+R1 No change R* R*+R4 z 50 125/4 0 0 50/8 0 1875 c-z 0 35/4 0 0-50/8 0 The complete solution: s 1 = 37.5, s 2 = 20, s 3 = 0, x 1 = 37.5, x 2 = 0, s 4 = 12.5 & Z = 1875 187

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 Basis C 50 40 0 0 0 0 RHS s 1 0 0 25/8 1 0-3/8 0 37.5 s 2 0 0 1 0 1 0 0 20 37.5*8/25 20/1 s 4 0 0-3/8 0 0 1/8 1 12.5 x 1 50 1 5/8 0 0 1/8 0 37.5 37.5*8/5 z 50 125/4 0 0 50/8 0 1875 c-z 0 35/4 0 0-50/8 0 188

Simplex Method: Artificial Variables Example x 1 x 2 s 1 s 2 s 3 s 4 Basis C 50 40 0 0 0 0 RHS x 2 40 0 1 8/25 0-3/25 0 12 s 2 0 0 0-8/25 1 3/25 0 8 s 4 0 0 0 3/25 0 2/25 1 17 x 1 50 1 0-1/5 0 1/5 0 30 R* -R*+R2 3/8R*+R3-5/8R*+R4 z 50 40 2.8 0 5.2 0 1980 c-z 0 0-2.8 0-5.2 0 The complete solution: s 1 = 0, s 2 = 8, s 3 = 0, x 1 = 30, x 2 = 12, s 4 = 17 & Z = 1980 189

Simplex Method: Minimization To solve a minimization problem multiply the objective function by (-1) and solve it as a maximization problem Min 5x 1 + 7x 2 = Max -5x 1-7x 2 After solving the problem using the Simplex procedure the values of the variable will be the same however the value of (Z) in the last table should be multiplied by (-1). 190

Simplex Method: Special Cases Infeasibility Unboundedness Alternative Optimal Solution Sensitivity Analysis 191

Simplex Method: Infeasibility Infeasibility is detected in the simplex method when an artificial variable remains positive in the final tableau. LP Formulation Final Tableau MAX 2x 1 + 6x 2 s. t. 4x 1 + 3x 2 < 12 2x 1 + x 2 > 8 x 1, x 2 > 0 x 1 x 2 s 1 s 2 a 2 Basis C 2 6 0 0 -M RHS x 1 2 1 3/4 1/4 0 0 3 a 2 -M 0-1/2-1/2-1 1 2 z 2 M/2+3/2 M/2+1/2 M -M 6-2M c-z 0 -M/2+9/2 -M/2-1/2 -M 0 192

Simplex Method: Unboundedness A linear program has an unbounded solution if all entries in an entering column are non-positive. LP Formulation Final Tableau MAX 2x 1 + 6x 2 s. t. 4x 1 + 3x 2 > 12 2x 1 + x 2 > 8 x 1, x 2 > 0 x 1 x 2 s 1 s 2 Basis C 3 4 0 0 RHS x 2 4 3 1 0-1 8 s 1 0 2 0 1-1 3 z 12 4 0-4 32 c-z -9 0 0 4 193

Simplex Method: Alternative Opt. Sol. A linear program has alternate optimal solutions if the final tableau has a c j - z j value equal to 0 for a non-basic variable. Final Tableau 194 x 1 x 2 x 3 s 1 s 2 s 3 s 4 Basis C 2 4 6 0 0 0 0 RHS s 3 0 0 0 2 4-2 1 0 8 x 2 4 0 1 2 2-1 0 0 6 x 1 2 1 0-1 1 2 0 0 4 s 4 0 0 0 1 3 2 0 1 12 z 2 4 6 10 0 0 0 32 c-z 0 0 0-10 0 0 0

Simplex Method: Alternative Opt. Sol. In the previous slide we see that the optimal solution is: x 1 = 4, x 2 = 6, x 3 = 0, s 1 = 0, s 2 = 0, s 3 = 8, s 4 = 12 and z = 32 Note that x 3 is non-basic and its c 3 - z 3 = 0. This 0 indicates that if x 3 were increased, the value of the objective function would not change. Another optimal solution can be found by choosing x 3 as the entering variable and performing one iteration of the simplex method. The new tableau on the next slide shows an alternative optimal solution is: x 1 = 7, x 2 = 0, x 3 = 3, s 1 = 0, s 2 = 0, s 3 = 2, s 4 = 9 and z = 32 195

Simplex Method: Alternative Opt. Sol. Final Tableau 196 x 1 x 2 x 3 s 1 s 2 s 3 s 4 Basis C 2 4 6 0 0 0 0 RHS s 3 0 0-1 0 2-1 1 0 2 x 3 6 0 0.5 1 1-0.5 0 0 3 x 1 2 1 0.5 0 2 1.5 0 0 7 s 4 0 0-0.5 0 2 2.5 0 1 9 z 2 4 6 10 0 0 0 32 c-z 0 0 0-10 0 0 0

Simplex Method: Summary Initial Tableau Step 1: If the problem is a minimization problem, multiply the objective function by -1. Step 2: If the problem formulation contains any constraints with negative right-hand sides, multiply each constraint by -1. Step 3: Add a slack variable to each < constraint. Step 4: Subtract a surplus variable and add an artificial variable to each > constraint. 197

Simplex Method: Summary Initial Tableau Step 5: Add an artificial variable to each = constraint. Step 6: Set each slack and surplus variable's coefficient in the objective function equal to zero. Step 7: Set each artificial variable's coefficient in the objective function equal to -M, where M is a very large number. Step 8: Each slack and artificial variable becomes one of the basic variables in the initial basic feasible solution. 198

Simplex Method: Summary Procedure Step 1: Determine Entering Variable Identify the variable with the most positive value in the c j - z j row. (The entering column is called the pivot column.) Step 2: Determine Leaving Variable For each positive number in the entering column, compute the ratio of the right-hand side values divided by these entering column values. If there are no positive values in the entering column, STOP; the problem is unbounded. Otherwise, select the variable with the minimal ratio. (The leaving row is called the pivot row.) 199

Simplex Method: Summary Procedure Step 3: Generate Next Tableau Divide the pivot row by the pivot element (the entry at the intersection of the pivot row and pivot column) to get a new row. We denote this new row as (row *). Replace each non-pivot row i with: [new row i] = [current row i] - [(a ij ) x (row *)], where a ij is the value in entering column j of row i Step 4: Calculate zj Row for New Tableau For each column j, multiply the objective function coefficients of the basic variables by the corresponding numbers in column j and sum them. 200

Simplex Method: Summary Procedure Step 5: Calculate c j - z j Row for New Tableau For each column j, subtract the z j row from the c j row. If none of the values in the c j - z j row are positive, GO TO STEP 1. If there is an artificial variable in the basis with a positive value, the problem is infeasible. STOP. Otherwise, an optimal solution has been found. The current values of the basic variables are optimal. The optimal values of the non-basic variables are all zero. If any non-basic variable's c j - z j value is 0, alternate optimal solutions might exist. STOP. 201

END of Simplex Method