Linear Programming
Linear Programming
Linear Programming
Linear Programming
1.1
Introduction
and
Z(x1 , x2 , . . . , xN ) b
are linear inequalities. For example, 5x1 + 4x2 3 and 2x1 + 34x2 3 are linear
inequalities, but x21 x2 3 is not a linear inequality.
1.2
General Formulation
Z = c1 x1 + c2 x2 + + cN xN
(1.1)
+
+
a12 x2
a22 x2
..
.
aM 1 x1 + aM 2 x2
+ +
+ +
a1N xN
a2N xN
..
.
+ + aM N xN
b1
b2
..
.
(1.2)
bM
and
x1 0, x2 0, . . . , xN 0
(1.3)
where aij (i = 1, 2, . . . , M ; j = 1, 2, . . . , N ) are constants (called constraint coefficients), bi (i = 1, 2, . . . , M ) are constants (called resources values), and cj (j =
1, 2, . . . , N ) are constants (called cost coefficients). We call Z the objective function.
In matrix form, the general formulation can be written as
Maximize
Z = cT x
(1.4)
(1.5)
x0
(1.6)
and
where
b=
b1
b2
..
.
bM
A=
a11
a21
..
.
aM 1
c1
c2
c= .
..
cN
a12
a22
..
.
..
.
a1N
a2N
..
.
aM 2 aM N
x1
x2
, x = ..
.
xN
1.2.1
(1.7)
0=
0
0
..
.
0
(1.8)
Terminology
1.3
Model A
6
5
5
Model B
4
5
4
Model C
5
6
4
xB 0,
200
250
xC 0
Let x1 and x2 denote the number of Grade 1 and Grade 2 inspectors assigned for
inspection. Since the number of available inspectors in each grade is limited, we have
the following constraints:
x1 8
x1 10
(Grade 1)
(Grade 2)
The company requires at least 1800 pieces to be inspected daily. Thus, we get
8(25)x1 + 8(15)x2 1800
or
200x1 + 120x2 1800
which can be also written as
5x1 + 3x2 45
To develop the objective function, we note that the company incurs two types of costs
during inspections: wages paid to the inspector, and the cost of his inspection error.
The hourly cost of each Grade 1 inspector is
$4 + 2(25)(0.02) = $5 per hour
Similarly, for each Grade 2 inspector
$3 + 2(15)(0.05) = $4.50 per hour
Thus the objective function is to minimize the daily cost of inspection given by
Z = 8(5x1 + 4.5x2 ) = 40x1 + 36x2
The complete formulation of the linear programming problem thus becomes:
M inimize :
Z = 40x1 + 36x2
8
x2 10
+ 3x2 45
x1 0,
x2 0
1.4
In the last section two examples were presented to illustrate how practical problems can be formulated mathematically as LP problems. The next step after the
formulation is to solve the problem mathematically to obtain the best possible solution. In this section, a graphical procedure to solve LP problems involving only
two variables is discussed . Though in practical such small problems are usually
not encountered, the graphical procedure is presented to illustrate some of the basic
concepts and used in solving large LP problems.
Example 1.3 A company manufactures two types of mobiles, model A and model
B. It takes 5 hours and 2 hours to manufacture A and B, respectively. The company
has 900 hours available per week for the production of mobiles. The manufacturing
cost of each model A is $8 and the manufacturing cost of a model B is $10. The
total funds available per week for production are $2800. The profit on each model
A is $3, and the profit on each model B is $2. How many of each type of mobile
should be manufactured weekly to obtain the maximum profit?
Solution. We first find the inequalities that describe the time and monetary constraints. Let the company manufacture x1 of model A and x2 of model B. Then
the total manufacturing time ie (5x1 + 2x2 ) hours. There are 900 hours available.
Therefore
5x1 + 2x2 900
Now the cost of manufacturing x1 model A at $8 each is $8x1 and the cost of manufacturing x2 model B at $10 each is $10x2 . Thus the total production costs is
(8x1 + 10x2 ). There is $2800 available for production of mobiles. Therefore
8x1 + 10x2 2800
Furthermore, x1 and x2 represent numbers of mobiles manufactured. These numbers
cannot be negative. Therefore we get two more constraints:
x1 0,
x2 0
Next we find a mathematical expression for profit. Since the weekly profit on x1
mobiles at $3 per mobile is $3x1 and the weekly profit on x2 mobiles at $2 per
mobile is $2x2 . Thus the total weekly profit is $(3x1 + 2x2 ). Let the profit function
Z is defined as
Z = 3x1 + 2x2
Thus the mathematical model for the given LP problem with the profit function and
the system of linear inequalities may be written as
Maximize
Z = 3x1 + 2x2
x2 0
In this problem, we are interested in determining the values of the variables x1 and
x2 that will satisfy all the restrictions and give the maximum value of the objective
function. As a first step in solving this problem, we want to identify all possible
values of x1 and x2 that are nonnegative and satisfy the constraints. Solution of a
linear program is merely finding the best feasible solution (optimal solution) in the
feasible region (set of all feasible solutions). In our example, an optimal solution is
a feasible solution which maximizes the objective function 3x1 + 2x2 . The value of
the objective function corresponding to an optimal solution is called optimal value
of the linear program.
To represent the feasible region in a graph, every constraint is plotted, and all values of x1 , x2 that will satisfy these constraints are identified. The nonnegativity
constraints imply that all feasible values of the two variables will be in the first quadrant. It can be shown that the graph of the constraint 5x1 + 2x2 900 consists
of points on and below the straight line 5x1 + 2x2 = 900. Similarly, the points
that satisfy the inequality 8x1 + 10x2 2800 are on and the below the straight line
8x1 + 10x2 = 2800.
The feasible region is given by the region ABCO as shown in Figure 1.1. Obviously
y
5x + 2x = 900
1
A(0, 280)
200
B(100, 200)
Feasible
Region
100
8x + 10x = 2800
1
100
x
C(180, 0)
there is an infinite number of feasible points in this region. Our objective is to identify the feasible point with largest value of objective function Z.
It has been proved that the maximum value of Z will occur at a vertex of the feasible region, namely at one of the points A, B, C, or O; if there is more than one
point at which the maximum occurs, it will be along one edge of the region, such
as AB or BC. Hence, we have only to examine the value of the objective function Z = 3x1 + 2x2 at the vertices A, B, C, and O. These vertices are found by
determining the points of intersection of the lines. We obtain
A(0, 280) :
B(100, 200) :
C(180, 0) :
O(0, 0) :
ZA
ZB
ZC
ZO
= 3(0) + 2(280)
= 3(100) + 2(200)
= 3(180) + 2(0)
= 3(0) + 2(0)
=
=
=
=
560
700
540
0
The maximum value of Z is 700 at B. Thus the maximum value of Z = 3x1 + 2x2
is 700 when x1 = 100 and x2 = 200. The interpretation of these results is that the
maximum weekly profit is $700 and this occurs when 100 model A mobles and 200
model B mobiles are manufactured.
A x <= b
Aeq x == beq
lb <= x <= ub
10
and beq = [ ].
>> [x, F val] = linprog(Z, A, b)
returns the value of the objective function at x, F val = Z x.
>> [x, F val, exitf lag] = linprog(Z, A, b)
returns a value exitflag that describes the exit condition.
>> [x, F val, exitf lag, output] = linprog(Z, A, b)
returns a structure containing information about the optimization.
Input Parameters:
Z
A
b
Aeq
beq
lb
ub
Output Parameters:
x:
F val :
exitflag :
>0
=0
<0
11
Now to reproduce the above results (the Example 1.3) using MATLAB, we do the
following:
First, enter the coefficients:
>> Z = [3 : 2];
>> A = [5 2; 8 10];
>> b = [900; 2800];
Second, evaluate linprog:
>> [x, F val, exitf lag, output] = linprog(Z, A, b);
MATLAB answer is:
optimization terminated successfully.
Now evaluate x and Z as follows:
>> x =
100.0000
200.0000
and
>> Objective = F val =
700.0000
Note that the optimization functions in the toolbox minimize the objective function.
to maximize a function Z, apply an optimization function to minimize Z. The
resulting point where the maximum of Z occurs is also the point where the minimum
of Z occurs.
Example 1.4 Find the maximum value of
Z = 2x1 + x2
subject to the constraints
3x1 + 5x2 20
4x1 + x2 15
and
x1 0,
x2 0
Solution. The constraints are represented graphically by the region ACBO in Figure 1.2. The vertices of the feasible region are found by determining the points of
12
4x1 + x2 = 15
A(0,4)
O
Feasible
Region
C(55/17,35/17)
3x + 5x = 20
1
B(15/4,0)
ZA
ZB
ZC
ZO
= 2(0) + 4
= 2(15/4) + 0
= 2(55/17) + 35/17
= 0+0
=
=
=
=
4
15/2
145/17
0
Thus the maximum value of the objective function Z is 145/17, namely when x1 =
55/17 and x2 = 35/17.
1.4.1
For cases where some or all of the constraints contain inequalities with sign reversed
( rather than ), the signs can be converted to signs by multiplying both
sides of the constraints by 1. Thus, the constraint
ai1 x1 + ai2 x2 + + aiN xN bi
is equivalent to
ai1 x1 ai2 x2 aiN xN bi
1.4.2
Equality Constraints
For cases where some or all of the constraints contain equalities, the problem can
be reformulated by expressing an equality as two inequalities with opposite signs.
13
1.4.3
bi
bi
14
+
+
a12 x2
a22 x2
..
.
+ +
+ +
a1N xN
a2N xN
..
.
aM 1 x1 + aM 2 x2 + + aM N xN
b1
b2
..
.
bM
and
x1 0, x2 0, . . . , xN 0
where aij , bi , cj (i = 1, 2, . . . , M ; j = 1, 2, . . . , N ) are constants.
Example 1.6 Consider the inspection problem given by the Example 1.2:
Minimize:
Z = 40x1 + 36x2
15
8
x2 10
+ 3x2 45
x1 0,
x2 0
In this problem, we are interested in determining the values of the variables x1 and
x2 that will satisfy all the restrictions and give the least value of the objective function. As a first step in solving this problem, we want to identify all possible values of
x1 and x2 that are nonnegative and satisfy the constraints. For example, a solution
x1 = 8 and x2 = 10 is positive and satisfies all the constraints. In our example,
an optimal solution is a feasible solution which minimizes the objective function
40x1 + 36x2 .
To represent the feasible region in a graph, every constraint is plotted, and all values of x1 , x2 that will satisfy these constraints are identified. The nonnegativity
constraints imply that all feasible values of the two variables will be in the first quadrant. The constraint 5x1 + 3x2 45 requires that any feasible solution (x1 , x2 )
to the problem should be on one side of the straight line 5x1 + 3x2 = 45. The
proper side is found by testing whether the origin satisfies the constraint or not.
The line 5x1 + 3x2 = 45 is first plotted by taking two convenient points (for example, x1 = 0, x2 = 15 and x1 = 9, x2 = 0).
Similarly, the constraints x1 8 and x2 10 are plotted. The feasible region is
given by the region ACBO as shown in Figure 1.3. Obviously there is an infinite
Z = 600
x2 = 10
10
B(8,10)
C(3,10)
3x1+5x2 = 45
Feasible
Region
x =8
1
Z = 300
A(8,5/3)
16
number of feasible points in this region. Our objective is to identify the feasible point
with lowest value of objective function Z.
Observe that the objective function, given by Z = 40x1 + 36x2 , represents a straight
line if the value of Z is fixed a priori. Changing the value of Z essentially translates
the entire line to another straight line parallel to itself. In order to determine an
optimal solution, the objective function line is drawn for a convenient value of Z
such that it passes through one or more points in the feasible region. Initially Z is
chosen as 600. By moving this line closer to the origin the value of Z is further
decreased (see Figure 1.3). The only limitation on this decrease is that the straight
line Z = 40x1 + 36x2 contains at least one point in the feasible region ABC. This
clearly occurs at the corner point A given by x1 = 8, x2 = 53 . This is the best feasible
point giving the lowest value of Z as 380. Hence, x1 = 8, x2 = 53 is an optimal
solution, and Z = 380 is the optimal value for the linear program.
Thus for the inspection problem the optimal utilization is achieved by using eight
Grade 1 inspectors and 1.67 Grade 2 inspectors. The fractional value x2 = 53 suggests that one of the Grade 2 inspectors is only utilized 67% of the time. If this
is not possible, the normal practice is to round off the fractional values to get an
optimal integer solution as x1 = 8, x2 = 2. (In general, rounding off the fractional
values will not produce an optimal integer solution.)
x2 0
Solution. The feasible region is shown in Figure 1.4. To find the minimum value
of Z over the region, let us determine the maximum value of Z. The vertices are
found, and the value of Z computed at each vertex:
A(0, 5) :
ZA = 2(0) + 3(5)
= 15
B(4, 3) :
ZB = 2(4) + 3(3)
= 1
C(11/2, 0) :
ZC = 2(11/2) + 3(0) = 11
O(0, 0) :
ZO = 2(0) + 3(0)
= 0
17
2x + x = 11
1
A(0,5)
O
B(4,3)
O
x + 2x = 10
1
2
Feasible
Region
C(11/2,0)
18
and
x1 0,
x2 0
y
5
x2 = 4
C(2,4)
D(0,4)
Feasible
Region
x1 + 2x2 = 10
x1 + 2x2 = 6
E(0,1)
x1 + 2x2 = 2
x1 + x2 = 1
B(10,0)
A(1,0)
19
Notice that each feasible region we have discussed is such that the whole of the
segment of a straight line joining two points within the region lies within that
region. Such region is called convex. A theorem states that the feasible region in
a LP problem is convex (see Figure 1.6).
p
o 2
p1
o p2
p o
1
op
Convex
p1 o
Convex
Convex
p o
2
Not Convex
Not convex
1.4.4
The general linear program problem can always to put in the following form, which
is referred to as the canonical form:
Maximize Z =
M
X
ci xi
i=1
20
j = 1, 2, . . . , N
i=1
xi 0,
i = 1, 2, . . . , M
i = 1, 2, . . . , M
1.4.5
(1.9)
+
+
a12 x2
a22 x2
..
.
aM 1 x1 + aM 2 x2
+ +
+ +
a1N xN
a2N xN
..
.
+ + aM N xN
=
=
b1
b2
..
.
(1.10)
= bM
and
x1 0, x2 0, . . . , xN
b1 0, b2 0, . . . , bM
(1.11)
21
(1.12)
Ax = b
(1.13)
a11
a21
A= .
..
(1.14)
a12 a1N
a22 a2N
(1.15)
..
..
..
.
.
.
aM 1 aM 2 aM N
b=
b1
b2
..
.
bM
c=
c1 c2 cN
x=
x1
x2
..
.
xN
(1.16)
In practice, A is called coefficient matrix, x is the decision vector, b is the requirement vector, and c is the profit (cost) vector of a LP problem.
Note that to convert a LP problem into standard form, each inequality constraint
must be replaced by an equation constraint by introducing new variables which
are slack variable or surplus variable. We illustrate this procedure using the
following problem.
Example 1.9 (Leather Limited)
Leather Limited manufactures two types of belts: the deluxe model and the regular
model. Each type requires 1 square yard of leather. A regular belt requires 1 hour
22
of skilled labor, and a deluxe belt requires 2 hours. Each week, 40 square yards of
leather and 60 hours of skilled labor are available. Each regular belt contributes $3
to profit and each deluxe belt, $4. Formulate the LP problem.
Solution. Let x1 be the number of deluxe belt and x2 be the regular belt which are
produced weekly. Then the appropriate LP problem got the form:
Maximize Z = 4x1 + 3x2
subject to the following constraints
x1 + x2 40
2x1 + x2 60
x1 0,
x2 0
To convert the above inequality constraints to equality constraints, we define for each
constraint a slack variable ui (ui = slack variable for ith constraint), which is the
amount of the resource unused in the ith constraint. Because x1 + x2 square yards
of leather being used, and 40 square yards are available, we define u1 by
u1 = 40 x1 x2
or
x1 + x2 + u1 = 40
or
2x1 + x2 + u2 = 60
Similarly, we define u2 by
u2 = 60 2x1 x2
Observe that a point (x1 , x2 ) satisfies ith constraint if and only if ui 0. Thus
converted LP problem
Maximize Z = 4x1 + 3x2
subject to the following constraints
x1 + x2 + u1
= 40
2x1 + x2
+ u2 = 60
x1 0, x2 0, u1 0, u2 0
is in standard form.
In summary, if constraint i of a LP problem is a constraint, then we convert it
to an equality constraint by adding slack variable ui to the ith constraint and adding
the sign restriction ui 0.
23
+
+
a12 x2
a22 x2
..
.
+ +
+ +
a1N xN
a2N xN
..
.
aM 1 x1 + aM 2 x2 + + aM N xN
v1
..
.
=
=
..
.
v2
vM
b1
b2
= bM
and
xi 0, vi 0
(i = 1, 2, . . . , M )
50
x2 60
+ 15x2 80
+ 10x2 100
x1 0,
x2 0
24
can be easily transformed into standard form by adding slack variables u1 , u2 , and
u3 respectively, to the first three constraints and subtracting an excess variable v4
from the fourth constraint. Then we add the sign restrictions
u1 0,
u2 0,
u3 0,
v4 0
+ u1
x2
10x1 + 15x2
20x1 + 10x2
+ u2
+ u3
+ v4
= 50
= 60
= 80
= 100
x1 0, x2 0, u1 0, u2 0, u3 0, v4 0
1.4.6
Let us review the basic definitions using the standard form of a LP problem given
by
Maximize Z = cx
subject to the following constraints
Ax = b
x0
1. Feasible Solution. A feasible solution is a nonnegative vector x satisfying
the constraints Ax = b.
2. Feasible Region. The feasible region, denoted by S, is the set of all feasible
solutions. Mathematically,
S = {x|Ax = b, x > 0}
If the feasible set S is empty, then the linear program is said to be infeasible.
3. Optimal Solution. An optimal solution is a vector x0 such that it is feasible
and its value of the objective function (cx0 ) is larger than that of any other
feasible solution. Mathematically, x0 is optimal if and only if x0 S and
cx0 cx for all x S.
25
4. Optimal Value. The optimal value of a linear program is the value of the
objective function corresponding to the optimal solution. If Z 0 is the optimal
value, then Z 0 = cx0 .
5. Alternate Optimum: When a linear program has more than one optimal
solution, it is said to have alternate optimal solution. In this case, there exists
more than one feasible solution having the same optimal value (Z 0 ) for their
objective functions.
6. Unique Optimum. The optimal solution of a linear program is said to be
unique when there exists no other optimal solution.
7. Unbounded Solution. When a linear program does not poses a finite optimum (that is, Zmax ), it is said to have an unbounded solution.
1.5
The graphical method of solving a LP problem introduced in the last section has
its limitations. The method demonstrated for two variables can be extended to LP
problems involving three variables but for problem involving more than two variables, the graphical approach becomes impractical. Here we introduce the other
approach called the simplex method, an algebraic method that can be used for
any number of variables. This method was developed by George B. Dantzig in 1947.
It can be used to solve maximization or minimization problems with any standard
constraints.
Before proceeding further with our discussion with the simplex algorithm, we must
define the concept of a basic solution to a linear system (1.13).
Basic and Nonbasic Variables
Consider a linear system Ax = b of M linear equations in N variables (assume
N M ).
Definition 1.4 (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 or,
equivalently, the columns for the remaining M variables are linearly independent.
26
The simplex method deals only with basic feasible solutions in the sense that it
moves from one basic solution to another. Each basic solution is associated with an
iteration. As a result, the maximum number of iterations in the simplex method
cannot exceed the number of basic solutions of the standard form. We can thus
conclude that the maximum number of iterations cannot exceed
N!
N
=
M
(N M )!M !
The basic-nonbasic swap gives rise to two suggestive names: The entering variable
is a current nonbasic variable that will enterthe set of basic variables at the next
iteration. The leaving variable is a current basic variable that will leave the
basic solution in the next iteration.
Definition 1.6 (Adjacent Basic Feasible Solution)
For any LP problem with M constraints, two basic feasible solutions are said to be
adjacent if their sets of basic variables have M 1 basic variables in common.
In other words, an adjacent feasible solution differs from the present basic feasible solution in exactly one basic variable.
We now give a general description of how the simplex algorithm solves LP problems.
The Simplex Algorithm
1. Set up the initial simplex tableau.
2. Locate the negative element in the last row, other than the last element, that
is largest magnitude (if two or more entries share this property, any one of
these can be selected). If all such entries are nonnegative, the tableau is in
final form.
3. Divide each positive element in the column defined by this negative entry into
the corresponding element of the last column.
27
4. Select the divisor that yields the smallest quotient. This element is called
pivot element (if two or more elements share this property, any one of these
can be selected as pivot).
5. Use now operations to create a 1 in the pivot location and zeros elsewhere in
the pivot column.
6. Repeat steps 2 5 until all such negative elements have been eliminated from
the last row. The final matrix is called the final simplex tableau and it
leads to the optimal solution.
Example 1.10 Determine the maximum value of the function
Z = 3x1 + 5x2 + 8x3
subject to the following constraints
100
x1 + x2 + x3
3x1 + 2x2 + 4x3 200
x1 + 2x2 + x3 150
x1 0,
x2 0,
x3 0
Solution. Taking the three slack variables u1 , u2 , and u3 which must added to the
given 3 constraints to get the standard constraints which may be written in the LP
problem as
x1 + x2 + x3 + u1
= 100
3x1 + 2x2 + 4x3
+ u2
= 200
x1 + 2x2 + x3
+ u3 = 150
x1 0, x2 0, x3 0, u1 0, u2 0, u3 0
The objective function Z = 3x1 + 5x2 + 8x3 is rewritten in the form
3x1 5x2 8x3 + Z = 0
Thus the entire problem now becomes that of determining the solution to the following system of equations:
x1
3x1
x1
3x1
+ x2
+ 2x2
+ 2x2
5x2
+ x3 + u1
+ 4x3
+ u2
+ x3
+ u3
8x3
+ Z
= 100
= 200
= 150
= 0
28
Since we know that the simplex algorithm starts with an initial basic feasible solution,
so by inspection, we see that if we set nonbasic variable x1 = x2 = x3 = 0, we can
solve for the values of the basic variables u1 , u2 , u3 . So the basic feasible solution for
the basic variables is
u1 = 100, u2 = 200, u3 = 150, x1 = x2 = x3 = 0
It is important to observe that each basic variable may be associated with the row
of the canonical form in which the basic variable has a coefficient of 1. Thus, for
initial canonical form, u1 may be thought of as the basic variable for row 1, as may
u2 for row 2, and u3 for row 3. To perform the simplex algorithm, we also need a
basic (although not necessarily nonnegative) variable for last row. Since Z appears
in last row with coefficient of 1, and Z does not appear in any other row, we use Z
as its basic variable. With this convention, the basic feasible solution for our initial
canonical form has
basic variables {u1 , u2 , u3 , Z}
and
x1
1
3
1
-3
x2
1
2
2
-5
x3 u1
1
1
4l 0
0
0
-8 0
u2
0
1
0
0
u3
0
0
1
0
Z
0
0
0
1
constants
100
200
150
0
basis
u1
u2
u3
Z
x1
1
x2
1
1
2
1
-3
2
-5
u1
1
0
0
0
u2
0
3
4
x3
1
1
0
-8
u3
0
0
1
0
Z
0
0
0
1
constants
100
50
150
0
basis
u1
x3
u3
Z
x1
x2
1
4
3
4
1
2
1
2
2
-1
u1
1
0
0
0
u2
- 14
1
3
x3
0
1
0
0
u3
0
0
1
0
Z
0
0
0
1
constants
50
50
150
400
1
4
0
0
1
4
0
2
29
basis
u1
x3
u3
Z
x1
x2
1
4
3
4
1
2
1
2
basis
u1
x3
x2
Z
x1
0
1
3
1
2
1
2
7
2
x3
0
1
l
2 0
-1 0
u1
1
0
0
0
u2
- 14
x2
0
0
1
0
u1
1
0
0
0
u2
- 14
x3
0
1
0
0
1
4
0
2
1
4
0
2
u3
0
0
1
0
Z
0
0
0
1
constants
50
50
150
400
u3
- 14
- 14
Z
0
0
0
1
constants
1
2
1
2
25
2
25
2
75
475
Since all negative elements have been eliminated from the last row, therefore, the
final tableau gives the following system of equations:
1
2 x1
1
2 x1
+ x3
u1
1
4 u2
1
4 u3
25
2
1
4 u2
1
4 u3
25
2
1
2 u3
75
1
2 u3
+ x2
7
2 x1
+ 2u2
+ Z = 475
x2 = 75,
x3 =
25
.
2
Note that the reasoning at this maximum value of Z implies that the element in
the last row and the last column of the final tableau will always corresponds to the
maximum value of the objective function Z.
In the following example, we will illustrate the application of the simplex method
when there are many optimal solutions.
30
x2 0
Solution. Taking the two slack variables u1 and u2 which must added to the given 2
constraints to get the standard constraints which may be written in the LP problem
as
4x1 + x2 + u1
= 32
4x1 + 3x2
+ u2 = 48
x1 0, x2 0, u1 0, u2 0
The objective function Z = 8x1 + 2x2 is rewritten in the form
8x1 2x2 + Z = 0
Thus the entire problem now becomes that of determining the solution to the following system of equations:
4x1 + x2 + u1
= 32
4x1 + 3x2
+ u2
= 48
+ Z = 0
8x1 2x2
The simplex tableaux are as follows:
basis
u1
u2
Z
x1 x2
4l 1
4
3
-8 -2
u1
1
0
0
u2
0
1
0
Z
0
0
1
constants
32
48
0
basis
u1
u2
Z
x1
1
4
-8
x2
u1
1
4
1
4
3
-2
0
0
u2
0
1
0
Z
0
0
1
constants
8
48
0
basis
x1
u2
Z
x1
1
0
0
x2
u1
1
4
1
4
2
0
-1
2
u2
0
1
0
Z
0
0
1
constants
8
16
64
31
Since all negative elements have been eliminated from the last row, therefore, the
final tableau gives the following system of equations:
x1 +
1
4 x2
1
4 u1
2x2
u1
=
+ u2
= 16
+ Z = 64
2u1
with constraints
x1 0, x2 0, u1 0, u2 0
The last equation implies that Z has a maximum value of 64 when u1 = 0. On
substituting these values back into the equations, we get
x1 +
1
4 x2
2x2
=
+ u2
= 16
with constraints
x1 0,
x2 0,
u2 0
Any point (x1 , x2 ) that satisfies these conditions is an optimal solution. Thus Z =
8x1 + 2x2 has a maximum value of 64. This is achieved at a point on the line
x1 + 14 x2 = 8 between (6, 8) and (8, 0).
To use the simplex method set LargeScale to off and simplex to on in options.
>> option = optimset( Large , of f , simplex , on );
Then call the function linprog with the options input arguments.
>> Z = [8 : 2];
>> A = [4 1; 4 3];
>> b = [32; 48];
>> lb = [0; 0]; ub = [20; 20];
>> [x, F val, exitf lag, output] = linprog(Z, A, b, [ ], [ ], lb, ub);
Simplex Method for Minimization Problem
In the last two examples we used the simplex method for finding the maximum
value of the objective function Z. In the following we will apply the method for the
minimization problem.
32
x2 0
+
+
x2 + u1
x2
+ u2
x2
+ u3
x2
+ Z1
= 20
= 4
= 5
= 0
x1 0, x2 0, u1 0, u2 0, u3 0
The simplex tableaux are as follows:
basis
u1
u2
u3
Z1
x1 x2
2
1
1l -1
-1 1
-2 1
u1
1
0
0
0
u2
0
1
0
0
u3
0
0
1
0
Z1
0
0
0
1
constants
20
4
5
0
basis
u1
x1
u3
Z1
x1
0
1
0
0
x2 u1
3l 1
-1 0
0
0
-1 0
u2
-2
1
1
2
u3
0
0
1
0
Z1
0
0
0
1
constants
12
4
9
8
33
basis
x2
x1
u3
Z1
x1
0
1
0
0
x2
1
0
0
0
u1
1
3
1
3
u2
- 23
1
3
1
3
4
3
u3
0
0
1
0
Z1
0
0
0
1
constants
4
8
9
12
1
3 u1
2
3 u2
1
3 u1
1
3 u2
x1
u2
1
3 u1
+ u3
4
3 u2
+ Z1 = 12
with constraints
x1 0, x2 0, u1 0, u2 0, u3 0
The last equation implies that Z1 has a maximum value of 12 when u1 = u2 = 0.
Thus Z1 = 2x1 x2 has a maximum value of 12 at x1 = 8 and x2 = 4. Since Z =
Z1 = 12, therefore, the minimum value of the objective function Z = 2x1 + x2
is 12.
Second Approach: To decrease Z, we have to pick out the largest positive entry
in the bottom row to find a pivotal column. Thus the problem now becomes that of
determining the solution to the following system of equations:
2x1
x1
x1
2x1
+ x2 + u1
2x2
+ u2
+ x2
+ u3
x2
+ Z
= 20
= 4
= 5
= 0
x1 x2
2
1
l
1 -1
-1 1
2 -1
u1
1
0
0
0
u2
0
1
0
0
u3
0
0
1
0
Z
0
0
0
1
constants
20
4
5
0
basis
u1
x1
u3
Z
x1
0
1
0
0
x2 u1
3l 1
-1 0
0
0
1
0
u2
-2
1
1
-2
u3
0
0
1
0
Z
0
0
0
1
constants
12
4
9
-8
34
basis
x2
x1
u3
Z
x1
0
1
0
0
x2
1
0
0
0
u1
1
3
1
3
0
- 13
u2
- 23
1
3
1
- 43
u3
0
0
1
0
Z
0
0
0
1
constants
4
8
9
-12
1.5.1
Unrestricted-in-Sign Variables
In solving a LP problem with the simplex method, we used the ratio test determine
the row in which entering variable become a basic variable. Recall that ratio test
depended on the fact that any feasible point required all variables to be nonnegative.
Thus, if some variables are allowed to be unrestricted in sign, the ratio test and
therefore the simplex method are no longer valid. Here, we show how a LP problem
with restricted in sign variables can be transformed into a LP problem in which all
variables are required to be nonnegative.
For each unrestricted in sign variable xi , we begin by defining two new variables
xi and xi . Then substitute xi xi for xi in each constraint and in the objective
function. Also add the sign restrictions xi 0 and xi 0. Now all the variables
are nonnegative, therefore we can use the simplex method. Note that each basic
feasible solution can have either xi > 0 (and xi = 0), or xi > 0 (and xi = 0), or
xi = xi = 0 (xi = 0).
Example 1.13 Consider the following LP problem:
Maximize
Z = 30x1 4x2
x2 unrestricted
35
x2 0,
x1 0,
x2 0
Now convert the problem into standard form by adding two slack variables u1 and
u2 in the first and second constraints respectively, we get
Z = 30x1 4x2 + 4x2
Maximize
subject to the following constraints
5x1 x2 + x2 + u1
= 30
x1
+ u2 = 5
x1 0, x2 0, x2 0, u1 0, u2 0
The simplex tableaux are as follows:
basis
u1
u2
Z
x1
5
1l
-30
x2
-1
0
4
x2
1
0
-4
u1
1
0
0
u2
0
1
0
Z
0
0
1
constants
30
5
0
basis
u1
x1
Z
x1
0
1
0
x2
-1
0
4
x2 u1
1l 1
0
0
-4 0
u2
-5
1
30
Z
0
0
1
constants
5
5
150
basis
x2
x1
Z
x1
0
1
0
x2
-1
0
0
x2
1
0
0
u2
-5
1
10
Z
0
0
1
constants
5
5
170
u1
1
0
4
1.6
36
Z = 3x1 + x2 + x3
x2 0,
x3 0
37
Z = 3x1 + x2 + x3
On the other hand, it is easy to see that any basic feasible solution to the artificial
system in which the artificial variables (as w3 and w4 in the above example) are
zero is automatically a basic feasible solution to the original problem. Hence the
object is to reduce the artificial variables to zero as soon as possible. This can
be accomplished in two ways, and each one gives rise to a variant of the simplex
method, the Big M simplex method and the Two-Phase simplex method.
1.6.1
In this approach, the artificial variables are assigned a very large cost in the objective
function. The simplex method, while trying to improve the objective function, will
find the artificial variables uneconomical to maintain as basic variables with positive
values. Hence they will be quickly replaced in the basis by the real variables with
smaller costs. For hand calculations it is not necessary to assign a specific cost value
38
to the artificial variables. The general practice is to assign the letter M as the cost
in a minimization problem, and M as the profit in a maximization problem with
the assumption that M is a very large positive number.
The following steps describe the Big M simplex method.
1. Modify the constraints so that the right-hand side of each constraint is nonnegative. This requires that each constraint with a negative right-hand side
be multiplied through by -1.
2. Convert each inequality constraint to standard form. This means that if constraint i is a constraint, we add a slack variable ui , and if i is a constraint,
we subtract an surplus variable vi .
3. If (after step 1 has been completed) constraint i is a or = constraint, add
an artificial variable wi . Also add the sign restriction wi 0.
4. Let M denote a very large positive number. If a LP problem is a minimization
problem, add (for each artificial variable) M wi to the objective function. If
a LP problem is a maximization problem, add (for each artificial variable)
M wi to the objective function.
5. Since each artificial variable will be in the starting basis, all artificial variables
must be eliminated from last row before beginning the simplex method. This
ensures that we begin with canonical form. In choosing the entering variable,
remember that M is a very large positive number. Now solve the transformed
problem by the simplex method. If all artificial variables are equal to zero
in the optimal solution, we have found the optimal solution to the original
problem. If any artificial variables are positive in the optimal solution, the
original problem is infeasible.
Example 1.15 To illustrate the Big M simplex method, let us consider the standard
form of the Example 1.14:
M inimize
Z = 3x1 + x2 + x3
39
Solution. In order to derive the artificial variables to zero, a large cost will be
assigned to w3 and w4 so that the objective function becomes:
M inimize
Z = 3x1 + x2 + x3 + M w3 + M w4
where M is very large positive number. Thus the LP problem with its artificial
variables becomes:
M inimize
Z = 3x1 + x2 + x3 + M w3 + M w4
+ v2
40
basis
u1
w3
w4
Z
x1
1
-4
-2
3-6M
basis
u1
w3
x3
Z
basis
u1
x2
x3
Z
x1
3
0
-2
1
x2
-2
1
0
-1+M
x3
1
2
1l
-1+3M
x2
x3
-2
0
l
1
0
0
1
-1+M 0
x1 x2
3l 0
0
1
-2 0
1
0
x3
0
0
1
0
u1
1
0
0
0
u1
1
0
0
0
u1
1
0
0
0
v2
0
-1
0
-M
w3
0
1
0
0
v2
0
-1
0
-M
w3
0
1
0
0
w4
-1
-2
1
1-3M
v2
-2
-1
0
-1
w3
2
1
0
1-M
w4
-5
-2
1
-1-M
w4
0
0
1
0
Z
0
0
0
1
Z
0
0
0
1
Z
0
0
0
1
constants
11
3
1
4M
constants
10
1
1
M+1
constants
12
1
1
2
Now both the artificial variables w3 and w4 have been reduced to zero. Thus Tableau
3 represents a basic feasible solution to the original problem. Of course, this is not
an optimal solution since x1 can reduce the objective function further by replacing
u1 in the basis.
basis
x1
x2
x3
Z
x1
1
0
0
0
x2
0
1
0
0
x3
0
0
1
0
u1
1
3
0
0
- 13
v2
- 23
-1
0
- 13
w3
2
3
1
0
1
3 -M
w4
- 53
-2
1
2
3 -M
Z
0
0
0
1
constants
4
1
9
-2
Note that an artificial variable is added merely to act as a basic variable in a particular equation. Once it is replaced by a real (decision) variable, there is no need
to retain the artificial variable in the simplex tableaus. In other words, we could
have omitted the column corresponding to the artificial variable w4 in Tableaus 2,
3, and 4. Similarly, the column corresponding to w3 could have been dropped from
Tableaus 3 and 4.
When the Big M simplex method terminates with an optimal tableau, it is sometimes possible for one or more artificial variables to remain as basic variables at
positive values. This implies that the original problem is infeasible since no basic
feasible solution is possible to the original system if it includes even one artificial
41
variable at a positive value. In other words, the original problem without artificial
variables does not have a feasible solution. Infeasibility is due to the presence of
inconsistent constraints in the formulation of the problem. In economic terms, this
means that the resources of the system are not sufficient to meet the expected demands.
Also, note that for the computer solutions, M has to be assigned a specific value.
Usually the largest value that can be represented in the computer is assumed.
1.6.2
A drawback of the Big M simplex method is the possible computational error that
could result from assigning a very large value of the constant M and sometimes
create computational problems in a digital computer. The Two-Phase method is
designed to alleviate this difficulty. Although the artificial variables are added in
the same manner employed in the Big M simplex method, the use of the constant M
is eliminated by solving the problem in two phases (hence the name Two-Phase
method). These two phases are outlined as follows:
Phase 1. This phase consists of finding an initial basic feasible solution to the
original problem. In other words, the removal of the artificial variables is taken
up first. For this an artificial objective function is created which is the sum of all
the artificial variables. The artificial objective function is then minimized using the
simplex method. If the minimum value of the artificial problem is zero, then all the
artificial variables have been reduced to zero, and we have a basic feasible solution
to the original problem. Go to Phase 2. Otherwise, if the minimum is positive, the
problem has no feasible solution. Stop.
Phase 2. The basic feasible solution found is optimized with respect to the original
objective function. In other words, the final tableau of Phase 1 becomes the initial
tableau for Phase 2 after changing the objective function. The simplex method is
once again applied to determine the optimal solution.
The following steps describe the Two-phase simplex method. Note that steps 1-3
for the Two-Phase simplex method are similar to steps 1-3 for the Big M simplex
method.
1. Modify the constraints so that the right-hand side of each constraint is nonnegative. This requires that each constraint with a negative right-hand side
be multiplied through by -1.
2. Convert each inequality constraint to standard form. This means that if constraint i is a constraint, we add a slack variable ui , and if i is a constraint,
we subtract an surplus variable vi .
42
Z = 3x1 + x2 + x3
W = w3 + w4
43
= w3 + w4
= (3 + 4x1 x2 2x3 + v2 ) + (1 + 2x1 x3 )
= 4 + 6x1 x2 3x3 + v2
x1
1
-4
-2
-6
x2
-2
1
0
1
x3 u1
1
1
2
0
l
1 0
3
0
basis
u1
w3
x3
W
x1
3
0
-2
0
x2 x3
-2 0
1l 0
0
1
-1 0
basis
u1
x2
x3
W
x1
3
0
-2
0
x2
0
1
0
0
x3
0
0
1
0
v2
0
-1
0
-1
w3
0
1
0
0
w4
0
0
1
0
W
0
0
0
1
constants
11
3
1
4
u1
1
0
0
0
v2
0
-1
0
-1
w3
0
1
0
0
w4
-1
-2
1
-3
W
0
0
0
1
constants
10
1
1
1
u1
1
0
0
0
v2
-2
-1
0
0
w3
2
1
0
-1
w4
-5
-2
1
1
W
0
0
0
1
constants
12
1
1
0
44
Phase 2 Problem: The artificial variables have now served their purpose and must
be dispensed with in all subsequent computations. This means that the equations of
the optimum tableau in Phase 1 can be written as
3x1
x2
2x1
+ x3
+ u1 2v2 = 12
v2 = 1
= 1
These equations are exactly equivalent to those in the standard form of the original
problem (before artificial variables are added). Thus the original problem can be
written as
M inimize Z = 3x1 + x2 + x3
subject to the constraints
3x1
x2
+ x3
2x1
+ u1 2v2 = 12
v2 = 1
= 1
x1 0, x2 0, x3 0, u1 0, v2 0
As we can see, the principal contribution of the Phase 1 computations is to provide
a ready starting solution to the original problem. Since the problem has three equations and five variables, by putting 5 3 = 2 variables, namely, x1 = v2 = 0, we
immediately obtain the starting basic feasible solution u1 = 12, x2 = 1, and x3 = 1.
To solve the problem, we need to substitute out the basic variables x1 , x2 , and x3
in the objective function. This is accomplished by using the constraint equations as
follows:
Z = 3x1 + x2 + x3
= 3(4 13 u1 + 23 v2 ) + (1 + v2 ) + 2(4 13 u1 + 23 v2 )
= 2 + 13 u1 + 13 v2
Thus the starting tableau for Phase 2 becomes:
basis
u1
x2
x3
Z
x1 x2
3l 0
0
1
-2 0
0
0
x3
0
0
1
0
u1
1
0
0
- 13
v2
-2
-1
0
- 13
Z
0
0
0
1
constants
12
1
1
-2
basis
x1
x2
x3
Z
x1
1
0
0
0
x3
0
0
1
0
u1
v2
- 23
-1
- 43
- 13
Z
0
0
0
1
constants
4
1
9
-2
x2
0
1
0
0
1
3
0
2
3
- 13
45
0, v2 = 0, and minimum Z = 2.
Comparing the Big M simplex method and the Two-Phase simplex method, we
observe the following:
The basic approach to both methods is the same. Both add the artificial
variables to get the initial canonical system and then derive them to zero as
soon as possible.
The sequence of tableaus and the basis changes are identical.
The number of iterations are the same.
The Big M simplex method solves the linear problem in one pass while the
Two-Phase simplex method solves it in two stages as two linear programs.
1.7
Duality
From both the theoretical and practical points of view, the theory of duality is
one of the most important and interesting concepts in linear programming. Each
LP problem has a related LP problem called the dual problem. The original LP
problem is called the primal problem. For the primal problem defined by (1.1)(1.3) above, the corresponding dual problem is to find the values of the M variables
y1 , y2 , . . . , yM to solve the following:
Minimize
V = b1 y1 + b2 y2 + + bM yM
(1.17)
+
+
a21 y2
a22 y2
..
.
a1N y1 + a2N y2
+ +
+ +
aM 1 yM
aM 2 yM
..
.
+ + aM N yM
c1
c2
..
.
(1.18)
cN
and
y1 0, y2 0, . . . , yM 0
(1.19)
46
8.7 Duality
In matrix notation, the primal and the dual problems are formulated as
Primal
Dual
Maximize Z = cT x
subject to the constraints
Minimize V = bT y
subject to the constraints
Ax b
AT y c
x0
y0
where
A=
b=
b1
b2
..
.
bM
a11
a21
..
.
a12
a22
..
.
..
.
a1N
a2N
..
.
aM 1 aM 2 aM N
c1
x1
c2
x2
c = . , x = . ,
.
.
.
.
cN
xN
y=
y1
y2
..
.
yM
x2 0,
x3 0,
x4 0
The above linear problem has two constraints and four variables. The dual of this
primal problem is written as:
Dual Problem:
minimize
V = 25y1 + 15y2
47
1
2
3
4
y2 0
1.7.1
Comparing the primal and the dual problems, we observe the following relationships:
1. The objective function coefficients of the primal problem have became the
right-hand side constants of the dual. Similarly, the right-hand side constants
of the primal have became the cost coefficients of the dual.
2. The inequalities have been reversed in the constraints.
3. The objective function is changed from maximization in primal to minimization in dual.
4. Each column in the primal corresponds to a constraint (row) in the dual. Thus
the number of dual constraints is equal to the number of primal variables.
5. Each constraint (row) in the primal corresponds to a column in the dual.
Hence there is one dual variable for every primal constraint.
6. The dual of the dual is the primal problem.
In both of the primal and the dual problems, the variables are nonnegative and
the constraints are inequalities. Such problems are called symmetric dual linear
programs.
Definition 1.7 (Symmetric Form)
A linear program is said to be in symmetric form, if all the variables are restricted
to be nonnegative, and all the constraints are inequalities (in maximization problem
the inequalities must be in less than or equal to form; while in a minimization
problem they must be greater than or equal to).
The general rules for writing the dual of a linear program in symmetric form as
summarized below:
48
8.7 Duality
x4 + x5 + x6
+ x4
+ x5
+ x6
300
600
200
300
400
x1 0, x2 0, x3 0, x4 0, x5 0, x6 0
Solution. For the above linear program (minimization) to be in symmetric form,
all the constraints must be in greater than or equal to form. Hence we multiply
the first two constraints by 1, then we have the primal problem as
minimize
x4 x5 x6
+ x4
+ x5
+ x6
300
600
200
300
400
x1 0, x2 0, x3 0, x4 0, x5 0, x6 0
The dual of the above primal problem becomes:
maximize
49
y1
y1
y1
+ y4
+ y5
y2 + y3
y2
+ y4
y2
+ y5
2
4
3
5
3
4
y1 0, y2 0, y3 0, y4 0, y5 0
1.7.2
In most LP problems, the dual is defined for various forms of the primal depending
on the types of the constraints, the signs of the variables, and the sense of optimization. Now we introduce a definition of the dual that automatically accounts for
all forms of the primal. It is based on the fact that any LP problem must be put
in the standard form before the model is solved by the simplex method. Since all
the primal-dual computations are obtained directly from the simplex tableau, it is
logical to define the dual in a way that is consistent with the standard form of the
primal.
Example 1.19 Write the standard form of primal-dual problem of the following
linear problem:
maximize Z = 5x1 + 12x2 + 4x3
subject to the following constraints
x1 + 2x2 + x3 10
2x1 x2 + x3 = 8
x1 0,
x2 0,
x3 0
x2 0,
x3 0,
u1 0
50
8.7 Duality
Notice that u1 is a slack in the first constraint. Now its dual form can be written as
minimize
V = 10y1 + 8y2
y2 unrestricted
Example 1.20 Write the standard form of primal-dual problem of the following
linear problem:
minimize Z = 5x1 2x2
subject to the following constraints
x1 + x2 3
2x1 + 3x2 5
x1 0,
x2 0
Z = 5x1 2x2
x2 0,
u1 0,
u2 0
Notice that u1 and u2 are slack in the first and second constraints. Its dual form is
maximize
V = 3y1 + 5y2
5
2
0
0
y1 , y2 unrestricted
51
It can be shown that when primal problem is solved by the simplex method, the
final tableau contains the optimal solution to the dual problem in the objective row
under the columns of the slack variables. That is, the first dual variable is found
in the objective row under the first slack variable, the second is found under the
second slack variable, and so on.
Example 1.21 Find the dual of the following linear problem
Z = 12x1 + 9x2 + 15x3
maximize
subject to the following constraints
2x1 + x2 + x3 30
x1 + x2 + 3x3 40
x1 0,
x2 0,
x3 0
V = 30y1 + 40y2
y2 0
Introducing the slack variables u1 and u2 in order to convert the given linear problem
in the standard form, we obtain
maximize
52
8.7 Duality
x1
2
1
-12
x2
1
1
-9
x3
1
3l
-15
basis
u1
x3
Z
x1
x2
-4
u1
1
0
0
u2
- 13
-7
x3
0
1
0
basis
x1
x3
Z
x1
1
0
0
x2
x3
0
1
0
u1
2
m
5
1
5
- 65
basis
x2
x3
Z
x1
x2
1
0
0
x3
0
1
0
u1
5
m
3
1
3
5
2
- 12
2
3
1
3
u1
1
0
0
3
5
- 15
21
5
3
2
- 12
u2
0
1
0
Z
0
0
1
constants
30
40
0
Z
0
0
1
constants
u2
- 15
Z
0
0
1
constants
10
10
270
u2
- 12
Z
0
0
1
constants
25
5
300
1
3
2
5
18
5
1
2
50
3
40
3
200
x2 = 25,
x3 = 5
and
y2 = 3
53
In the following we give another important duality theorem which gives the relationship between the primal and the dual solutions.
Theorem 1.4 (Weak Duality Theorem)
Consider the symmetric primal-dual linear problems:
Primal
Dual
Maximize Z = cT x
subject to the constraints
Minimize V = bT y
subject to the constraints
Ax b
AT y c
x0
x0
The value of the objective function of the minimization problem (dual) for any feasible solution is always greater than or equal to that of the maximization problem
(primal).
V = 20y1 + 20y2
+ 2y2
+ y2
+ 3y2
+ 2y2
1
2
3
4
54
y1 0,
y2 0
1.8
Sensitivity analysis refers to the study of the changes in the optimal solution and
optimal value of objective function Z due to the input data coefficients. The need for
such an analysis arises in various circumstances. Often management is not entirely
sure about the values of the constants, and wants to know the effects of changes.
There may be different kinds of modifications:
1. Changes in the right-hand side constants, bi
2. Changes in the objective function coefficients ci
3. Changes in the elements aij of the coefficient matrix A
4. Introducing additional constraints or deleting some of the existing constraints
5. Adding or deleting decision variables
We will discuss here only changes in the right-hand side constants bi , which is the
most common in sensitivity analysis.
Example 1.23 A small towel company makes two types of towels, standard and
deluxe. Both types have to go through two processing departments, cutting and
sewing. Each standard towel needs 1 minute in the cutting department and 3 minutes in the sewing department. The total available time in cutting is 160 minutes
for a production run. Each deluxe towel needs 2 minutes in the cutting department
and 2 minutes in the sewing department. The total available time in sewing is 240
minutes for a production run. The profit on each standard towel is $1.00, whereas
55
the profit on each deluxe towel is $1.50. Determine the number of towels of each
type to produce to maximize profit.
Solution. Let x1 and x2 be the number of standard towels and deluxe towels, respectively. Then the LP problem is
Maximize
Z = x1 + 1.5x2
x1 + 2x2 160
3x1 + 2x2 240
x1 0,
(cutting dept.)
(sewing dept.)
x2 0
After converting the problem into the standard form and then apply the simplex
method, one can easily get the final tableau as
basis
x2
x1
Z
x1
0
1
0
x2
1
0
0
u1
3
4
- 12
5
8
u2
- 14
1
2
1
8
Z
0
0
1
constants
60
40
130
Zmax = 130
Z = x1 + 1.5x2
x1 + 2x2 161
3x1 + 2x2 240
x1 0,
(cutting dept.)
(sewing dept.)
x2 0
Of course, we can again solve this revised problem using the simplex method. However, since the modification is not drastic, we would wounder whether there is easy
way to utilize the final tableau for the original problem instead of going through all
iteration steps for the revised problem. There is a way, and this way is the key idea
of the sensitivity analysis.
1. The slack variable for the cutting department is u1 , then use the u1 -column.
56
2. Modify the right most column (constants) using the u1 -column as subsequently
shown, giving the final tableau for the revised problem.
basis
x2
x1
Z
x1
0
1
0
x2
1
0
0
u1
u2
- 14
3
4
- 12
5
8
Z
0
0
1
1
2
1
8
constants
60 + 1 34
40 + 1 (- 12 )
130 + 1 58
(where in the last column, the first entry is the original entry, second one is one
unit (minutes) increased, and final one is the u1 -column entry), that is
basis
x2
x1
Z
x1
0
1
0
x2
1
0
0
u1
3
4
- 12
5
8
u2
- 14
1
2
1
8
Z
0
0
1
constants
60 34
39 12
130 58
Zmax = 130
5
8
x1
0
1
0
x2
1
0
0
u1
3
4
- 12
5
8
u2
- 14
1
2
1
8
Z
0
0
1
constants
60 + (-8) (- 14 ) = 62
40 + (-8) ( 12 ) = 36
130 + (-8) ( 18 ) = 129
Zmax = 129
The bottom-row entry, 58 , represents the net profit increase for one unit (minute)
increase of the available time at the cutting department. It is called the shadow
price at the cutting department. Similarly, another bottom-row entry, 18 , is called
the shadow price at the sewing department.
In general, the shadow price for a constraint is defined as the change in the optimal
value of the objective function when one unit is increased in the right-hand side of
the constraint.
A negative entry in the bottom-row represents the net profit increase when one unit of
the variable in that column is introduced. For example, if a negative entry in the x1
57
column is 14 , then introducing one unit of x1 will result in $( 14 ) = 25 cents net profit
gain. Therefore, the bottom-row entry, 58 , in the preceding tableau represents that
the net profit loss in $( 58 ) when one unit of u1 is introduced keeping the constraint,
160, the same.
Now, suppose the constraint at the cutting department is changed from 160 to 161. If
this increment of 1 minute is credited to u1 as a slack, or unused time at the cutting
department. The total profit will remain the same because the unused time will not
contribute to profit increase. However, if this u1 = 1 is given up, or reduced
(which is the opposite of introduced), it will yield a net profit gain of $( 58 ).
1.9
Summary
58
8.10 Problems
1.10
Problems
1. The Oakwood Furniture Company has 12.5 units of wood on hand from which
to manufacture tables and chairs. Making a table uses two units of wood and
making a chair uses one unit. Oakwoods distributor will pay $20 for each
table and $15 for each chair, but he will not accept more than eight chairs and
he wants at least twice as many chairs as tables. How many tables and chairs
should the company produce so as to maximize its revenue? Formulate this
as a linear programming problem.
2. The Mighty Silver Ball Company manufactures three kinds of pinball machines, each requiring a different manufacturing technique. The Super Deluxe
Machine requires 17 hours of labor, 8 hours of testing, and yields a profit of
$300. The Silver Ball Special requires 10 hours of labor, 4 hours of testing,
and yields a profit of $200. The Bumper King requires 2 hours of labor, 2
hours of testing, and yields a profit of $100. There are 1000 hours of labor
and 500 hours of testing available.
In addition, a marketing forecast has shown that the demand for the Super
Deluxe is no more that 50 machines, demand for the Silver Ball Special no
more than 80, and demand for Bumper King no more that 150. The manufacturer wants to determine the optimal production schedule that will maximize
his total profit. Formulate this as a linear programming problem.
3. Consider a diet problem in which a college student is interested in finding a
minimum cost diet that provides at least 21 units of Vitamin A and 12 units
of Vitamin B from five foods of the following properties:
Food
Vitamin A content
Vitamin B content
Cost per unit (cents)
1
1
0
20
2
0
1
20
3
1
2
31
4
1
1
11
5
2
1
12
59
60
8.10 Problems
x2 0
61
(b)
Maximize:
Subject to:
Z = 2x1 + x2
4x1 + x2 16
x1 + x2 7
x1 0,
(c)
Maximize:
Subject to:
x2 0
Z = 4x1 + x2
2x1 + x2 4
6x1 + x2 8
x1 0,
(d)
Maximize:
Subject to:
x2 0
Z = x1 4x2
x1 + 2x2 5
x1 + 6x2 7
x1 0,
x2 0
14. Solve the each of the following linear programming problem using the graphical
method.
(a) Maximize:
Z = 6x1 2x2
Subject to:
x1 x2 1
3x1 x2 6
x1 0,
(b)
Maximize:
Subject to:
x2 0
Z = 4x1 + 4x2
2x1 + 7x2 21
7x1 + 2x2 49
x1 0,
(c)
Maximize:
Subject to:
x2 0
Z = 3x1 + 2x2
2x1 + x2 2
3x1 + 4x2 12
x1 0,
x2 0
62
8.10 Problems
(d)
Maximize:
Subject to:
Z = 5x1 + 2x2
x1 + x2 10
4x1 = 5
x1 0,
x2 0
15. Solve the each of the following linear programming problem using the graphical
method.
(a) Minimize:
Z = 3x1 x2
Subject to:
x1 + x2 150
4x1 + x2 450
x1 0,
(b)
Minimize:
Subject to:
x2 0
Z = 2x1 + x2
2x1 + 3x2 14
4x1 + 5x2 16
x1 0,
(c)
Minimize:
Subject to:
x2 0
Z = 2x1 + x2
2x1 + x2 440
4x1 + x2 680
x1 0,
(d)
Maximize:
Subject to:
x2 0
Z = x1 x2
x1 + x2 6
x1 x2 0
x1 x2 3
x1 0,
x2 0
16. Solve the each of the following linear programming problem using the graphical
method.
(a) Minimize:
Z = 3x1 + 5x2
Subject to:
3x1 + 2x2 36
3x1 + 5x2 45
63
x1 0,
(b)
Minimize:
Subject to:
x2 0
Z = 3x1 8x2
2x1 x2 4
3x1 + 11x2 33
3x1 + 4x2 24
x1 0,
(c)
Minimize:
Subject to:
x2 0
Z = 3x1 5x2
2x1 x2 2
4x1 x2 0
x2 3
x1 0,
(d)
Minimize:
Subject to:
x2 0
Z = 3x1 + 2x2
3x1 x2 5
x1 + x2 1
2x1 + 4x2 12
x1 0,
x2 0
17. Solve the each of the following linear programming problem using the simplex
method.
(a) Maximize:
Z = 3x1 + 2x2
Subject to:
x1 + 2x2 4
3x1 + 2x2 14
x1 x2
3
x1 0,
(b)
Maximize:
Subject to:
x2 0
Z = x1 + 3x2
4x1
5
x1 + 2x2 10
x2 4
x1 0,
x2 0
64
8.10 Problems
(c)
Maximize:
Subject to:
Z = 10x1 + 5x2
x1 + x2 180
3x1 + 2x2 480
x1 0,
(d)
Maximize:
Subject to:
x2 0
Z = x1 4x2
x1 + 2x2 5
x1 + 6x2 7
x1 0,
x2 0
Minimize:
Subject to:
x2 0,
x3 0
Z = 2x1 x2 + 2x3
x1 + x2 + x3 4
x1 + 2x2 + 3x3 3
x1 + x2 x3 6
x1 0,
(c)
Maximize:
Subject to:
x2 0,
x3 0
x2 0,
x3 0
65
(d)
Minimize:
Subject to:
x1
2x2
x1 +
x2
x1 0,
x3
+ x3
30
50
20
120
x2 0,
x3 0
20. Solve the each of the following linear programming problem using the simplex
method.
(a) Minimize:
Z = x1 + 2x2 + 3x3 + 4x4
Subject to:
x1 + 2x2 + 2x3 + 3x4 20
2x1 + x2 + 3x3 + 2x4 20
x1 0,
(b)
Maximize:
Subject to:
x2 0,
x3 0,
x4 0
Z = x1 + 2x2 + 4x3 x4
5x1
+ 4x3 + 6x4 20
4x1 + 2x2 + 2x3 + 8x4 40
x1 0,
(c)
Minimize:
Subject to:
x2 0,
x3 0,
x4 0
Z = 3x1 + x2 + x3 + x4
2x1 + 2x2 + x3 + 2x4 4
3x1 + x2 + 2x3 + 4x4 6
x1 0,
(d)
Minimize:
Subject to:
x2 0,
x3 0,
x4 0
Z = x1 + 2x2 x3 + 3x4
2x1 + 4x2 + 5x3 + 6x4 24
4x1 + 4x2 + 2x3 + 2x4 4
x1 0,
x2 0,
x3 0,
x4 0
21. Use the Big M simplex method to solve each of the following linear programming problem.
66
8.10 Problems
(a)
Minimize:
Subject to:
Z = 4x1 + 4x2 + x3
x1 + x2 + x3 2
2x1 + x2 + 0x3 3
2x1 + x2 + 3x3 3
x1 0,
(b)
Maximize:
Subject to:
x2 0,
x3 0
Z = 3x1 + x2
x1 + x2 3
2x1 + x2 4
x1 + x2 = 3
x1 0,
(c)
Minimize:
Subject to:
x2 0
Z = 3x1 2x2
x1 + x2 = 10
x1 + 0x2 4
x1 0,
(d)
Minimize:
Subject to:
x2 0
Z = 2x1 + 3x2
2x1 + x2 4
x1 x2 1
x1 0,
x2 0
22. Use the Two-Phase simplex method to solve the Problem 21.
23. Write the duals of each of the following linear programming problem.
(a) Maximize:
Z = 5x1 + 2x2
Subject to:
x1 + x2 3
2x1 + 3x2 5
x1 0,
(b)
Maximize:
Subject to:
x2 0
67
x1 0,
(c)
Minimize:
Subject to:
x2 0,
x3 0
Z = 6x1 + 3x2
6x1 3x2 + x3 2
3x1 + 4x2 + x3 5
x1 0,
(d)
Minimize:
Subject to:
x2 0,
x3 0
Z = 2x1 + x2 + 2x3
x1 + x2 + x3 = 4
x1 + x2 x3 6
x1 0,
x2 0,
x3 0
24. Write the duals each of the following linear programming problem.
(a) Minimize:
Z = 3x1 + 4x2 + 6x 3
Subject to:
x1 + x2 10
x1 0,
(b)
Maximize:
Subject to:
x3 0,
x2 0
(c)
Minimize:
Subject to:
x2 0,
x3 0
(d)
Maximize:
Subject to:
Z = x1 + x2
2x1 + x2 = 5
3x1 x2 = 6
x1 0,
x2 0
68
8.10 Problems
(e)
Maximize:
Subject to:
Z = 2x1 + 4x2
4x1 + 3x2 = 50
2x1 + 5x2 = 75
x1 0,
(f )
Maximize:
Subject to:
x2 0
Z = x1 + 2x2 + 3x 3
2x1 + x2 + x3 = 5
x1 + 3x2 + 4x3 = 3
x1 + 4x2 + x3 = 8
x1 0,
x2 0