Anda di halaman 1dari 12

1

Linear Programming
Part II- The Simplex Method (for LP problems in 2 variables)

Learning Outcomes
Students should be able to:
1. Solve LP problems by the simplex method (focusing on the maximization
problems)
2. Interpret the optimal simplex tableau.


I. The Simplex Method
The following diagram illustrates the procedure of the simplex method.

The Simplex Solution Procedure



Start
Optimal
Convert LP
model to
Standard Form
Test for
Optimality
Interpret
Stop
Not
Optimal
Obtain an Initial Basic Feasible Solution
Determine the
Entering Variable
Determine the
Leaving Variable
Obtain an Improved
BF Solution
Choose variable from the pivot
column (column with the MOST
NEGATI VE Z-row value)
Choose variable from the pivot row
(row with the smallest positiveRHS-
to- pivot column ratio)
Perform elementary row
operations (ERO)
Testing for Optimality
(Maximization problems):
All z-row values 0 Optimal
Testing for Optimality
(Minimization problems):
All z-row values 0 Optimal
ECS716: Operations Research
Pn Paezah Hamzah
2
Elementary row operations (ERO)
- Multiply any row by a nonzero number.
- Replace any row by the results of adding or subtracting a multiple of another
row


The Algebra of Simplex
Based on solving a system of equations.
Constraints need to be in the standard form (constraints in the form of
equalities and all variables are nonnegative).


Standard Form
General Rules for Converting a Constraint into Equalities:
Constraint of type What to do
Add a slack variable
= Add an artificial variable
Subtract a surplus variable, and add an artificial variable

where:

Slack variable = the unused amount of resource.
Surplus variable = the amount of resource used above the minimum
requirement.
Artificial variable = a variable that has no physical meaning, but acts as a tool
to help generate an initial LP solution.



The standard form of the Wyndor Glass Co. problem is as follows:

Maximize Z = 3X
1
+ 5X
2
+0S
1
+ 0S
2
+ 0S
3

subject to:
X
1
+ S
1
= 4 (Plant 1, hours)
2X
2
+ S
2
= 12 (Plant 2, hours)
3X
1
+ 2X
2
+S
3
= 18 (Plant 3, hours)

X
1
, X
2
, S
1
, S
2
, S
3
0

where
X
1
= number of batches of doors produced per week
X
2
= number of batches of windows produced per week
S
1
= unused hours in Plant 1
S
2
= unused hours in Plant 2
S
3
= unused hours in Plant 3






3
II. Notes on Basic Variables, Nonbasic Variables, Basic Feasible Solutions
(bsf), Adjacent Basic Feasible Solution (from Winston 2004, Chp. 4)

Suppose we have converted an LP with m constraints into standard form. Assuming
the standard form contains n variables X
1
,,X
n
. The standard form for such LP is
given by

Max Z= c
1
X
1
+ c
2
X
2
+ + c
n
X
n


(or min)

s.t. a
11
X
1
+ a
12
X
2
+ + a
1n
Xn = b
1


a
21
X
1
+ a
22
X
2
+ + a
2n
X
n
= b
2
(1)
.
.
.
a
m1
X
1
+ a
m2
X
2
+ + a
mn
X
n
= b
m


X
i
0 (i =1,..,n)

Let

A
(
(
(
(

=
mn
a

m2 m1
2n 22 21
1n 12 11
a a
a ... a a
a ... a a
, x
(
(
(
(

=
n
2
1
x
x
x

, and b
(
(
(
(

=
n
2
1
b
b
b



The constraint for (1) may be written as a system of linear equations Ax=b.


To facilitate discussion on the simplex method, we need to define the concept of a
basic solution to a linear system.


Basic and Nonbasic Variables

Consider a system Ax=b of m linear equations in n variables (assume nm).

Definition: Basic Solution

A basic solution to Ax=b is obtained by setting n-m variables equal to 0 and
solving for the values of the remaining m variables. This assumes that setting the
n-m variables equal to 0 yields unique values for the remaining m variables, i.e.
the columns for the remaining m variables are linearly independent.

To find a basic solution to Ax=b, we choose a set of n-m variables (the nonbasic
variables) and set each of this to 0. Then solve for the value of the remaining m
variables (the basic variables).



4

Example:
The standard form of Wyndor Glass Co. problem contains n=5 variables and m=3
constraints.

Maximize Z = 3X
1
+ 5X
2
+0S
1
+ 0S
2
+ 0S
3

subject to:
X
1
+ S
1
= 4 (2)
2X
2
+ S
2
= 12
3X
1
+ 2X
2
+S
3
= 18

X
1
, X
2
, S
1
, S
2
, S
3
0

How to get a basic solution?
Begin by choosing n-m=5-3 = 2 nonbasic variables.
Suppose we choose nonbasic variables={X
1
, X
2
}, then basic variables={ S
1
, S
2
, S
3
}.

To find all basic solutions, set all the nonbasic variables equal 0.
Thus, letting X
1
=0, X
2
=0, and replace into the above system, we get

S
1
= 4
S
2
= 12
S
3
= 18

X
1
=0, X
2
=0, S
1
= 4, S
2
= 12, S
3
= 18 is called a basic solution to (2).



Notes:
- Different choice of nonbasic variables will lead to different basic solution.
- Some sets of m variables do not yield a basic solution.
e.g. Solving X
1
+ 2X
2
+ X
3
= 1
2X
1
+ 4X
2
+ X
3
= 3

with nonbasic variables={X
3
}, and basic variables={X
1
, X
2
} will yield
no solution to the basic variables.



Feasible Solutions


Definition: Basic Feasible Solution

Any basic solution to (1) in which all variables are nonnegative is a basic feasible
solution (or bfs).


Hence, for the LP problem with constraints given by (2), the basic solution
- X
1
=0, X
2
=0, S
1
= 4, S
2
= 12, S
3
= 18 is a feasible basic solution, but
- S
1
=0, S
2
=0, X
1
= 4, X
2
= 6, S
3
= -6 is a nonfeasible basic solution (since S
3
< 0).

5
Theorem 1
The feasible region for any LP problem is a convex set. Also, if an LP has an optimal
solution, there must be an extreme point of the feasible region that is optimal.

Theorem 2
For any LP, there is a unique extreme point of the LPs feasible region corresponding
to each basic feasible solution. Also, there is at least one bfs corresponding to each
extreme point of the feasible region.

Theorem 1 tells us that in order to find the optimal solution to an LP with constraints
Ax=b, we need to only search the extreme points of the feasible region. Theorem 2
says that the extreme (corner) points of a feasible region are the basic feasible
solutions for the system Ax=b.

Accordingly, in order to find the optimal solution to an LP, we need only find the
corner point giving the best basic feasible solution (i.e. largest value in a
maximization problem, and smallest value in a minimization problem).


Definition: Adjacent Basic Feasible Solution or Corner Point Feasible (CPF)
Solution

For any LP with n decision variables two CPFs are said to be adjacent if they share
n-1 constraint boundaries. The two adjacent CPF solutions are connected by a line
segment that lies on the same shared-constraint boundaries.























Corner Point Feasible (CPF) solution

CPF Solution Adjacent CPF Solutions
(0,0) (0,6), (4,0)
(0,6) (2,6), (0,0)
(2,6) (0,6),(4,3)
(4,3) (2,6), (4,0)
(4,0) (0,0), (4,3)

(0,6)
(4,0) 6
X
1

X
2

9
2X
2
=12
X
1
=4
3X
1
+2X
2
=18
Feasible
region
(2, 6)
-
- (4,3)
(0,0)
-
- -
6
III. Solving the Wyndor Glass Co. problem by the simplex method

To better understand the simplex procedure, we will first consider the graphical
solution of an LP problem in 2 variables and then learn how to solve the same
problem by the simplex method.

Graphical solution
The LP model and graphical solution for the Wyndor Glass Co. problem (Hillier &
Lieberman, 2005, Ch. 3-4) is as follows:

X
1
= number of batches of doors produced per week
X
2
= number of batches of windows produced per week

Maximize Profit (Z) = 3X
1
+ 5X
2
($000)
subject to:
X
1
s 4 (Plant 1, hours)
2X
2
s 12 (Plant 2, hours)
3X
1
+ 2X
2
s 18 (Plant 3, hours)
X
1
, X
2
0





















Next. we will solve the Wyndor Glass Co. problem using the simplex method.












6
4 6
X
1

X
2

9
2X
2
=12
X
1
=4
3X
1
+2X
2
=18
Feasible
region
(2, 6)
-
- (4,3)
0
Zmax
=12
Corner Point Feasible (CPF) solution

CPF solution Z=3X
1
+5X
2

(0,0) 0
(0,6) 30
(2,6) 36
(4,3) 27
(4,0) 12

Optimal solution: X
1
=2, X
2
=6
Produce 2 batches of doors and 6
batches of windows.

Maximum Profit
=3(2)+5(6)=36 thousand dollars
7
Simplex Solution

Step 1: Obtain the standard form of the problem.

Maximize Z = 3X
1
+ 5X
2
+0S
1
+ 0S
2
+ 0S
3

subject to:
X
1
+ S
1
= 4 (Plant 1, hours)
2X
2
+ S
2
= 12 (Plant 2, hours)
3X
1
+ 2X
2
+S
3
= 18 (Plant 3, hours)

X
1
, X
2
, S
1
, S
2
, S
3
0


where
X
1
= number of batches of doors produced per week
X
2
= number of batches of windows produced per week
S
1
= unused hours in Plant 1
S
2
= unused hours in Plant 2
S
3
= unused hours in Plant 3


Step 2: Obtain an initial basic feasible solution. Write in a tableau form.

In performing the simplex algorithm, write the objective function

Z = c
1
X
1
+ c
2
X
2
+ + c
n
X
n


in the form

Z - c
1
X
1
- c
2
X
2
- - c
n
X
n
= 0

(The rest of the steps will be demonstrated in class by the lecturer.)




















8
The third iteration of the simplex procedure generates the following simplex tableau.


Basic X
1
X
2
S
1
S
2
S
3
RHS
S
1
0 0 1 1/3 -1/3 2
X
2
0 1 0 1/2 0 6
X
1
1 0 0 -1/3 1/3 2
Z 0 0 0 -1.5 -1 36






The optimal solution is:
X
1
=2 produce 2 batches of doors.
X
2
=6 produce 6 batches of windows.
S
1
= 2 there are 2 hours of Plant 1 time are unused;
S
2
= 0 hours in Plant 2 is fully utilized.
S
3
= 0 hours in Plant 3 is fully utilized.
Z=36 the maximum total profit is $36,000.



Exercises

1. Convert the following LP models into the standard form.

a) Max Z = 350 X
1
+ 300X
2

s.t.
X
1
+ X
2
200
9 X
1
+ 6 X
2
1566
12 X
1
+ 16 X
2
2880
X
1
, X
2
0

b) Min Z= 2 X
1
+ 3 X
2

s.t.
X
1
+ X
2
4
X
1
+ 3 X
2
20
X
1
+ X
2
= 10
X
1
, X
2
0










All Z-row coefficients are 0 for
this maximization LP, indicating
this tableau is final. The bfs is
optimal.
9
2. Shown below is a simplex tableau for a certain maximization problem.

Basis X
1
X
2
X
3
S
1
S
2
S
3
RHS
S
1
2 2/3 0 1 0 -1/3 5
S
2
1 -5/3 0 0 1 -2/3 10
X
3
0 1/3 1 0 0 1/3 5
Z 3 -1 0 0 0 1 15

i) Perform another iteration of the simplex procedure.
ii) State the solution obtained in (i). Is the solution optimal? Explain.


3. Consider the following linear program.

Maximize Revenue = 3X
1
+ 5X
2

Subject to: 4X
1
+ 3X
2
480 (resource 1)
X
1
+ 2X
2
200 (resource 2)
All variables 0

where X
1
= units of product 1, X
2
=units of product 2

The second simplex tableau of the problem is shown below.

Basic X
1
X
2
S
1
S
2
RHS
Z -0.5 0 0 2.5 500
S
1
2.5 0 1 -1.5 180
X
2
0.5 1 0 0.5 100

Obtain the optimal solution.


10

4. Consider the following product-mix problem. a, b, and c indicate the units of
products A, B, and C, respectively, to produce in the next production period. The
linear programming formulation is as follows:

Maximize profit = 15a + 18b + 16c (RM)
Subject to: 5a + 3b + 4c s 3,000; resource 1
4a + 12b + 4c s 6,000; resource 2
b s 600; resource 3
a, b, c > 0

The following is the final simplex tableau for the above problem. S
1,
S
2
and S
3

are the slack variables for resource 1, resource 2, and resource 3, respectively.
Basic a b c S
1
S
2
S
3
Quantity
c 1.333 0 1 0.333 -0.083 0 500
b -0.111 1 0 -0.111 0.111 0 333.333
S
3
0.111 0 0 0.111 -0.111 1 266.667
Z 4.333 0 0 3.333 0.667 0 14,000
i) State the optimal production level of each type of product and the
maximum total profit.
ii) Identify any resource which is not fully utilized.

11

5. (a) Bio-Green Sdn. Bhd. produces three types of water filters: type 1, type 2,
and type 3. The production cost, the selling price, and the processing time for
each type are as follows:

Type 1 Type 2 Type 3
Cost per unit RM30 RM20 RM40
Selling price per unit RM70 RM55 RM90
Production time per unit 3 hours 1 hour 2 hours

Bio-Green has a RM12,500 budget to cover the cost. The total number of
water filters to produce must not exceed 500 units. There are 600 hours of
production time available.

Formulate a linear programming problem to determine the number of each
type of water filter to produce to maximize profit if

X
1
= units of type 1 water filter S
1
= slack variable for the budget
X
2
= units of type 2 water filter S
2
= slack variable for the production total
X
3
= units of type 3 water filter S
3
= slack variable for the production time


(b) The final simplex tableau for the above problem is given below.
Basis X
1
X
2
X
3
S
1
S
2
S
3
RHS
S
1
-30 0 0 1 0 -20 500
X
2
-1 1 0 0 2 -1 400
X
3
2 0 1 0 -1 1 100
Z 25 0 0 0 20 15

i) State the optimal production level.

ii) Determine the maximum profit.

iii) How much of the budget will be used to reach the optimal solution?


6. Solve the ABC Inc. problem using the simplex method.













12
Solution:

6. ABC Inc problem

X
1
= units of Design 1 chandelier to produce; X
2
= units of Design 2 chandelier to produce

Maximize Z = 350 X
1
+ 300 X
2
(total profit, RM)
s.t. 1 X
1
+ 1 X
2
200; switches
9 X
1
+ 6 X
2
1566; labor hours
12 X
1
+ 16 X
2
2880; crystals
X
1
, X
2
0
Iteration 1

Basic
Var
X
1
X
2
S
1
S
2
S
3
RHS Ratio test
S
1
1 1 1 0 0 200 200/1=200
S
2
9 6 0 1 0 1566 1566/9=174*
S
3
12 16 0 0 1 2880 2880/12=240
Z -350 -300 0 0 0 0


Entering variable = X
1

Leaving variable = S
2


Iteration 2

Basic
Var
X
1
X
2
S
1
S
2
S
3
RHS Ratio test
S
1
0 1/3 1 -1/9 0 26 26/(1/3)=78
X
1
1 2/3 0 1/9 0 174 174/(2/3)=261
S
3
0 8 0 -4/3 1 792 792/8=99
Z 0 -66 2/3 0 38 8/9 0 60,900

Iteration 3

Basic
Var
X
1
X
2
S
1
S
2
S
3
RHS
X
2
0 1 3 -1/3 0 78
X
1
1 0 -2 1/3 0 122
S
3
0 0 -24 4/3 1 168
Z 0 0 200 16 2/3 0 66,100

The optimal solution is:
X
1
=122 produce 122 units of Design 1 chandelier.
X
2
= 78 produce 78 units of Design 2 chandelier.
S
1
= 0 the switches are fully utilized
S
2
= 0 labor hours are fully utilized.
S
3
= 168 168 pieces of crystals are left unused.
Z=66,100 the maximum total profit is RM66,100.
Smallest +ve ratio
=174
Pivot column

Anda mungkin juga menyukai