Date post: | 01-Jun-2018 |
Category: |
Documents |
Upload: | muhammad-bilal-junaid |
View: | 240 times |
Download: | 0 times |
of 14
8/9/2019 Lec 26 Simplex Method
1/32
Topic: Linear Programming & Simplex Method
Optimization Techniques Optimization Techniques
Dr. Nasir M Mirza
Email: [email protected]
8/9/2019 Lec 26 Simplex Method
2/32
• Basic linear programming (LP) problem consists of two major parts:• The objective function• A set of constraints
• For maximization problem, the objective function is generallyexpressed as
nn xc xc xc +++= Λ
2211 ZMaximize
c j= payoff of each unit of the jth activity that is undertaken
x j= magnitude of the jth activity Z = total payoff due to the total number of activities
Standard Form Linear Programming Problem
8/9/2019 Lec 26 Simplex Method
3/32
• The constraints can be represented generally as
wherea ij= amount of the ith resource that is consumed for each unit
of the jth activityb i = amount of the ith resource that is available
• The general second type of constraints specifies that all activitiesmust have a positive value . i.e,
ininiib xa xa xa ≤+++ Λ
2211
Standard Form for Linear Programming Problem
0≥i x
8/9/2019 Lec 26 Simplex Method
4/32
Problem
Problems that initially have all less than type (LE,
8/9/2019 Lec 26 Simplex Method
5/32
Starting Basic Feasible Solution
• The starting basic feasible solution is that which involves onlyLE type constraints (after making the right-hand side positive, if
necessary).• A different slack variable must be added to each LE constraint
to convert it into equality.
• We have as many slack variables as the number of constraintequations.
• If we treat these slack variables as basic variables and the
actual variables as non-basic (set to 0), then the right-handside of each constraint represents the basic solution.
• Since the right-hand sides must all be positive (a requirement of
the standard LP form), this basic solution is feasible as well.
8/9/2019 Lec 26 Simplex Method
6/32
Starting basic feasible solutionFor the example problem, introducing slack variables x 4, x5, andx6, the constraints are written in the standard LP form as follows.
2x1 + 5x 2 - x3 + x 4 = 1-2x 1 - 12x 2 + 3x 3 + x 5 = 9
-3x 1 - 8x 2 + 2x 3 + x 6 = 4
Treating the slack variables as basic and the others as non-basic,the starting basic feasible solution is
Basic: x 4 = 1, x 5 = 9, x 6 = 4 Non-basic: x 1 = x 2 = x 3 = 0
f =0
8/9/2019 Lec 26 Simplex Method
7/32
Bringing a New Variable Into the Basic Set• In order to find a new basic feasible solution, one of the
currently nonbasic variables must be made basic.• The best candidate for this purpose is the variable that
causes the largest decrease in the objective function.• The nonbasic variable that has the largest negative
coefficient in the objective function is the best choice.This makes sense because the nonbasic variables are setto zero and so the current value of the objective functionis not influenced by them.
• But if one of them is made basic, it will have a positivevalue and therefore if its coefficient is a large negativenumber, it has the greatest potential of causing a largereduction in the objective function.
8/9/2019 Lec 26 Simplex Method
8/32
• In this example, we have the following situation:Basic: x 4 = 1, x 5 = 9, x 6 = 4 ;
Nonbasic: x 1 = x 2 = x 3 = 0 ; f = 0: 5x 1 – 3x 2 – 8x 3 = 0.
• The largest negative coefficient in the f equation is that of x 3.
Thus, our next basic feasible solution should use x 3 as one ofits basic variables.
8/9/2019 Lec 26 Simplex Method
9/32
Moving an Existing Basic Variable Out of Basic Set• Since the number of basic variables is fixed by the number of
constraint equations, one of the currently basic variables must beremoved in order to make room for a new basic variable.
• The decision to remove a variable from the basic set is based onthe need to keep the solution feasible.
• A little algebra shows that we should remove the basic variablethat corresponds to the smallest ratio of the right-hand side ofconstraints and the coefficients of the new variable that is beingbrought into the basic set.
• Furthermore, if the coefficient is negative, then there is no dangerthat the associated basic variable will become negative; thus,during this process, we need to look at ratios of right-hand sidesand positive constraint coefficients.
8/9/2019 Lec 26 Simplex Method
10/32
8/9/2019 Lec 26 Simplex Method
11/32
Example on Simplex Method• In constraints 2 and 3, the coefficients of x 3 is positive and
therefore, these constraints could result in negative values ofvariables.
• From the constraint 2, we see that the new basic variable x 3must have a value less than or equal to 9/3 = 3; otherwise, thisconstraint will give a negative solution.
• Similarly, the third constraint shows that x 3 must have a valueless than or equal to 4/2 = 2. The constraint 3 is more criticaland therefore, we should make х 3 a basic variable for thisconstraint and hence remove x 6 from the basic set.
8/9/2019 Lec 26 Simplex Method
12/32
Example on Simplex Method• Now we are in a position to compute the next basic
feasible solution.• We need to solve the system of constraint equations
for the new set of basic variables.• Also, the objective function must be expressed in
terms of new non-basic variables in order to continuewith the subsequent steps of the simplex method.
• For the example problem, the constraints are currentlywritten as follows:
Constraint 1: x 4 basic: 2x 1 + 5x 2 – x 3 + x 4 = 1Constraint 2: x 5 basic: -2x 1 – 12x 2 + 3 х 3 + x 5 = 9Constraint 3: x 6 basic: -3x 1 – 8x 2 + 2x 3 + x 6 = 4
8/9/2019 Lec 26 Simplex Method
13/32
Example on Simplex Method• The new basic variable set is (x 4, x5, x3). We can achieve this
by eliminating x 3 from the first and the second constraints.
• We divide the third constraint by 2 first to make the coefficientof x 3 equal to 1.Constraint 3: x 3 basic: -(3/2)x 1 - 4 х 2 + x 3 + (1/2)x 6 = 2
• This constraint is known as the pivot row for computing thenew basic feasible solution, and is used to eliminate x 3 fromthe other constraints and the objective function.
• Variable x 3 can be eliminated from constraint 1 by adding the pivot row to the first constraint.Constraint 1: x 4 basic: (1/2)x 1 + х 2 + x 4 + (1/2)x 6 = 3
8/9/2019 Lec 26 Simplex Method
14/32
From the second constraint, variable x3 is eliminated by adding(-3) times the pivot row to it.
Constraint 2: x5
basic: (5/2)x1
+ x5 – (3/2)x
6= 3
The objective function is: f = 5x 1 - 3x 2 - 8x 3The variable х з is eliminated by adding eight times the pivotrow to it. -7x
1 – 35x
2+ 4x
6= f + 16
We now have a new basic feasible solution, as follows:Basic: x 3 = 2, x 4 = 3, x 5 = 3
Nonbasic: xi = x 2 = x 5 = 0f = -16
Considering the objective function value, this solution is better
than our starting solution.
8/9/2019 Lec 26 Simplex Method
15/32
Example on Simplex Method• The series of steps are repeated until all coefficients in the
objective function become positive.• When this happens, then bringing any of the current non-basic
variables into the basic set will increase the objective functionvalue.
• This indicates that we have reached the lowest value possible
and the current basic feasible solution represents the optimumsolution.
• The next step for the example problem is as follows:
• Constraint 1: x4 basic: (1/2)x 1 + x 2 + x 4 + (1/2)x 6 = 3• Constraint 2: x5 basic: (5/2)x 1 + x 5 – (3/2)x 6 = 3• Constraint 3: x3 basic: -(3/2)x 1 - 4x 2 + x 3 + (1/2)x 6 = 2
• Objective: -7x 1 - 35x 2 + 4x 6 = f + 16
8/9/2019 Lec 26 Simplex Method
16/32
Example on Simplex Method• Constraint 1: x4 basic: (1/2)x 1 + x 2 + x 4 + (1/2)x 6 = 3• Constraint 2: x5 basic: (5/2)x 1 + x 5 – (3/2)x 6 = 3• Constraint 3: x3 basic: -(3/2)x
1- 4x
2+ x
3+ (1/2)x
6= 2
• Objective: -7x 1 - 35x 2 + 4x 6 = f + 16• In the objective row, the variable x 2 has the largest negative
coefficient.• Thus, the next variable to be made basic is x 2.• In the constraint expressions, positive coefficient of x 2 shows
up only in the first constraint, which has x 4 as the basicvariable.• Thus, x 4 should be removed from the basic set.
• The coefficient of x 2 in the first row is already 1; thus, there isnothing that needs to be done to this equation.
8/9/2019 Lec 26 Simplex Method
17/32
Example on Simplex MethodFor eliminating x 2 from the remaining equation, now we mustuse the first equation as the pivot row (PR) as follows.Constraint 1: x
2basic: (1/2)x
1+ x
2+ x
3+ (1/2)x6 = 3 (PR)
Constraint 2: x 5 basic: (5/2)x 1 + x 5 – (3/2)x 6 = 3 (no change)
Constraint 3: x 5 basic: (1/2)x 1 + х 3 + 4x 4 + (5/2) х 6 = 14 (Added 4 x PR)
Objective: (21/2)x 1 + 35x 4 + (43/2)x 6 = f + 121 (Added 35 x PR)
Looking at the objective function row, we see that all coefficientsare positive. This means that bringing any of the current non-
basic variables into the basic set will increase the objectivefunction.
8/9/2019 Lec 26 Simplex Method
18/32
Example on Simplex MethodThus, we have reached the lowest value possible and hence, theabove basic feasible solution represents the optimum solution.
Optimum solution:
Basic: x 2 = 3, x 3 = 14, x 5 = 3Nonbasic: x
1= x
4= x
6= 0
f + 121 = 0 giving f* = -121
It is interesting to note that the total number of possiblebasic solutions for this example was Binomial [6, 3] = 20.
However, the simplex method found the optimum in only
three steps.
8/9/2019 Lec 26 Simplex Method
19/32
Simplex Tableau• A tabular form is convenient to organize the calculations involved in
the simplex method.• The tableau is essentially the augmented matrix used in the Gauss-
Jordan form for computing the solution of equations.• Thus, the rows represent coefficients of the constraint equations.• The objective function is written in the last row.• The first column indicates the basic variable associated with the
constraint in that row. Recall that this variable should appear• only in one constraint with a coefficient of 1.• The last column represents the right-hand sides of the equations.• The other columns represent coefficients of variables, usually
arranged in ascending order with the actual variables first, followedby the slack variables.
• The exact form of the simplex tableau is illustrated through thefollowing examples.
8/9/2019 Lec 26 Simplex Method
20/32
Example on Tableau for Simplex MethodMinimize: f = 5 х 1 – 3 х 2 – 8 х 3
subject to: 2x 1 + 5x 2 — х 3 ≤ 1
-2x 1 - 12 х 2 + 3 х 3 ≤ 9-3x 1 - 8 х 2 + 2 х 3 ≤ 4
xi≥
0, i = 1 , ... , 3.Introducing slack variables, the constraints are written in thestandard LP form as follows:
2x1 + 5x 2 - x3 + x 4 = 1-2x 1 - 12x 2 + 3x 3 + x 5 = 9
-3x 1 - 8x 2 + 2x 3 + x 6 = 4
8/9/2019 Lec 26 Simplex Method
21/32
Example on Tableau for Simplex Method
Basic x 1 x2 x3 x4 x5 x6 RHSx4 2 5 -1 1 0 0 1
x5 -2 -12 3 0 1 0 9x6 -3 -8 2 0 0 1 4
Obj. 5 -4 -8 0 0 0 f
The starting tableau is as follows:
2x1 + 5x 2 - x3 + x 4 = 1-2x 1 - 12x 2 + 3x 3 + x 5 = 9
-3x 1 - 8x 2 + 2x 3 + x 6 = 45x1 - 3x 2 - 8x 3 = f
8/9/2019 Lec 26 Simplex Method
22/32
Example on Tableau for Simplex Method• From the tableau, we can read the basic feasible solution
simply by setting the basis to the rhs (since the nonbasicvariables are all set to 0).
• Basic: x 4 = 1, x 5 = 9, x 6 = 4 ;• Noribasic: x 1 = x 2 = x 3 = 0.• f = 0.• We now proceed to the first iteration of the simplex method.
To bring a new variable into the basic set, we look at thelargest negative number in the objective function row.
• From the simplex tableau, we can readily identify that thecoefficient corresponding to x 3 is most negative (-8). Thus, x 3should be made basic.
8/9/2019 Lec 26 Simplex Method
23/32
Example on Tableau for Simplex Method• The variable that must be removed from the basic set
corresponds to the smallest ratio of the entries in theconstraint right-hand sides and the positive entries in thecolumn corresponding to the new variable to be made basic.
• From the simplex tableau, we see that in the columncorresponding to x 3, there are two constraint rows that have
positive coefficients. Ratios of the right-hand side and theseentries are as follows:
• Ratios: {9/3 = 3, 4/2 = 2}• The minimum ratio corresponds to the third constraint
for which x6 is the current basic variable. Thus, weshould make x6 non-basic.
8/9/2019 Lec 26 Simplex Method
24/32
Example on Tableau for Simplex Method• Next tableau will be of the following form:
Basic x 1 x2 x3 x4 x5 x6 RHS
x4 -- -- 0 1 0 -- --x5 -- -- 0 0 1 -- --x
3-- -- 1 0 0 -- --
Obj. -- -- 0 0 0 -- --That is, we need to eliminate variable хз from the first, second, and theobjective function row.Since each row represents an equation, this can be done by adding orsubtracting appropriate multiples of rows together.However, we must be careful in how we perform these steps because weneed to preserve X4 and X5 as basic variables for the first and thesecond constraints. That is, the form of columns x4 and X5 must bemaintained during these row operations.
8/9/2019 Lec 26 Simplex Method
25/32
8/9/2019 Lec 26 Simplex Method
26/32
Example on Tableau for Simplex MethodBasic x 1 x2 x3 x4 x5 x6 RHS
x4 2 5 -1 1 0 0 1
x5 -2 -12 3 0 1 0 9x6 -3 -8 2 0 0 1 4
Obj. 5 -4 -8 0 0 0 f
Basic x 1 x2 x3 x4 x5 x6 RHSx4 -- -- 0 1 0 -- --
x5 -- -- 0 0 1 -- --
x3 -3/2 -4 1 0 0 1/2 2
Obj. -- -- 0 0 0 -- --
8/9/2019 Lec 26 Simplex Method
27/32
Example on Tableau for Simplex Method• We call this modified row as pivot row (PR) and use it to eliminate X 3 from
the other rows. The computations are as follows:
Basic x 1 x2 x3 x4 x5 x6 RHS RHS
x4 1/2 1 0 1 0 1/2 33
216+f
PR + Row1
x5 5/2 0 0 0 1 -3/2 -3*PR + Row2
x3 -3/2 -4 1 0 0 1/2 PR
Obj. -7 -35 0 0 0 4 8*PR + Obj.row
Basic x 1 x2 x3 x4 x5 x6 RHSx4 2 5 -1 1 0 0 1x5 -2 -12 3 0 1 0 9
x6 -3 -8 2 0 0 1 4Obj. 5 -4 -8 0 0 0 f
8/9/2019 Lec 26 Simplex Method
28/32
Example on Tableau for Simplex Method• This completes one step of the Simplex method and we have second
basic feasible solution:• Basic: х 3 = 2, х 4 = 3 , x 5 = 3 ;• Nonbasic: x
1= x
2= x
6= 0;
• f = -16
Basic x 1 x2 x3 x4 x5 x6 RHS
x4 1/2 1 0 1 0 1/2 33
2
16+f
x5 5/2 0 0 0 1 -3/2
x3 -3/2 -4 1 0 0 1/2
Obj. -7 -35 0 0 0 4
8/9/2019 Lec 26 Simplex Method
29/32
Example on Tableau for Simplex Method• The same series of steps can now be repeated for
additional tableaus.• For the third tableau, we should make x 2 be basic (the
largest negative coefficient in the obj. row = -35).• In the column corresponding to x2, only the first row hasa positive coefficient and thus, we have no choice but tomake x4 (the current
• basic variable for the first row) as nonbasic.
Basic x 1 x2 x3 x4 x5 x6 RHS
x4 1/2 1 0 1 0 1/2 33
2
16+f
x5 5/2 0 0 0 1 -3/2
x3 -3/2 -4 1 0 0 1/2
Obj. -7 -35 0 0 0 4
8/9/2019 Lec 26 Simplex Method
30/32
Example on Tableau for Simplex Method
Basic x 1 x2 x3 x4 x5 x6 RHS
x2 -- 1 0 -- 0 -- --
----
--
x5 -- 0 0 -- 1 --x3 -- 0 1 -- 0 --
Obj. -- 0 0 -- 0 --
Basic x 1 x2 x3 x4 x5 x6 RHSx4 1/2 1 0 1 0 1/2 3
32
16+f
x5 5/2 0 0 0 1 -3/2x3 -3/2 -4 1 0 0 1/2
Obj. -7 -35 0 0 0 4
8/9/2019 Lec 26 Simplex Method
31/32
Example on Tableau for Simplex Method
Basic x 1 x2 x3 x4 x5 x6 RHSx4 1/2 1 0 1 0 1/2 3
32
16+f
x5 5/2 0 0 0 1 -3/2x3 -3/2 -4 1 0 0 1/2
Obj. -7 -35 0 0 0 4
Basic x 1 x2 x3 x4 x5 x6 RHS
x2
1/2 1 0 1 0 1/2 3
3
2
121+f
x5 5/2 0 0 0 1 -3/2
PR
Row2
4*PR + Row3x3 1/2 0 1 4 0 5/2
Obj. 21/2 0 0 35 0 43/235*PR +Obj.row
The first row already has a 1 in the x2 column; therefore, we don't need to doanything and use it as our new pivot row to eliminate х 2 from the other rows.
8/9/2019 Lec 26 Simplex Method
32/32
Example on Tableau for Simplex Method
Basic x 1 x2 x3 x4 x5 x6 RHS
x2 1/2 1 0 1 0 1/2 332
121+f
x5 5/2 0 0 0 1 -3/2x3 1/2 0 1 4 0 5/2
Obj. 21/2 0 0 35 0 43/2
This completes the second iteration of the simplex method, and we have athird basic feasible solution:
Basic: x 2 = 3, x 3 = 14, x 5 = 3
Nonbasic: x 1 = x 4= x 6 = 0 and f = -121Since all coefficients in the Obj. row are positive, we cannot reduce theobjective function any further and thus have reached the minimum.The optimum solution is
x1 = 0, x 2 = 3, x 3 = 14, x 4 = 0, x 5 = 3, x 6 = 0 and f = -121