You are on page 1of 141

Outline of the Handout

EE 477: Optimization Techniques 1. Introduction


2. The Fundamentals of Linear Programming
3. The General Solution of Ax = b
Handout #5 4. Motivation of the Simplex Method
5. The Simplex Algorithm
6. Examples of the Simplex Method
Linear Programming 7. The Two Phase Simplex Method
8. Special Cases
9. Introduction to Duality
Prof. Mohamed Zribi 10. Un-Symmetric Duals
11. Solving LPs Using Duality
Updated 29 September 2017
EE 477 Dr. Mohamed Zribi 1 EE 477 Dr. Mohamed Zribi 2

The Importance of Linear Programming


– Many real world problems lend themselves to linear

programming modeling.

– Many real world problems can be approximated by linear

1. Introduction models.

– There are well-known successful applications in:

• Engineering and Manufacturing

• Marketing and Finance (investment)

• Advertising

• Agriculture
EE 477 Dr. Mohamed Zribi 3 EE 477 Dr. Mohamed Zribi 4
Linear Programming Linear Programming Problems
A linear programming problem is made up of a linear objective
-In mathematics, linear programming (LP) is a technique function and a system of constraints.
for optimization of a linear objective function, subject to
The objective function is an algebraic expression in two or more
linear equality and linear inequality constraints. variables describing a quantity that must be maximized or
minimized.
-Linear programming determines the way to achieve the best
The system of constraints are made up of a system of linear
outcome (such as maximum profit or lowest cost) in a inequalities. In applications, the variables are also limited to
positive values.
given mathematical model and given some list of
requirements represented as linear equations. The solution to the linear programming problem, if it exists, will
occur at the vertices (corner points) of the solution region
obtained from the system of constraints.
EE 477 Dr. Mohamed Zribi 5 EE 477 Dr. Mohamed Zribi 6

Linear Programming Introduction to LP

Linear programming methods make it possible to choose the best Linear programming (LP) problems are optimization problems
solution from many possible solutions. where the objective function and the constraints of the
problem are all linear.

An important factor in the widespread use of the LP techniques is


the availability of very efficient computer software packages A lot of work was generated on the research of specialized
for solving LP problems. algorithms for the solutions of specific LP problems.

In mathematical optimization theory, the simplex algorithm


developed by George Dantzig is the fundamental technique for
numerical solution of the LP problem.
EE 477 Dr. Mohamed Zribi 7 EE 477 Dr. Mohamed Zribi 8
The Simplex Method Standard Form of an LP Problem
Any linear program can be transformed into the following standard form.
The graphical solution method is convenient to solve
linear programming problems involving only two max (or min ) z c1 x1 c2 x2 cn xn
◌ubject
Sٍ to:
variables. However, for problems involving more
a11 x1 a12 x2 a1n xn b1
than two variables or problems involving large a21 x1 a22 x2 a2 n xn b2

numbers of constraints, it is better to use a more


am1 x1 am 2 x2 amn xn bm
systematic solution, which is called the simplex x1 0, x2 0, , xn 0
method b1 0, b2 0, , bm 0

where the bi 's, ci 's and aij 's are fixed real constants, and the xi 's
are real numbers to be determined.
EE 477 Dr. Mohamed Zribi 9 EE 477 Dr. Mohamed Zribi 10

Linear Programming - Standard Form Linear Programming - Standard Form

Objective
Function Maximize (Minimize): Z cT x
Maximize (Minimize): Z c1 x1 c2 x2 c3 x3 ... cn xn
Subject to:
Ax b
Subject to: where,
a11 x1 a12 x2 ... a1n xn b1 x 0
a21 x1 a22 x2 ... a2 n xn b2 b 0 c [c1 c2 . . . cn ]T
Constraint
. . Set
a11 a12 . . . a1n b1 x1
. .
a21 a22 . . . a2 n b2 x2
am1 x1 am 2 x2 ... amn xn bm A b x
Non-negative
x1 0, x2 0,..., xn 0 . . . .
Right-hand side Non-negative
Constants
b1 0, b2 0,..., bm 0 Variables am1 am 2 . . . amn bm xn
EE 477 Dr. Mohamed Zribi Constraint11 EE 477 Dr. Mohamed Zribi
12
Standard Form of an LP Problem Slack Variables
An LP model may include constraints of all types ( , , ). Also the When we transform the equation
variables may be nonnegative or unrestricted in sign. To have a model in
2x1 + 3x2 ≤ 5 to 2x1 + 3x2 + s1 = 5
the standard form, we need to convert the inequalities into equalities.
If the left-hand side (LHS) (2x1 + 3x2) is less than the right-hand
Example 1:
1) Consider the following constraint side (RHS) (5), then s1 will take a positive value to make the
equality true. The nearer the value of the LHS is to the RHS,
This constraint can be written as the smaller the value of s1 is.
x1 2 x2 5
s1 is referred to as slack variable. If the LHS is equal to the RHS, s1 = 0. s1 cannot be negative
because the LHS cannot be greater than the RHS.
x1 2 x2 s1 5 s1 0
EE 477 Dr. Mohamed Zribi 13 EE 477 Dr. Mohamed Zribi 14

Example 2: Slack variables Example 3: Slack Variables

The constraint, 2x1 + x2 ≤ 16, can be rewritten by adding slack


x1 x2 11 x1 x2 s1 11
variable s1:
x1 x2 27 x1 x2 s2 27
2x1 + x2 + s1 = 16
2 x1 5 x2 90 2 x1 5 x2 s3 90

The nonnegative numbers s1, s2, and s3 are called For example, the slack at the optimal solution (3, 6):
2(3) + 6 + s1 = 16
slack variables because they represent the “slackness” s1 = 4

in each inequality

EE 477 Dr. Mohamed Zribi 15 EE 477 Dr. Mohamed Zribi 16


Remark: Example 5: Surplus variables
We need Slack variables because we cannot add (multiples of)
Consider the following constraint
INEQUALITIES ! x≥ 0
y≥ 0
y
x1 2 x2 5
This constraint can written as

Example 4:
Consider:
x1 2 x2 s2 5 s2 0
x
x ≥ 0 [1]
y ≥ 0 [2]
x + y≥ 0

[1] + [2]: x + y ≥ 0 [3] s 2 is referred to as surplus variable.

EE 477 Dr. Mohamed Zribi 17 EE 477 Dr. Mohamed Zribi 18

Standard Form of an LP Problem Standard Form of an LP Problem

If a linear program is given in standard form except that The maximization of a function is equivalent to the
one (or more) of the variable is not required to be minimization of the negative of the same function,
nonnegative (unrestricted) then the unrestricted and vice versa.
variable can be expressed in terms of two
nonnegative variables using the substitution
max z(x) min -z(x)

x1 x1 x1 x1 , x1 0

EE 477 Dr. Mohamed Zribi 19 EE 477 Dr. Mohamed Zribi 20


Example 6: Solution:
Write the following LP problem in the standard form
To write the LP model in the standard form, we need to
min z = 2x 1 3x 2 do the following changes:
subject to: 1) Add a surplus to the left side of the second
x1 x 2 10 constraint.

2x 1 3x 2 5 2) Add a slack to the left side of the third constraint.


" "
7 x 1 4x 2 6 3) Substitute x 1 x 1 x 1 , where x 1 , x 1 0 , in the
objective function and all the constraints.
x2 0
EE 477 Dr. Mohamed Zribi 21 EE 477 Dr. Mohamed Zribi 22

Thus we get the LPP in standard form as Example 7: Standard Form


min z = 2 x1 2 x1 3 x2
Subject to: Write in Standard Form:
maximize: z = x1 + x 2
x1 x1 x2 10
subject to: 2x1 + 3x2 ≤ 6
2 x1 2 x1 3 x2 s2 5
x1 + 7x2 ≥ 4
7 x1 7 x1 4 x2 s3 6 x1 + x2 = 3
x1 , x1 , x2 , s2 , s3 0 x1 ≥ 0, x2 ≥ 0
Define slack variables x3 ≥ 0 & x4 ≥ 0
EE 477 Dr. Mohamed Zribi 23 EE 477 Dr. Mohamed Zribi 24
Solution: Example 8: Standard Form

The problem now can be written: Write in the Standard Form:


maximize: z = x1 + x2 min Z x1 2 x2 3 x3
subject to: 2x1 + 3x2 + x3 =6 s.t. x1 x2 x3 7
x1 + 7x2 – x4 = 4
x1 x2 x3 2
x 1 + x2 =3
3 x1 x2 2 x3 5
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0
x1 0, x2 0
x3 unrestricted
2 3 1 0 6
A 1 7 0 1 b 4 c 1 1 0 0
T

1 1 0 0 EE 477 3
Dr. Mohamed Zribi
25
EE 477 Dr. Mohamed Zribi
26

Solution: Example 9:

Write in Standard Form:


min Z x1 2 x2 3 x4 3 x5 maximize: z = x1 + x2
s.t. x1 x2 x4 x5 x6 7 subject to: 2x1 + 3x2 ≤ 6
x1 + 7x2 ≥ 4
x1 x2 x4 x5 x7 2
x1 + x2 = 3
3 x1 x2 2 x4 2 x5 5 x1 ≥ 0, x2 ≥ 0
x1 , x2 , x4 , x5 , x6 , x7 0
Solution:
Define the variables x3 ≥ 0 and x4 ≥ 0

27 28
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
The problem now can be written:
minimize: zb = –x1 – x2
subject to: 2x1 + 3x2 + x3 =6
x1 + 7x2 – x4 = 4 2. Fundamentals of Linear
x 1 + x2 =3
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0 Programming
2 3 1 0 6 T
b 4 c 1 1 0 0
A 1 7 0 1
1 1 0 0 3

29
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi 30

Some Definitions Some Definitions


Convex set : A set of point S is a convex set if the Feasible solutions: A feasible solution is a solution
line segment joining any pair of points in S is for which all the constraints are satisfied.
wholly contained in S.
Infeasible solutions: A infeasible solutions is a
solution for which at least one constraints is
Extreme point: For any set S, a point P in S is an violated.
extreme point if each line segment that lies
Feasible region: The feasible region is the collection
completely in S and contains the point P as an end
of all feasible solutions.
point of the line segment. (also called corner
point).
EE 477 Dr. Mohamed Zribi 31 EE 477 Dr. Mohamed Zribi 32
Some Definitions Some Definitions

Corner point feasible solution (C.P.F.): A corner point Binding: A constraint is binding if the left-hand side and

feasible solution is a solution that lies at the corner of the right-hand side of the constraint are equal when
the optimal values of the decision variables are
the feasible region.
substituted into the constraint.
Relation between optimal solution and corner point
solution :
Unbinding: A constraint is unbinding if the left-hand
– The best C.P.F. solution is a optimal solution.
side and the right-hand side of the constraint are
– If more than one optimal solution, at least two are
unequal when the optimal values of the decision
C.P.F. solutions.
variables are substituted into the constraint.
EE 477 Dr. Mohamed Zribi 33 EE 477 Dr. Mohamed Zribi 34

The Fundamental Theorem of Linear


Implication of the Fundamental Theorem
Programming

Theorem: Given a linear program in the standard form,


where A is an m by n matrix of rank m.
Search in
n n!
1) If there is a feasible solution, then there is a basic feasible
solution; m m!(n m)!
basic feasible solutions
2) If there is an optimal feasible solution then there is an
optimal basic feasible solution.

EE 477 Dr. Mohamed Zribi 35 EE 477 Dr. Mohamed Zribi 36


36
Implication of the Fundamental Theorem Convexity of Feasible Region

Good news: We only need to search for the best feasible corner Convex Set Non-Convex Set
point
Bad news: A problem with 50 variables, 100 constraints =>

100 ! => ~ 1029 corner points


50 ! (100-50) !

Good news: We can use some of the properties to guide our S is a convex set if and only if for any two points, x and y,
searching of S, their convex combination, x + (1- )y, for all real
values 0 <= <= 1, is also in S.
EE 477 Dr. Mohamed Zribi 37
37 EE 477 Dr. Mohamed Zribi 38

Extreme Points Extreme Points


A point is called an extreme point (EP) if it cannot be
represented as a strict (0 < < 1) convex combination of
A point x in a convex set S is said to be
two other feasible points.
an extreme point of S if there are no two
distinct points x1 and x2 in S such that Remember: a convex combination of two points is a line
x x1 (1- )x2 for some and 0 1. between them.

So, an extreme point cannot be on a line of two other


feasible points.
EE 477 Dr. Mohamed Zribi 39
39 EE 477 Dr. Mohamed Zribi 40
Extreme Points Optimum & Extreme Points
Given a feasible region, an extreme point cannot lie on a
c
line between two other feasible points (it must be on a
corner) Starting Point

Feasible Not Extreme Points


Region

Extreme Point If we have a maximization problem, we want to go as


far in the direction of the c (objective function) vector
as we can
In a n-dimensional space, an extreme point is located at Can we determine anything about the location of the
optimum point?
the intersection of n constraints.
EE 477 Dr. Mohamed Zribi 41
41 EE 477 Dr. Mohamed Zribi 42

Optimum & Extreme Points Basic Feasible Solutions

c Now we have a solution to Ax = b. But that was just


one of two sets of constraints for the optimization
problem. The other was: xi ≥ 0, i = 1, …, n (non-
negativity)

If we start on a line, we can move along that line in the A basic feasible solution (BFS) is a basic solution where
direction of the objective function until we get to a every x is non-negative
corner A BFS satisfies all of the constraints of the optimization
In fact, for any c vector, the optimum point will always problem
be on a corner
EE 477 Dr. Mohamed Zribi 43 EE 477 Dr. Mohamed Zribi 44
Basic Feasible Solutions Theorem (Equivalence of extreme points
In a n-dimensional space, a BFS is formed by the and basic solutions)
intersection of n equations.
In 2-D:
Let A be an m n matrix of rank m and b an m-vector.
Basic Feasible
Solution Let K be the convex polytope consists of all n-vectors
Constraint 1 x satisfying
Constraint 2
Ax = b
x 0
But, we just saw that an extreme point is also a corner A vector is an extreme point iff x is a basic feasible solution.
point. So, a BFS corresponds to an EP.

EE 477 Dr. Mohamed Zribi 45 EE 477 Dr. Mohamed Zribi 46


46

Corollary: General Formulation of LP


r
min z x1 , x2 , , xr ci xi Convex function
If there is a finite optimal solution to a linear programming x
i 1

problem, there is a finite optimal solution which is an extreme subject to


r
point of the constraint set. a ji xi bj j 1, 2, ,m
Convex
i 1
region
r
a ji xi bj j m 1, m 2, ,p
Hence, the above theorem shows that it is necessary only to i 1

xi 0 i 1, 2, ,r
consider basic feasible solutions when seeking an optimal
solution to a linear program because the optimal value is
A local minimum is a global minimum.
always achieved at such a solution. The minimum must lie at the intersection
of several constraints, but not in the interior
EE 477 Dr. Mohamed Zribi 47 of the convex
EE 477region.
Dr. Mohamed Zribi 48
Puting it Together Simplex Method Introduction
We just saw that a basic feasible solution corresponds to an
The simplex method is the most common method for
extreme point.
solving LP problems.

This is very important because for LP problems, the


It works by finding a BFS; determining whether it is
optimum point is always at an extreme point.
optimal; and if it isn’t, it moves to a “better” BFS
until the optimal is reached.
Thus, if we can solve for all of the BFS’s (EP’s), we can
compare them to find the optimum.
This way, we don’t have to calculate every solution.
Unfortunately, this takesEE 477
too Dr.much
Mohamed time.
Zribi 49 EE 477 Dr. Mohamed Zribi 50

Optimization Equations

We have seen that the constraints can be written in the


form Ax b .
3. The General Solution We should have more variables than equations so that

of Ax = b we have some degrees of freedom to optimize.

– If the number of equations is more than or equal to


the number of variables, the values of the variables
are already specified.

EE 477 Dr. Mohamed Zribi 51


51 EE 477 Dr. Mohamed Zribi 52
52
General Solution of Ax=b General Solution of Ax =b

We call the dependent variables the basic variables


Given a system of equations in the form
because their A-matrix coefficients will form a basis.
Ax b
The independent variables will be called the nonbasic
– Assume m (number of equations) < n (number of variables.
variables) underspecified system
We can split the system into (n-m) independent variables
By changing the variables in the basis, we can change
and (m) dependent variables. The values of the
bases. It will be shown that this allows the
dependent variables will depend on the values we
choose for the independent variables. examination of different possible optimum points.
EE 477 Dr. Mohamed Zribi 53
53 EE 477 Dr. Mohamed Zribi 54
54

Remark: Basic Solutions


Given the set of m simultaneous linear equations
The solution obtained from a system in the standard form by
in n unkowns, i.e. A m n x b (1)
setting the non-basic variables to zero is called a basic Let B be any nonsingular m m submatrix made
solution (particular solution). of columns of A. Then, if all n - m components of
x NOT associated with the columns of B are set
A basic feasible solution is a basic solution in which the equal to zero, the solution to the resulting set of
equations is said to be a basic solution to (1) w.r.t.
values of the basic variables are nonnegative.
the basis B. The components of x associated with
the columns of B are called the basic variables.
Every corner point of the feasible region corresponds to a Am Bm | Nm
n m (n m)
basic feasible solution of the constraint equations. Thus,
x xTB | xTN
the optimum solution is a basic feasible solution.
xN 0 Bx B b
EE 477 Dr. Mohamed Zribi 55
55 EE 477 Dr. Mohamed Zribi 56
56
Example 10: Basic Solutions These two equations are inconsistent and hence no solution
exists. Hence x1 and x3 cannot form a basic solution and
Consider the following two equations with four unknowns:
hence they do not correspond to an extreme point.
2 x1 x2 4 x3 x4 2
x1 2 x2 2 x3 x4 3
Next consider the case where x3 and x4 are set to zero,
A basic solution is determined by setting two (4 - 2) of the
variables to zero and then solving for the other two variables, 2 x1 x2 2
provided that the resulting solution exists and is unique. x1 2 x2 3

If we set x2 and x4 to zero then the system reduces to


The unique solution ( x1 1 / 3, x2 4 / 3, x3 0, x4 0) defines a basic
2 x1 4 x3 2
solution and hence an extreme point of the LP solution space.
x1 2 x3 3
EE 477 Dr. Mohamed Zribi 57 EE 477 Dr. Mohamed Zribi 58
58

In this case, the variables x1 and x2 are referred to as basic


Example 11:
variables and the variables x3 and x4 are referred to as
Solve the following two linear equations:
nonbasic variables.
1) x1 x2 3 x3 x4 7
A basic solution is said to be feasible solution (BFS) if all its 2) 3 x1 7 x3 2 x4 x5 16
solution values are nonnegative.
Divide row 2 by 3.

If one or more of the basic variables is zero then the solution is


called degenerate basic feasible solution. 1) x1 x2 3 x3 x4 7
7 2 1 16
2) x1 x3 x4 x5
3 3 3 3
Multiply row 2 by –1 and add to row 1.
EE 477 Dr. Mohamed Zribi 59 EE 477 Dr. Mohamed Zribi 60
Solution: 16 5
x1 , x2 , x3 0, x4 0, x5 0
3 3
2 1 1 5
1) x2 x3 x4 x5 is referred to as a basic solution since all non-basic variables
3 3 3 3
have been set to 0.
7 2 1 16
2) x1 x3 x4 x5
3 3 3 3 This solution is also referred to as a basic feasible solution
(BFS) since all basic variables are non-negative.
16 5
Solution: x1 , x2 , x3 0, x4 0, x5 0
3 3
Every corner point of the feasible region corresponds to a basic
Feasible solution – fundamental building block for the
x1 and x2 are basic variables; x3 , x4 and x5 are non-basic variables simplex method.
EE 477 Dr. Mohamed Zribi 61 EE 477 Dr. Mohamed Zribi 62

Theorem: Remark:

A basic feasible solution is a vertex or corner of the A vertex of a feasible region X is called an extreme point of X.
Formally, xϵX is an extreme point of X if and only if there
feasible region. Conversely, a vertex of a feasible
are no points x1 and x2 in X such that x lies in the line
region is a basic feasible solution.
segment joining x1 and x2.
– Dantzig (1963).

A basic feasible solution is called nondegenerate if and only if all


its basic variables are positive; otherwise, it is called
degenerate.

EE 477 Dr. Mohamed Zribi 63 EE 477 Dr. Mohamed Zribi 64


64
Remark: Example 12:
Consider the equations
If all basic feasible solutions are nondegenerate, then each basic
2 x1 x2 4 x3 x4 2
feasible solution corresponds to one and only one vertex of x1 2 x2 2 x3 x4 3
the feasible set. But if there is a degenerate basic feasible
solution, then several different degenerate basic feasible when the nonbasic variables are x1 and x2, hence the equations

solutions correspond to the same vertex. become 4 x3 x4 2

2 x3 x4 3

The basic solution is such: ( x1 0, x 2 0, x3 1 / 2, x 4 4)


If an LP has an optimal solution, then there is an optimal
solution that is a basic feasible solution. This basic solution is not feasible because x3 is negative.

EE 477 Dr. Mohamed Zribi 65 EE 477 Dr. Mohamed Zribi 66

Example 13: Example 14: Pivots


Consider the equations
x1 x2 x3 2 x4 3
Consider the following system:
3 x1 x2 2 x3 x4 6

when the nonbasic variables are x1 and x2, hence the equations
x1 + x 4 + x 5 - x 6 = 5
become x 2 + 2x 4 - 3x 5 + x 6 = 3
x3 2 x4 3
x 3 - x 4 + 2x 5 - x 6 = -1
2 x3 x4 6

The basic solution is such: ( x1 0, x2 0, x3 3, x4 0)


The solution (5, 3, -1, 0, 0, 0) is a basic solution for the system.
The solution is degenerate because x4=0.

EE 477 Dr. Mohamed Zribi 67 EE 477 Dr. Mohamed Zribi 68


We want to find the basic solution having basic variables x4, x5 x1 x2 x3 x4 x5 x6 b
and x6. We form the following tableau 1 0 0 1 1 1 5
2 1 0 0 5 3 7
1 0 1 0 3 2 4
x1 x2 x3 x4 x5 x6 b
1 0 0 1 1 -1 5 Now let's replace x2 by x5
0 1 0 2 -3 1 3
x1 x2 x3 x4 x5 x6 b
0 0 1 -1 2 -1 -1 3 1 0 1 0 2 18
5 5 5 5

Let's replace x1 by x4 as a basic variable. 2


5
1
5 0 0 1 3
5
7
5

We obtain the following:


1
5
3
5 1 0 0 1
5
1
5

EE 477 Dr. Mohamed Zribi 69


69 EE 477 Dr. Mohamed Zribi 70
70

Finally, let's replace x3 by x6


The non-negativity of the solution will not in general be
x1 x2 x3 x4 x5 x6 b preserved.
1 -1 -2 1 0 0 4
1 -2 -3 0 1 0 2 The pivot must be selected carefully so that we may transfer from
1 -3 -5 0 0 1 1 one basic feasible solution to another.

The new basic solution is (0, 0, 0, 4, 2, 1)


Example 15:
Consider the following system:
Therefore, the pivot operation can generate a new basic solution
x1 x2 x3 x4 x5 x6 b
from an old one by replacing one basic variable by a nonbasic 1 0 0 2 4 6 4
variable. 0 1 0 1 2 3 3
0 0 1 -1 2 1 1

which has a basic feasible solution x=(4,3,1,0,0,0).


EE 477 Dr. Mohamed Zribi 71
71 EE 477 Dr. Mohamed Zribi 72
Suppose that we elect to make a basic variable. To determine The new tableau is such,

which element in the fourth column is the appropriate pivot,


x1 x2 x3 x4 x5 x6 b
we compute the three ratios: 1
2 0 0 1 2 3 2
4/2=2, 3/1=3, 1/-1=-1 1
2 1 0 0 0 0 1
1
2 0 1 0 4 4 3
and select the smallest nonnegative ratio.
Hence the corresponding basic feasible solution is
Hence 2 is chosen as the pivot element. x=(0, 1, 3, 2, 0, 0).

EE 477 Dr. Mohamed Zribi 73


73 EE 477 Dr. Mohamed Zribi 74
74

Example 16: Motivation Example 1


How many tons of regular and premium gas to produce in order
to maximize weekly profit?

Products
4. Motivation of the Resource Regular Premium Resource
Availability

Simplex Method Raw gas

Production
7 m3/ton

10 hr/ton
11 m3/ton

8 hr/ton
77 m3/week

80 hr/week
time

Storage 9 ton 6 ton

Profit $150/ton $175/ton

EE 477 Dr. Mohamed Zribi 75


75 EE 477 Dr. Mohamed Zribi 76
76
Solution: Graphical Solution

Feasible region (the shaded area)


Let x1 = 1 ton of regular gas
contains all points that obey the
x2 = 1 ton of premium gas
constraints or points that represent
Maximize z = 150x1 + 175x2 the feasible solutions.
subject to
7x1 + 11x2 ≤ 77 (material constraint) (1)
Points located outside of this area
10x1 + 8x2 ≤ 80 (time constraint) (2)
are known as infeasible solution.
x1 ≤ 9 (regular gas storage) (3)
x2 ≤ 6 (premium gas storage) (4)
x1, x2 ≥ 0 (non-negativity) (5, 6)

78
EE 477 Dr. Mohamed Zribi 77 EE 477 Dr. Mohamed Zribi

We can adjust the line Some insights:


representing the objective Increasing storages
function z = 150x2 + 175x2 to ( constraints (3) and (4)) does not
locate the optimum point. improve profit.

One of the corner points (points Raising either materials or


where two or more lines intersect) production time can improve
will be an optimum point. profit.
– Corner points can be
feasible or infeasible
79 80
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Possible outcomes that can generally be obtained in a LP
problem:
1. Unique solution. The maximum objective function
intersects a single point.

2. Alternate solutions. Problem has an infinite


number of optima corresponding to a line segment.
Unique solution – represented by a corner point
Alternate solutions – represented by points on one of the
3. No feasible solution. constraint line

(b) No feasible solution


4. Unbounded problems. Problem is under-
constrained and therefore open-ended. (c) Unbounded problems
82
EE 477 Dr. Mohamed Zribi 81 EE 477 Dr. Mohamed Zribi

Key properties of LP that drives the design of


Simplex Method
1. The optimum point is always at a feasible
corner point.
– We only need to check the corner points.
2. If a corner point feasible solution has an objective function value
that is better that or equal to all adjacent corner point feasible
solutions, then it is optimal.
– We don't necessarily need to search all corner points.

Basic idea behind the Simplex method


3. There are finite number of corner point feasible solutions. Starting at a feasible corner point solution.
– Any method that checks only corner points will terminate Repeatedly move to a better adjacent corner point feasible solution
until an optimum point is found.
eventually.
84
EE 477 Dr. Mohamed Zribi 83 EE 477 Dr. Mohamed Zribi
Finding Corner Points Algebraically First, constraint equations are reformulated as equalities by
introducing slack variables – variables that measures how
How to find corner points algebraically? much of a constrained resource is available.
How to locate adjacent corner points?
Maximize z 150x 1 175x 2 Maximize z 150x 1 175x 2
How to decide which adjacent point to move to next?
subject to subject to
7x 1 11x 2 77 7x 1 11x 2 s1 77
Simplex method offers a neat solution (involves the use 10x 1 8x 2 80 10x 1 8x 2 s2 80
x1 9 x1 s3 9
of slack variables) to address these questions. x2 6 x2 s4 6
x 1, x 2 0 x 1 , x 2 , s1 , s 2 , s 3 , s 4 0
Slack variables
si > 0 means the corresponding resource is not fully consumed.
si < 0 means the corresponding resource is over-consumed.

EE 477 Dr. Mohamed Zribi 85 EE 477 Dr. Mohamed Zribi 86


86

Augmented System Augmented System

Adding slack variables results in an augmented system of linear To solve an augmented system with
equations which is under specified (has more unknowns than – 6 unknowns (= 2 original variables + 4 slack variables)
equations). – 4 equations
– 6 unknowns (= 2 original variables + 4 slack variables) We need to set 2 of the variables constants before we can solve
– 4 equations the system of equations.

e.g., Setting x1 = 0, x2 = 0 yields

In general, if a LP problem has n variables and m constraints, the 7x 1 11x 2 s1 77 s1 77


resulting augmented system will have a total of (n original 10x 1 8x 2 s2 80 s2 80
variables + m slack variables) and m equations. x1 s3 9 s3 9
x2 s4 6 s4 6

EE 477 Dr. Mohamed Zribi 87 EE 477 Dr. Mohamed Zribi 88


88
s1 77 Augmented System:
s2 80
An augmented solution which corresponds to a corner point is also known
s3 9 as a basic solution.
s4 6 – The augmented solution x1=0, x2=0, s1=77, s2=80, s3=9,
Solving the resulting system yields x1=0, x2=0, s1=77, s2=80, s3=9, s4=6, which s4=6 is a basic solution. It corresponds to corner point A.
represent one of the augmented solutions – values of all (original + slack) – In addition, it is a basic feasible solution because all
variables are given. variables ≥ 0.
For this example, the values tell us that if we don't produce any regular (x1) or
premium (x2) gas, we would have the following amount of unconsumed resources: So far, you know how to find an augmented solution.
– 77 m3 of raw gas, – How should we set the variables so that the augmented
– 80 production hours solution is a basic solution?
– 9 ton of regular gas storage
– 6 ton of premium gas storage

EE 477 Dr. Mohamed Zribi 89 EE 477 Dr. Mohamed Zribi 90

Characteristics of Slack Variables Characteristics of Slack Variables

The equations (or constraints) have a one-to-one relationship with


the slack variables. Setting two variables to zero has the effect of "selecting two
– For example, s1 relates to the 1st equation, s4 relates to the 4th lines", and solving the resulting system means finding the
equation. intersecting point (a corner point) of the selected lines.

If a point is on the line 7x1 + 11x2 = 77 (line labeled "1"), what's the
For example, let s1=0, s2=0. Then the system becomes
value of s1?
7x 1 11x 2 77
10x 1 8x 2 80
If a point is on the line 10x1 + 8x2 = 80 (line labeled "2"), which
x1 s3 9
variable has the value zero?
x2 s4 6

At the corner point D, which variables have the value zero? The value of x1 and x2 of this system is the coordinate of the
corner point C (the point where line "1" and line "2" intersect.)
EE 477 Dr. Mohamed Zribi 91 EE 477 Dr. Mohamed Zribi 92
Maximize Z 150x 1 175x 2
Finding Corner Points Algebraically
subject to
7x 1 11x 2 s1 77
F
We now know how to find the corner points. 10x 1 8x 2 s2 80
x1 s3 9
x2 s4 6
Next x 1 , x 2 , s1 , s 2 , s 3 , s 4 0
How to find an adjacent corner point? E D 4

1
How to decide which adjacent corner point to move to?
C
5 3

A 6 B
EE 477 Dr. Mohamed Zribi 93 94 EE 477 Dr. Mohamed Zribi 94

Basic and Non-Basic Variables Basic and Non-Basic Variables


If two points are adjacent corner points, then
Corner Non-Basic Basic Some of the Do you see a pattern
Adjacent – Their basic sets are identical except for one member.
Point Variables Variables between any pair of
Corner Points
adjacent corner points? – Their non-basic sets are identical except for one
A x 1, x 2 s1, s2, s3, s4 B, E member.
B x 2, s 2 x1, s1, s3, s4 A, C
C s1, s2 x1, x2, s3, s4 B, D
The reverse of the above statement is not always true. (e.g., F and A)
D s1, s4 x1, x2, s2, s3 C, E
E x 1, s 4 x2, s1, s2, s3 A, D
Questions:
F x 1, s 2 x2, s1, s3, s4
– To find an adjacent corner point, can we just switch
one variable between the basic and non-basic sets?
Variables in which their values are set to zero are called non-basic
variables.
– How should we decide which corner point to move
Remember: Non-basic, variable set to zero, corresponding constraint is
active to next?
EE 477 Dr. Mohamed Zribi 95 EE 477 Dr. Mohamed Zribi 96
96
Basic and Non-Basic Variables Which variables to switch?

How do we make sure the following conditions are All three conditions from the previous slide can be satisfied if the
satisfied? following steps are taken:

Selecting an entering basic variable – a non-basic variable that will


– The corner points are adjacent.
increase the objective function value the most if allowed to take

– The corner points are feasible. on a positive value. Move this variable from the non-basic set to
the basic set.
– The new corner point gives better value for the
objective function than the current corner point. Finding the leaving basic variable – a basic variable that is forced
to a value zero first after allowing the entering basic variable to
increase. Move the variable that is forced to zero from the basic
set to the non-basic set.
EE 477 Dr. Mohamed Zribi 97 EE 477 Dr. Mohamed Zribi 98

Which variables to switch? Which variables to switch?

Maximize z 150x 1 175x 2 Maximize z 150x 1 175x 2


subject to subject to
7x 1 11x 2 s1 77 11x 2 s1 77
10x 1 8x 2 s2 80 8x 2 s2 80
x1 s3 9 s3 9
x2 s4 6
x2 s4 6
x 1 , x 2 , s1 , s 2 , s 3 , s 4 0
x 1 , x 2 , s1 , s 2 , s 3 , s 4 0
Suppose we are currently at point A. x2 has a larger coefficient in the objective function, so we
Basic set = { s1, s2, s3, s4 }, non-basic set = { x1, x2 } should make x2 the entering basic variable. (x1 remains a
Which variable should be the entering basic variable? non-basic variable and has the value zero)

If we keep increasing x2, other basic variables will


Which variable should be the leaving basic variable? decrease. Which basic variable will become zero first?
EE 477 Dr. Mohamed Zribi 99 EE 477 Dr. Mohamed Zribi 100
Which variables to switch? Which variables to switch?
Minimum
Maximize z 150x 1 175x 2 ratio test
subject to So setting x1=0, s4=0 and solve the system of equations
11x 2 s1 77 (77 /11 7)
8x 2 s2 80 (80 / 8 10) would yield an augmented solution correspond to point E.
s3 9 N/A
x2 s4 6 (6 /1 6)
x 1 , x 2 , s1 , s 2 , s 3 , s 4 0
Solving the system of equations at every corner point is not
If we take the ratio of the RHS value to the coefficient of the
very efficient. Simplex method offers an efficient way to
entering basic variable (x2), the smallest non-negative ratio can tell
us which basic variable will reach zero first if we keep increasing the
compute the value of each variable by updating the

value of x2. equations incrementally.


So s4 should be made the leaving basic variable.
EE 477 Dr. Mohamed Zribi 101 EE 477 Dr. Mohamed Zribi 102

Maximize Z 150x 1 175x 2


subject to Example 17: Motivation Example 2
7x 1 11x 2 s1 77
F
10x 1 8x 2 s2 80
x1 s3 9
x2 s4 6
x 1 , x 2 , s1 , s 2 , s 3 , s 4 0 Original Standard form
Maximize Maximize
E D 4
z( x, y) = 15 x + 10y Z = 15 x1 + 10x2
1 subject to
subject to
2x + y ≤ 1500 2x1 + x2 + x3 = 1500
C x + y ≤ 1200 x1 + x2 + x4 = 1200
5 3 x ≤ 500 x1 + x5 = 500
x ≥ 0,
y≥0 xi ≥ 0 for all i.
2

Original problem: n variables, m constraints


Standard form: (m+n ) variables, m constraints
A 6 B
103 EE 477 Dr. Mohamed Zribi 103 EE 477 Dr. Mohamed Zribi 104
Solution:
Important Property 1: If only one optimum solution
y Boundary Feasible Solution
x≥ 0

1500
=> must be a corner point

Corner points 1000 y


y
1500
500 1500
y≥ 0
Feasible
region 1000
1000
x
(0,0) 500 1000 1500
500
x + y ≤ 1200 500 Feasible
Feasible region
x ≤ 500 region

(0,0) 500 1000 1500 x


2x+y ≤ 1500 (0,0) 500 1000 1500 x

EE 477 Dr. Mohamed Zribi 105 EE 477 Dr. Mohamed Zribi 106

Important Property 2: If multiple optimum solutions Important Property 3: If a corner point is better than
=> must include 2 adjacent corner points all its adjacent corners, it is optimal !
y

1500
y

1500 1000

1000 500
Feasible
region
500
Feasible (0,0) 500 1000 1500 x
region

(0,0) 500 1000 x


1500
Important Property 4: Total number of corner points is finite
EE 477 Dr. Mohamed Zribi 107 EE 477 Dr. Mohamed Zribi 108
y
Example 18: Motivation Example 3
x2 Max
1500 z = 15 x1 + 10x2
S.T.
1500 2x1 + x2 + x3 = 1500
1000 x1 + x2 + x4 = 1200
x1 + x5 = 500
1000 xi ≥ 0 for all i.
500
Feasible 500
region

x x1
(0,0) 500 1000 1500 (0,0) 500 1000 1500
x1 + x2 = 1200
x1 = 500
Note: Corner point => intersection of some constraint boundaries (lines)
2x1+x2 = 1500

Important Property 5: Moving from a corner point


to any adjacent corner point => Exactly one
constraint boundaryEEis477 changed.
Dr. Mohamed Zribi 109 EE 477 Dr. Mohamed Zribi 110

Max Max
z = 15 x1 + 10x2 z = 15 x1 + 10x2
S.T. S.T.
2x1 + x2 + x3 = 1500 2x1 + x2 + x3 = 1500
x1 + x2 + x4 = 1200 x1 + x2 + x4 = 1200
x1 + x5 = 500 x1 + x5 = 500
xi ≥ 0 for all i. xi ≥ 0 for all i. Corner Defining eqns Basic solution non-basic
Feasible variables
x2 solution

(0, 0) x1 = 0 (0, 0, 1500, 1200, 500) x 1, x 2


x2 x2 = 0
1500 Basic solution Augmented, corner-point solution
(500, 0) x1 = 500 (500, 0, 500, 700, 0) x 2, x 5
1500
1000 x2 = 0
basic infeasible solution : ( 500, 700, -200, 0, 0)
1000
(500, 500) x1 = 500 (500, 500, 0, 200, 0) x 5, x 3
500 basic feasible solution: (500, 0, 500, 700, 0) 2x1+x2= 1500
500

x1 (300, 900) x1+ x2 = 1200 (300, 900, 0, 0, 200) x 3, x 4


(0,0) 500 1000 1500 x1 2x1+x2= 1500
(0,0) 500 1000 1500
x1 + x2 = 1200
x1 + x2 = 1200
x1 = 500 (0, 1200) x1 = 0 (0, 1200, 300, 0, 500) x 4, x 1
x1 = 500
x1+ x2 = 1200
2x1+x2 = 1500 2x1+x2 = 1500
EE 477 Dr. Mohamed Zribi 111 EE 477 Dr. Mohamed Zribi 112
Max
x2
z = 15 x1 + 10x2
S.T.
2x1 + x2 + x3 = 1500 Initial non-basic variables: (x1, x2) 1500
x1 + x2 + x4 = 1200 ( 0, 0)
x1 + x5 = 500
xi ≥ 0 for all i. 1000

Corner Defining eqns Basic non-basic Initial basic variables: (x3, x4 , x5)
infeasible infeasible variables 500
Solution solution
x2
x1
(750, 0) x2 = 0 (750, 0, 0, 450, -250) x2, x3 (0,0) 500 1000 1500
2x1+ x2 = 1500 x1 + x2 = 1200
1500 x1 = 500
(1200, 0) x2 = 0 (1200, 0, -900, 0, -700) x2, x4 2x1+x2 = 1500
1000 x1 + x2 = 1200
Max z= 15 x1 +10 x2
500
S.t. 2 x1 + x2 + x3 = 1500
(500, 700) x1 + x2 = 1200 (500, 700, -200, 0, 0) x4, x5 x1 + x2 + x4 = 1200
x1 = 500 x1 + x5 = 500
x1
(0,0) 500 1000 1500 xi ≥ 0 for all i.
x1 + x2 = 1200 (0, 1500) x1 = 0 (0, 1500, 0, -300, 500) x1, x3 Initial BFS: (0, 0, 1500, 1200, 500)
x1 = 500 2x1+ x2 = 1500
2x1+x2 = 1500 EE 477 Dr. Mohamed Zribi 113 EE 477 Dr. Mohamed Zribi 114

x2 x2

1500 1500

1000 1000

Entering variable:
500 500
z = 15 x1 + 10x2
x1 x1
(0,0) 500 1000 1500 (0,0) 500 1000 1500
x1 + x2 = 1200 x1 + x2 = 1200

Fastest rate of ascent x1 = 500 x1 = 500

2x1+x2 = 1500 2x1+x2 = 1500

Basic Feasible Solution: ( 500, 0, 500, 700, 0)

Objective value: 7500

EE 477 Dr. Mohamed Zribi 115 EE 477 Dr. Mohamed Zribi 116
After row operations:

Z +5 x3 + 5x4 = 13,500
x2 - x3 + 2x4 = 900
- x3 + x4 + x5 = 200
x1 + x3 - x4 = 300

x2 x2

1500 1500

1000 1000
Basic Feasible Solution:
500 500

Basic Feasible Solution: ( 500, 500, 0, 200, 0) ( 300, 900, 0, 0, 200)


x1 x1
(0,0) 500 1000 1500 (0,0) 500 1000 1500
x1 + x2 = 1200 x1 + x2 = 1200
x1 = 500 x1 = 500
Have we found the OPTIMUM ? Have we found the OPTIMUM ?
EE 477 Dr. Mohamed Zribi 117 EE 477 Dr. Mohamed Zribi 118
2x1+x2 = 1500 2x1+x2 = 1500

Example 19: Solution:

x2
minimize:
z = -2x1 - 3x2
subject to: An intersection
x1 – 2x2 ≤ 4 z = -2x1 – 3x2 of 5 half-spaces
2x1 + x2 ≤ 18
x2 ≤ 10
x1, x2 ≥ 0
x1

EE 477 Dr. Mohamed Zribi 119 EE 477 Dr. Mohamed Zribi 120
Corner Corner

basic variables free variables 1 0 0 -.5 -1 -2


0 1 0 2.5 1 20
1 0 0 1 -2 4 0 0 1 .5 1 12
x5 0 1 0 2 1 18 x5 0 0 0 -3.5 -3 -6
0 0 1 0 1 10 x2 x4 x5 x1 x3
x1 x4 0 0 0 -2 -3 0 x1 x4
x3 x3 x4 x5 x1 x2 x3
x2 x2
Exchange free/basic variables by
swapping columns, using GE to restore
free variables indicate corner
to tableau format. (“corner” not
necessarily feasible)

EE 477 Dr. Mohamed Zribi 121 EE 477 Dr. Mohamed Zribi 122

Corner Corner

1 0 0 1 -2 4 1 0 0 .2 .4 8

x5 0 1 0 -2 5 10 x5 0 1 0 -.4 .2 2
0 0 1 0 1 10 0 0 1 .4 -.2 8
x1 x4 0 0 0 2 -7 8 x1 x4 0 0 0 -.8 1.4 22
x3 x1 x4 x5 x3 x2 x3 x1 x2 x5 x3 x4
x2 x2

EE 477 Dr. Mohamed Zribi 123 EE 477 Dr. Mohamed Zribi 124
Corner Remark: The Simplex Tableau

This tableau consists of the augmented matrix


1 0 0 .5 -2.5 -5
corresponding to the constraint equations together
x5 0 1 0 .5 .5 9
0 0 1 0 1 10 with slack variables and the objective function in
x1 x4 0 0 0 1 -2 18
x3 x1 x5 x4 x2 the following form
x3
x2
c1 x1 c2 x2 cn xn (0) s1 (0) s2 (0) sm z 0
Note that in general there are
n+m choose m corners

EE 477 Dr. Mohamed Zribi 125 EE 477 Dr. Mohamed Zribi 126

Example 20: Solution:

x1 x2 x3 x4 x5
minimize:
1 -2 1 0 0 4 x1 – 2x2 + x3 = 4
z = -2x1 - 3x2
2 1 0 1 0 18 2x1 + x2 + x4 = 18
subject to: 0 1 0 0 1 10 x2 + x5 = 10
x1 – 2x2 ≤ 4 -2 -3 0 0 0 0 z = -2x1 – 3x2
2x1 + x2 ≤ 18
x5
x2 ≤ 10
x1, x2 ≥ 0 x1 x4
Solution: (x1 , x2 ) = (0, 0)
x3
x2

x1 = x2 = 0 (start)
EE 477 Dr. Mohamed Zribi 127 EE 477 Dr. Mohamed Zribi 128
18

x1 = 4,
1 0 1 0 0 24 10 x2 = 10
18 0 0 1 -.5 2.5 20 x5
2 0 0 1 -1 8
0 1 0 0 1 10 1 0 0 .5 -.5 4 x1 x4
x1 = 0, x2 = 10
-2 0 0 0 3 30 10 0 1 0 0 1 10 x3
x5 x2
0 0 0 1 2 38
x1 x4 -2
x3
x2
Solution: (x1 , x2 ) = (0, 10) Solution: (x1 , x2 ) = (4 10)
-2
Solution is optimal

EE 477 Dr. Mohamed Zribi 129 EE 477 Dr. Mohamed Zribi 130

Example 21: Motivation Example 4 Step 1:

min z 3x 1 2x 2 Convert all inequality constraints to the form


s .t . in which the RHSs are positive.
x 1 2x 2 4
3x 1 2x 2 14 x1 2 x2 4
x1 x 2 3 3x1 2 x2 14
x 1, x 2 0 x1 x2 3

EE 477 Dr. Mohamed Zribi 131


131 EE 477 Dr. Mohamed Zribi 132
Step 2:
Step 3:

m number of basic variables


Introduce slack/surplus variables and convert = number of constraints
the inequality constraints to equality constraints n m number of non-basic variables
x1 2 x2 x3 4 x3 x1 2 x2 4
3x1 2 x2 x4 14 x4 3 x1 2 x2 14
x1 x2 x5 3 x5 x1 x2 3
z 3x1 2 x2 0x1 and x2 are selected as
non-basic variables

x3 4, x4 14, x5 3, z 0
EE 477 Dr. Mohamed Zribi 133 EE 477 Dr. Mohamed Zribi 134

Step 4: select new basic and non-basic variables Which one of x3, x4, x5 should be selected as the new non-basic
variables?
z 3x1 2x2 0
new basic variable The limiting value for x1 can be calculated analytically
Examine the coefficients in z to determine which variable for each equation by bi /ai1 , i.e. - 4, 14 / 3 and 3.
(x1 or x2 ) decreases the value of the objective function when
The limiting constraint is the one for which the ratio
the variable is increased from zero. As a general rule, it
is positive and has the smallest value.
is advantageous to select as a new basic variable which has
the largest positive coefficient in the objective function. Thus,

x2 remains at zero
x1 increases from zero to a positive number
EE 477 Dr. Mohamed Zribi 135 EE 477 Dr. Mohamed Zribi 136
Step 5: Transformation of the Equations

New basic variables: ( x1, x3, x4 ) x3 x1 2 x2 4 x3 x2 x5 7


New non-basic variables: ( x2 , x5 ) x4 3 x1 2 x2 14 x4 5 x2 3 x5 5
x5 x1 x2 3 x1 x2 x5 3
The transformation can be achieved by substituting x1
as a function of x2 and x5 (the new non-basic variables). z 3 x1 2 x2 0 z 5 x2 3 x5 9
=0
Let
x1 3 x2 x5
EE 477 Dr. Mohamed Zribi 137 EE 477 Dr. Mohamed Zribi 138

Repeat step 5 by Gauss-Jordan elimination Write in terms of the augmented matrix


N N B B B

Original System: -1 2 1 0 0 4
x1 3 2 0 1 0 14
-1 2 1 0 0 x2 4 1 1 0 0 1 3 Step 4: Pivot Row
Select the smallest positive ratio
3 2 0 1 0 x3 14
3 2 0 0 0 0 bi/ai

1 1 0 0 1 x4 3
Step4: Pivot Column
3 2 0 0 0 x5 0 Select the largest positive element in the objective function.

Pivot element

EE 477 Dr. Mohamed Zribi 139 EE 477 Dr. Mohamed Zribi 140
By elementary row operation
Repeat Iteration
0 1 1 0 1 7
0 5 0 1 3 5 x1 x2 x3 x4 x5 b
1 -1 0 0 1 3 x3 0 0 1 -1/5 8/5 6
0 5 0 0 3 9 x2 0 1 0 1/ 5 3/5 1
x1 1 0 0 1/ 5 2/5 4
To do a better job in book-keeping,
0 0 0 1 0 14
a "tableau" can be used
An increase in x4 or x5 does not reduce f
x1 x2 x3 x4 x5 b
x3 0 1 1 0 1 7 x1* 4, x2* 1, x3* 6, z * 14
Basic variables x4 0 5 0 1 3 5
x1 1 -1 0 0 1 3 Note that the coefficient of x5 is zero.
0 5 0Dr. Mohamed
EE 477
0 3Zribi 9 141 EE 477 Dr. Mohamed Zribi 142

Remark
x1 x 2 x3 x4 x5 b
x5 0 0 5/8 -1/8 1 15/4
x2 0 1 3 / 8 1/ 8 0 13 / 4
x1 1 0 1/ 4 1/ 4 0 5/ 2
0 0 0 1 0 14 5. The Simplex Algorithm

x 1* 5 / 2, x 2* 13 / 4, x 5* 15 / 4, z * 14

Alternative solution! EE 477 Dr. Mohamed Zribi 143 EE 477 Dr. Mohamed Zribi 144
The Simplex Method The Simplex Method

The simplex method is an iterative computational When decision variables are more than 2, it is always advisable to
procedure used to determine the optimum solution of use the Simplex Method to avoid lengthy graphical procedure.
an LP problem.
The simplex method is not used to examine all the feasible

The idea of the simplex method is to proceed from one solutions.

basic feasible solution to another in such a way as to


It deals only with a small and unique set of feasible solutions, the
continually decrease the value of the objective
set of vertex points (i.e., extreme points) of the convex feasible
function until a minimum is reached.
space that contains the optimal solution.

EE 477 Dr. Mohamed Zribi 145 EE 477 Dr. Mohamed Zribi 146

Overview of the Simplex Method Geometric View of Canonical Form


– An iterative algebraic procedure A polytope in n-dimensional space
– Graphic analysis gives insight into the logic
Each inequality corresponds to a half-space.
– The initial feasible solution starts at a corner point
– Subsequent iterations result in improved intermediate
The “feasible set” is the intersection of the half-spaces
solutions This corresponds to a polytope
– In general, a corner point has no more than m variables
Polytopes are convex: if x,y is in the polytope, so is the
greater than 0, where m is the number of constraints
line segment joining them.
– When no further improvement is possible, the optimal
solution has been found and the algorithm stops The optimal solution is at a vertex (i.e., a corner).

EE 477 Dr. Mohamed Zribi 147 EE 477 Dr. Mohamed Zribi 148
Geometric View of Canonical Form Geometric View of Canonical Form
x2
minimize: A polytope in n-dimensional space
x2 ≤ 10
z = -2x1 - 3x2 Each inequality corresponds to a half-space.
Feasible
subject to: Set The “feasible set” is the intersection of the half-spaces.
x1 – 2x2 ≤ 4
Direction
Corners This corresponds to a polytope
2x1 + x2 ≤ 18 of “Goodness”

x2 ≤ 10 Objective The optimal solution is at a corner.


Function
x1, x2 ≥ 0 -2x1 – 3x2

An intersection of 5 x1 Simplex moves around on the surface of the polytope


half-spaces
x1 – 2x2 ≤ 4 2x1 + x2 ≤ 18
Interior-Point methods move within the polytope
EE 477 Dr. Mohamed Zribi 149 EE 477 Dr. Mohamed Zribi 150

Simplex Algorithm Steps Involved in The Simplex Method

Find a corner of the feasible region 1. Locate an extreme point of the feasible region.
Repeat 2. Examine each boundary edge intersecting at this point
A. For each of the n hyperplanes intersecting at the to see whether movement along any edge increases the
corner, calculate its reduced cost value of the objective function.
B. If they are all non-negative, then done 3. If the value of the objective function increases along
C. Else, pick the most negative reduced cost any edge, move along this edge to the adjacent extreme
This is called the entering plane point. If several edges indicate improvement, the edge
D. Move along corresponding edge (i.e. leave that providing the greatest rate of increase is selected.
hyperplane) until we reach the next corner (i.e. reach 4. Repeat steps 2 and 3 until movement along any edge no
another hyperplane) longer increases the value of the objective function.
The new plane is called the departing plane
EE 477 Dr. Mohamed Zribi 151 EE 477 Dr. Mohamed Zribi 152
The Simplex Algorithm Simplex Method Steps
Step 1 Convert the LP to standard form.
Step 1: Using slack/surplus variables, convert the LP
Step 2 Obtain a BFS (if possible) from the standard form. problem to a system of linear equations.
Step 2: Set up the initial tableau.
Step 3 Determine whether the current BFS is optimal.
Step 3: Select the pivot column.
Step 4 If the current BFS is not optimal, then determine which Step 4: Select the pivot in the pivot column.
nonbasic variable should become a basic variable and which
basic variable should become a nonbasic variable to find a new Step 5: Use the pivot to clear the pivot column in the normal
BFS with a better objective function value. (pivot operation) manner. This gives the next tableau.

Step 5 Use Elementary Row Operations to find the new BFS Repeat Steps 3-5 until there are no more negative numbers in
with the better objective function value. Go back to step 3. the bottom row (with the possible exception of the Answer
column).
EE 477 Dr. Mohamed Zribi 153 EE 477 Dr. Mohamed Zribi 154

Simplex Method Summarized

Step 1: Write the standard maximization problem in


standard form with slack variables.

Yes Step 2: Are there any Stop. The optimal


6. Examples of the Simplex
Step 3: Select the No
pivot column negative indicators in the solution has been
bottom row? found.

Method
Step 5: Select the pivot
Step 4: Are there any Yes element and perform the
positive elements in the pivot operation.
pivot column above the
dashed line?
No
Stop. The linear programming problem has no
optimal solution.
EE 477 Dr. Mohamed Zribi 155 EE 477 Dr. Mohamed Zribi 156
The first thing we need to do is to set up the initial simplex tableau
Example 22:
x1 x2 s1 s 2 s3 s 4 b
Find a solution for the following problem using the simplex 1 2 1 0 0 0 6
method. 2 1 0 1 0 0 8
-1 1 0 0 1 0 1
0 1 0 0 0 1 2
maximize z = 3x1 + 2x 2 -3 -2 0 0 0 0 0
Subject to: The initial tableau correspond to the starting basic solution of the
x1 + 2x 2 6
model. The basic feasible solution can be easily read from the
2x1 + x 2 8 tableau as x=(0,0,6,8,1,2).
x 2 - x1 1
x2 2 The corresponding value of the objective function is
x1 0 and x 2 0 z=3*0+2*0+0*6+0*8+0*1+0*2=0.

EE 477 Dr. Mohamed Zribi 157 EE 477 Dr. Mohamed Zribi 158

Note that the last row of the simplex tableau contains the If some of the cost coefficients are negative, then an
coefficients of the objective function = relative cost improvement can be made.
coefficients ( r1, r2,…, rn) and the value of the objective
function.
When more than one of the relative cost coefficients is

The relative cost coefficients rj indicate whether the value


negative, any of them may be selected to determine in
of the objective function will increase or decrease if xj is which column to pivot. Common practice is to
pivoted into the solution. select the most negative value.

If these coefficients are all nonnegative, then the solution is


Going back to previous problem, we have,
optimal.

EE 477 Dr. Mohamed Zribi 159 EE 477 Dr. Mohamed Zribi 160
x1 x2 s1 s 2 s3 s 4 b Thus the final tableau is
1 2 1 0 0 0 6
2 1 0 1 0 0 8 x1 x2 s1 s2 s3 s4 b
0 1 2 1 0 0 4
-1 1 0 0 1 0 1 3 3 3

1 0 1
3
2
3 0 0 10
3
0 1 0 0 0 1 2
0 0 -1 1 1 0 3
-3 -2 0 0 0 0 0
0 0 2
3
1
3 0 1 2
3
The new tableau is such, 0 0 1
3
4
3 0 0 38
3

x1 x2 s1 s2 s3 s4 b This tableau is optimal because none of the nonbasic


0 3/ 2 1 -1 / 2 0 0 2
1 1/ 2 0 1/ 2 0 0 4
variables have a negative coefficient in the last row.
0 3/ 2 0 1/ 2 1 0 5 Thus the optimal solution is
0 1 0 0 0 1 2
0 -1 / 2 0 3/ 2 0 0 12 x1 10
3 and x 2 4
3 z= 38 3
EE 477 Dr. Mohamed Zribi 161 EE 477 Dr. Mohamed Zribi 162

Step 1: Introduce Slack Variables and Rewrite Objective


Example 23: Function

We will solve the following problem The first step is to rewrite the system without the inequality
using the Simplex Method. We wish to Max z 5x 1 10x 2
symbols and to introduce slack variables.
8x 1 8x 2 160
maximize the profit function subject to
4x 1 12x 2 180
the constraints below. The method 8x 1 8x 2 s1 160
x1 0; x 2 0
introduced here can be used to solve 4x 1 12x 2 s 2 180
larger systems that are more 5x 1 10x 2 z 0
complicated. x 1 , x 2 , s1 , s 2 0

EE 477 Dr. Mohamed Zribi 163 EE 477 Dr. Mohamed Zribi 164
Step 2: Set up the Initial Simplex Tableau x1 x2 s1 s 2
s1 8 8 1 0 160
A simplex tableau is essentially the same as an augmented s2 4 12 0 1 180
matrix. The manipulations on a tableau are also the same as z 5 10 0 0 0
in the Gauss-Jordan method.
The variables s1, s2 on the left are the basic variables. A basic

x 1 x 2 s1 s 2 b variable always has one 1 in its column, otherwise 0. We can read

s1 8 8 1 0 160 off is value directly from the rightmost column. x1 and x2 are 0

s2 4 12 0 1 180 (the non-basic variables), so s1=160, s2=180. This is the initial

z 5 10 0 0 0 basic feasible solution that corresponds to the origin, since (x1,x2)


= (0,0).

EE 477 Dr. Mohamed Zribi 165 EE 477 Dr. Mohamed Zribi 166

Step 3: Determine the Pivot Element The Pivot Step

The goal is to use elementary row operations to produce a 1


x 1 x 2 s1 s 2
s1 8 8 1 0 160 160/8 = 20 in the column of the entering variable (in the row
s2 4 12 0 1 180 180/12 = 15 corresponding to the exiting variable), and 0 otherwise.
z 5 10 0 0 0

The most negative element in the last row is -10. Therefore, the x2-column Step 1: Divide row s2 by 12, to get a 1 in pivot position.
containing -10 is the pivot column.
x1 x2 s1 s 2 x1 x2 s1 s 2
To determine the pivot row, we divide the coefficients above the -10 into the s1 8 8 1 0 160
s1 8 8 1 0 160
numbers in the rightmost column and determine the smallest quotient. That 1 1
s2 4 12 0 1 180 x2 1 0 15
happens in the second row, labeled s2. 3 12
z 5 10 0 0 0 z 5 10 0 0 0
x2 is the entering variable, and s2 is the exiting variable.
x2 will become a basic variable,EEand s will become non-basic.
477 2Dr. Mohamed Zribi
167
EE 477 Dr. Mohamed Zribi 168
The Pivot Step
Find the Next Pivot Element

Step 2. Obtain zeros in the other positions of the pivot column by x 1 x 2 s1 s 2


subtracting multiples of the pivot row from the other rows. 16 2
s1 0 1 40
Re-label the rows: x2 is the entering variable, and s2 exits. 3 3
1 1
x2 1 0 15
3 12
x1 x2 s1 s 2 x1 x2 s1 s 2 5 5
s1 8 8 1 0 160 16 2
z 0 0 150
s1 0 1 40 3 6
1 1 3 3
x2 1 0 15 1 1
3 12 x2 1 0 15 The process must continue since the last row of the matrix still
3 12
z 5 10 0 0 0 contains a negative value (-5/3).
5 5
z 0 0 150
3 6 The next pivot column is column x1.
170
EE 477 Dr. Mohamed Zribi 169 EE 477 Dr. Mohamed Zribi

Find the Next Pivot Element


Divide the entries in the last column by the entries in the pivot Divide row 1 by 16/3, to get a 1 in
Multiply row 1 by 5/3 and add the

column, and pick the smallest value. The pivot row is row s1. result to row 3.
pivot position.
Multiply row 1 by -1/3 and add result
The entering variable is x1, the exiting variable is s1.
to row 2.
x1 x2 s1 s 2
x1 x 2 s1 s 2 3 1
x1 1 0 7.5 x 1 x 2 s1 s 2 b
16 2 16 8
s1 0 1 40 40/(16/3) = 7.5
3 3 1 1 x1 1 0 3 1 7.5
x2 1 0 15 16 8

1 1 3 12 x2 0 1 1 1 12.5
x2 1 0 15 15/(1/3) = 45 5 5
16 8

3 12 z 0 0 150 z 0 0 5
16
5
8 162.5
3 6
5 5
z 0 0 150
3 6
171 172
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Read off the Solution Interpreting the Simplex Process Geometrically

We can now interpret the simplex process just completed


Since the last row of the matrix contains no negative numbers, we geometrically, in terms of the feasible region graphed in the
can stop the procedure. Assign 0 to the non-basic variables and preceding section. The following table lists the three basic
read off x1=x=7.5 and x2=y=12.5. This is the same solution we feasible solutions we just found using the simplex method, in
obtained geometrically. the order they were found. The table also includes the
corresponding corner points of the feasible region.
The profit is maximized at
$162.50
x1 x2 s1 s 2 b x1 x2 s1 s2 P Corner Point
x1 1 0 3 1 0 7.5 0 0 160 180 0 (0, 0)
16 8

x2 0 1 1 1 0 12.5 0 15 40 0 150 (0, 15)


16 8

z 0 0 5
16
5
8 1 162.5 7.5 12.5 0 0 162.50 (7,5, 12.5)

173 174
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Example 24:

Looking at the table on the A farmer owns a 100-acre farm and plans to plant at most three
previous slide, we see that the crops. The seed for crops A, B and C costs $40, $20, and $30
simplex process started at the
per acre, respectively. A maximum of $3,200 can be spent on
origin, moved to the adjacent 2 3
seed. Crops A, B, and C require 1, 2, and 1 work days per acre,
corner point (0, 15) and then to
the optimal solution (7.5, 12.5). respectively, and there are a maximum of 160 work days
This is typical of the simplex 1 available. If the farmer can make a profit of $100 per acre on
process. crop A, $300 per acre on crop B, and $200 per acre on crop C,
how many acres of each crop should be planted to maximize
profit?

EE 477 Dr. Mohamed Zribi 175 EE 477 Dr. Mohamed Zribi 176
Solution:
The farmer is constrained by the number of acres available for
The farmer must decide on the number of acres of each crop that
planting, the money available for seed, the the available work
should be planted. Thus, the decision variables are
days. These lead to the following constraints:
x1 = number of acres of crop A
x1 + x2 + x3 < 100 Acreage constraint
x2 = number of acres of crop B
40x1 + 20x2 + 30x3 < 3,200 Monetary constraint
x3 = number of acres of crop C
x1 + 2x2 + x3 < 160 Labor constraint
The farmer’s objective is to maximize profit:

P = 100x1 + 300x2 + 200x3

EE 477 Dr. Mohamed Zribi 177 EE 477 Dr. Mohamed Zribi 178

Adding the nonnegative constraints, we have the following model Next, we introduce slack variables and form the initial system:
for a linear programming problem:
x1 + x2 + x3 + s1 = 100
Maximize z = 100x1 + 300x2 + 200x3
40x1 + 20x2 + 30x3 + s2 = 3200
Subject to
x1 + 2x2 + x3 + s3 = 160
x1 + x2 + x3 < 100
-100x1 - 300x2 -200x3 +z=0
40x1 + 20x2 + 30x3 < 3,200
x1, x2, x3, s1 , s2, s3 > 0
x1 + 2x2 + x3 < 160
The initial system has 7 - 4 = 3 nonbasic variables and 4 basic
x1, x2, x3 > 0 variables.

EE 477 Dr. Mohamed Zribi 179 EE 477 Dr. Mohamed Zribi 180
x1 x2 x3 s1 s2 s2 b
1 1 1 1 0 0 100
Now we form the simplex tableau and solve by the simplex 40 20 30 0 1 0 3200
method: 0.5 1 0.5 0 0 0.5 80
-100 -300 200 0 0 0 0
Enter

x1 x2 x3 s1 s2 s3 x1 x2 x3 s1 s2 s2 b
s1
1 1 1 1 0 0 0 100 0.5 0 0.5 1 0 0.5 20
s2
40 20 30 0 1 0 0 3, 200 30 0 20 0 1 -10 1600
s3
Exit 1 2 1 0 0 1 0 160 0.5R3 -> R3 0.5 1 0.5 0 0 0.5 80
z
100 300 200 0 0 0 1 0
50 0 50 0 0 150 24000

EE 477 Dr. Mohamed Zribi 181


181 EE 477 Dr. Mohamed Zribi 182

x1 x2 x3 s1 s2 s2 b
1 0 1 2 0 1 40
30 0 20 0 1 -10 1600 Thus, if the farmer plants 60 acres in crop B, 40 acres in crop

0.5 1 0.5 0 0 0.5 80 C and no crop A, the maximum profit of $26,000 will be
50 0 50 0 0 150 24000
realized. The fact that s2 = 800 tells us that this max profit is
x1 x2 x3 s1 s2 s2 b
1 0 1 2 0 1 40 reached by using only $2400 of the $3200 available for seed;

10 0 0 40 1 10 800 that is, we have a slack of $800 that can be used for some other
0 1 0 -1 0 1 60
purpose.
100 0 0 100 0 100 26000
the optimal solution: x1 = 0, x2 = 60, x3 = 40, s1 = 0, s2 =
800, s3 = 0, P = $26,000EE 477 Dr. Mohamed Zribi 183 EE 477 Dr. Mohamed Zribi 184
Example 25:
Note: For this initial simplex tableau, the basic
z 4 x1 6 x2 objective function
x1 x2 s1 11 variables are s1, s2, and s3, and the nonbasic
x1 x2 s2 27 constraints
variables are x1 and x2, i.e., x1 = x2 = 0.
2 x1 5 x2 s3 90

The corresponding simplex tableau is


As a consequence, the coefficient 1’s for s1, s2, and s3
are similar to leading 1’s and these basic variables
have initial values of s1=11, s2=27, and s3=90
current z-value

EE 477 Dr. Mohamed Zribi 185 EE 477 Dr. Mohamed Zribi 186

Pivoting to find an improved solution


Note: The initial solution for the simplex tableau is
Use the simplex method to find an improved solution for the
(x1, x2, s1, s2, s3) = (0, 0, 11, 27, 90)
linear programming problem represented by the tableau shown
and for the objective function,
below
the current z-value is 4(0) + 6(0) = 0 Since –6 is the smallest entry in
the bottom row, we choose x2
to be the entering variable

Optimality check: Observing the bottom row of the tableau, Because the objective function is z
=- 4x1 -6x2, a unit decrease in x2
if any of these entries (except the current z-value) are produce a decrease of 6 in z,
whereas a unit decrease in x1
negative, the current solution is not optimal (so the produces a decrease of only 4 in
z. Thus, adjusting x2 brings
initial values for (x1, x2, s1, s2, s3) are not optimal) larger improvement for finding
a smaller z-value

EE 477 Dr. Mohamed Zribi 187 EE 477 Dr. Mohamed Zribi 188
To find the departing variable, identify the row with the smallest
nonnegative bi /aij for the entering variables column, i.e., for j = 2 G.-J. E. for
the 2nd column
and examine b1/a12, b2/a22, and b3/a32

11 27 90 This process is called pivoting


11, 27, and 18
1 1 5 Therefore, the new tableau now becomes as follows

(Since 11 is the smallest


nonnegative ratio, we
choose s1 as the
departing variable)
Note: x2 has replaced s1 to be a basic variable and the improved solution is (x1,
x2, s1, s2, s3) = (0, 11, 0, 16, 35) with a z-value of -4x1 - 6x2 = -4(0) - 6(11) = -
66
EE 477 Dr. Mohamed Zribi 189 EE 477 Dr. Mohamed Zribi 190

The improved solution is not yet optimal because the bottom row
still has a negative entry So, the new tableau is as follows
Since –10 is the smallest number in the bottom row, we choose
(x1, x2, s1, s2, s3) =
x1 as the entering variable (5, 16, 0, 6, 0) with a z-
Moreover, the smallest nonnegative ratio among 11/(–1) = –11, value of -4x1 - 6x2 =
-4(5) - 6(16) =-116
16/2 = 8, and 35/7 = 5 is 5, so s3 is the departing variable and
a31 is the pivot entry
Following the same rule, we can identify s1 to be the entering variable and s2
to be the departing variable

pivot entry

EE 477 Dr. Mohamed Zribi 191 EE 477 Dr. Mohamed Zribi 192
By performing one more iteration of the simplex method, you Note: Because the LP problem in the Example involves only two variables,
can obtain the following tableau you could use a graphical solution technique also

In this tableau, there are no negative elements in the bottom Note that each iteration in the simplex method corresponds to moving from a given
vertex to an adjacent vertex with an improved z-value
row. So, the optimal solution is determined to be
(0, 0) (0,11) (5,16) (15,12)
(x1, x2, s1, s2, s3) = (15, 12, 14, 0, 0)
z 0 z 66 z 116 z 132
with In addition, why we choose (x1, x2, s1, s2, s3) = (0, 0, b1, b2, b3) = (0, 0, 11, 27, 90) as
z = -4x1 - 6x2 = -4(15) - 6(12) = -132 the initial basic solution is that (x1, x2) = (0, 0) must be a vertex of the feasible
solution region because all xi 0 in the standard form of maximization problems
EE 477 Dr. Mohamed Zribi 193 EE 477 Dr. Mohamed Zribi 194

Note: Example 26:


(x1, x2) = (0, 0) (intersection of x = 0 and y = 0)
x1 x2 (0) (0) 0 11 s1 11 Use the simplex method to find the maximum value of
x 0
nonbasic: 1 basic: x1 x2 (0) (0) 0 27 s2 27 z = 2x1 – x2 + 2x3,
x2 0
2 x1 5 x2 2(0) 5(0) 0 90 s3 90 Subject to
(x1, x2) = (0, 11) (intersection of x = 0 and –x + y = 11)
2 x1 x2 10
x2 11
nonbasic:
x1 0
basic: x1 x2 (0) (11) 11 27 s2 16
x1 2 x2 2 x3 20
s1 0 x1 x2 11
2 x1 5 x2 2(0) 5(11) 55 90 s3 35 where x1 0, x2 0, and x3 0 x2 2 x3 5
(x1, x2) = (5, 16) (intersection of –x + y = 11 and 2x + 5y = 90)
x1 5
s1 0 x1 x2 11
nonbasic: basic: x2 11
s3 0 2 x1 5 x2 90
x1 x2 (5) (11) 6 27 s2 6

(x1, x2) = (15, 12) (intersection of x + y = 27 and 2x + 5y = 90) Solution:


s2 0 x1 x2 27
x1 15 First, construct the initial simplex tableau with the initial basic solution
nonbasic: basic: x2 12
s3 0 2 x1 5 x2 90 (x1, x2, x3, s1, s2, s3) = (0, 0, 0, 10, 20, 5)
x1 x2 (15) (12) 3 11 s1 14
The above analysis shows that two nonbasic variables represent two straight lines that determine the vertex we
examine
The intuition of the simplex method is no more than testing different combinations of nonbasic variables, which
EE 477 Dr. Mohamed Zribi 195 EE 477 Dr. Mohamed Zribi 196
is equivalent to testing different vertexes of the solution region
Please note that the “tie” occurs when choosing the
entering variable. Here we arbitrarily choose x3 as
the entering variable So the optimal solution is
(x1, x2, x3, s1, s2, s3) = (5, 0, 5/2, 0, 20, 0)
with
z = 2x1 – x2 + 2x3 = 2(5) – (0) + 2(5/2) = 15

Note: Since s1 = s3 = 0, the optimal solution satisfies the first and


third constraints. The result of s2 = 20 indicates that the second
EE 477 Dr. Mohamed Zribi 197 constraint has a slack ofEE20
477 Dr. Mohamed Zribi 198

Example 27: Solution:


A manufacturer produces three types of plastic fixtures. The times Let x1, x2, x3 represent the numbers of dozens of types A, B, and
required for molding, trimming, and packaging are presented as C fixtures, respectively. The objective function is expressed as
follows. (Times and profits are displayed in hours for per dozen max profit = P = 11x1 + 16x2 + 15x3,
fixtures) subject to the constraints

2
x1 2 x2 x3 12000
3
2 2
x1 x2 x3 4600
3 3
1 1 1
x1 x2 x3 2400
2 3 2

How many dozen of each type of fixture should be produced to obtain a where x1 0, x2 0, and x3 0
maximum profit?

EE 477 Dr. Mohamed Zribi 199 EE 477 Dr. Mohamed Zribi 200
Apply the simplex method with the initial basic solution (x1, x2, x3, s1, s2, s3)
= (0, 0, 0, 12000, 4600, 2400)

So the optimal solution is (x1, x2, x3, s1, s2, s3) = (600, 5100,
EE 477 Dr. Mohamed Zribi 201 800, 0, 0, 0) with the maximum profit
EE 477 Dr. Mohamed Zribi to be $100,200 202

Example 28:
Moreover, in order to balance the advertising among the
The advertising alternatives for a company include television, three types of media, no more than half of the total number
radio, and newspaper advertisements. The costs and estimates
of advertisements should occur on the radio, no more than
of audience coverage are provided as follows
10 advertisements should occur on the newspaper, and at
least 10% should occur on the television. The weekly
advertising budget is $18,200. How many advertisements
should be run in each media to maximize the total
audience?

EE 477 Dr. Mohamed Zribi 203 EE 477 Dr. Mohamed Zribi 204
Solution:
Apply the simplex method with the initial basic solution (x1, x2, x3, s1, s2, s3,
Let x1, x2, x3 represent the numbers of advertisements in television, s4) = (0, 0, 0, 182, 10, 0, 0)
newspaper, and radio, respectively. The objective function is expressed as
Max z = 100000x1 + 40000x2 + 18000x3,
where x1 0, x2 0, and x3 0, and subject to the constraints

2000 x1 600 x2 300 x3 18200


x2 10
x3 0.5( x1 x2 x3 )
x1 0.1( x1 x2 x3 )

20 x1 6 x2 3 x3 182
x2 10
x1 x2 x3 0
9 x1EE 477 x 2
Dr. Mohamed
x
Zribi 3
0 205 EE 477 Dr. Mohamed Zribi 206

Example 29:
Maximize z 8 x1 9 x2
Subject to
2 x1 3x2 50

2 x1 6 x2 80

3x1 3x2 70

x1 , x2 0

So the optimal solution is (x1, x2, x3, s1, s2, s3, s4) = (4, 10, 14, 0,
0, 0, 12) with the maximum
EE 477 weekly audience
Dr. Mohamed Zribi to be 1,052,000 207 EE 477 Dr. Mohamed Zribi 208
Simplex tableau (Starting tableau):
Introducing slack variables, the LPP can be written as:

Basic z x1 x2 s1 s2 s3 Solution
Maximize z 8 x1 9 x2 0 s1 0s2 0s3
s1 0 2 3 1 0 0 50
Subject to
s2 0 2 6 0 1 0 80
2 x1 3 x2 s1 50
2 x1 6 x2 s2 80 (*) s3 0 3 3 0 0 1 70

3 x1 3 x2 s3 70 z 1 -8 -9 0 0 0 0
x1 , x 2 , s1 , s 2 , s 3 0
EE 477 Dr. Mohamed Zribi 209 EE 477 Dr. Mohamed Zribi 210

Simplex tableau (Starting tableau) Performing the elementary Row operations, we get the new
Enters Simplex tableau below

Basic z x1 x2 s1 s2 s3 Solution Enters

s1 0 2 3 1 0 0 50 Basic z x1 x2 s1 s2 s3 Solution

s1 0 1 0 1 -1/2 0 10
s2 0 2 6 0 1 0 80
x2 0 1/3 1 0 1/6 0 40/3
s3 0 3 3 0 0 1 70
s3 0 2 0 0 -1/2 1 30
z 1 -8 -9 0 0 0 0
z 1 -5 0 0 3/2 0 120
Leaves
Pivot element Pivot element
Leaves
EE 477 Dr. Mohamed Zribi 211 EE 477 Dr. Mohamed Zribi 212
Performing the elementary Row operations, we get the new Performing the elementary Row operations, we get the new
Simplex tableau below Simplex tableau below.

Enters This is optimal as all entries in z row are 0.

Basic z x1 x2 s1 s2 s3 Solution
Basic z x1 x2 s1 s2 s3 Solution
x1 0 1 0 1 -1/2 0 10
x1 0 1 0 -1 0 0 20
x2 0 0 1 -1/3 1/3 0 10
x2 0 0 1 1 0 0 10/3
s3 0 0 0 -2 1/2 1 10
s2 0 0 0 -4 1 2 20
z 1 0 0 5 -1 0 170
z 1 0 0 5 0 0 190
Leaves Pivot element
Optimum value = 190 at x1=20, x2=10/3
EE 477 Dr. Mohamed Zribi 213 EE 477 Dr. Mohamed Zribi 214

Graphical Solution of the problem


Example 30:

Maximize z 2 x1 x2 3 x3 5 x4
(10,10) Subject to
(0,40/3)
Optimal at Direction of
(20,10/3) increasing z x1 2 x2 2 x3 4 x 4 40
2 x1 x2 x3 2 x 4 8
4 x1 2 x2 x3 x4 10
(0,0)
x1 , x2 , x3 , x4 0
(70/3,0)

EE 477 Dr. Mohamed Zribi 215 EE 477 Dr. Mohamed Zribi 216
Basic z x1 x2 x3 x4 s1 s2 s3 Sol.
Introducing slack variables, the LPP becomes
S1 0 1 2 -2 4 1 0 0 40
Minimize
s2 0 2 -1 1 2 0 1 0 8
2 x1 x2 3 x3 5 x4 0 s1 0s2 0 s3 s3 0 4 -2 1 -1 0 0 1 10
z 1 -2 -1 3 -5 0 0 0 0
Subject to
s1 0 -3 4 -4 0 1 -2 0 24
x1 2 x2 2 x3 4 x4 s1 40 x4 0 1 -1/2 1/2 1 0 1/2 0 4
s3 0 5 -5/2 3/2 0 0 1/2 1 14
2 x1 x2 x3 2 x4 s2 8 z 1 3 -7/2 11/2 0 0 5/2 0 20
4 x1 2 x2 x3 x4 s3 10 x2 0 -3/4 1 -1 0 1/4 -1/2 0 6
x4 0 5/8 0 0 1 1/8 1/4 0 7
x1 , x2 , x3 , x4 , s1 , s2 , s3 0
s3 0 25/8 0 -1 0 5/8 -3/4 1 29
EE 477 Dr. Mohamed Zribi 217
z 1 3/8 0 2
EE 477
0
Dr. Mohamed Zribi
7/8 3/4 0 41
218

The last tableau is the optimal tableau as all entries in the Example 31:
objective function row are ≥ 0 and the LPP is a maximization Maximize z x1 2 x2 4 x3
problem.
Subject to

Optimal Solution is 3 x1 x2 5 x3 10
x1 = 0, x2 = 6, x3 = 0, x4 = 7
x1 4 x2 x3 8
And the Optimal z (= Maximum z) = 41
2 x1 2 x3 7
x1 , x 2 , x 3 0
EE 477 Dr. Mohamed Zribi 219 EE 477 Dr. Mohamed Zribi 220
Basic z x1 x2 x3 s1 s2 s3 Sol.
Introducing slack variables, the LPP becomes
s1 0 3 1 5 1 0 0 10
Maximize
s2 0 1 4 1 0 1 0 8
s3 0 2 0 2 0 0 1 7
z x1 2 x2 4 x3 0 s1 0 s2 0 s3 z 1 -1 -2 -4 0 0 0 0
Subject to
x3 0 3/5 1/5 1 1/5 0 0 2
3 x1 x2 5 x3 s1 10 s2 0 2/5 19/5 0 -1/5 1 0 6
s3 0 4/5 -2/5 0 -2/5 0 1 3
x1 4 x2 x3 s2 8 z 1 7/5 -6/5 0 4/5 0 0 8

2 x1 2 x3 s3 7 x3 0 11/19 0 1 4/19 -1/19 0 32/19


x2 0 2/19 1 0 -1/19 5/19 0 30/19
x1 , x2 , x3 , s1 , s2 , s3 0 s3 0 16/19 0 0 -8/19 2/19 1 69/19
EE 477 Dr. Mohamed Zribi 221
z 1 29/19 0 0
EE 477
14/19
Dr. Mohamed Zribi
6/19 0 188/19222
222

Example 32:
The last tableau is the optimal tableau as all entries in the
Shale Oil, has a capacity of 600,000 barrels of crude oil per day.
objective function row are ≥ 0 and the LPP is a maximization
The final products from the refinery include two types of unleaded
problem.
gasoline: regular and premium. The refining process encompasses
three stages: (1) a distillation tower that produces feedstock, (2) a

Optimal Solution is cracker unit that produces gasoline stock by using a portion of the

x1 = 0, x2 = 30/19, x3 = 32/19 feedstock produced from the distillation tower, and (3) a blender

And the Optimal z (= Maximum z) = 188/19 unit that blends the gasoline stock from the cracker unit and the
feedstock from the distillation tower.

Both regular and premium gasoline can be blended from either the
the feedstock or the gasoline stock at different production costs.
EE 477 Dr. Mohamed Zribi 223 EE 477 Dr. Mohamed Zribi 224
The company estimates that the net profit per barrel of regular
Develop a model for determining the optimum production
gasoline is $7.70 and $5.20, depending on whether it is blended
schedule for the refinery.
from feedstock or from gasoline stock. The corresponding profit
values for the premium grade are $10.40 and $12.30.

Design specifications require 5 barrels of crude oil to produce 1


barrel of feedstock. The capacity of the cracker unit is 40,000
barrels of feedstock a day. All remaining feedstock is directly used
in the blender unit to produce end-product gasoline. The demand
The demand limits for regular and premium gasoline are 80,000 and
50,000 barrels per day.
Distillation Tower Cracker
Blender Unit
EE 477 Dr. Mohamed Zribi 225 Unit EE 477 Dr. Mohamed Zribi 226

Let x1 units from feedstock be used to blend (=make) regular Thus we have to maximize the profit
gasoline
z 7.70 x1 10.40 x2 5.20 x3 12.30 x4
Let x2 units from feedstock be used to blend (=make) premium
gasoline Subject to

Let x3 units from gasoline stock be used to blend (=make) regular x1 x2 x3 x4 120,000
gasoline
x3 x4 40, 000
Let x4 units from gasoline stock be used to blend (=make)
premium gasoline x1 x3 80, 000
x2 x4 50, 000
x1 , x2 , x3 , x4 0
EE 477 Dr. Mohamed Zribi 227 EE 477 Dr. Mohamed Zribi 228
Optimum Solution Example 33:
x1 70,000 Maximize P under the constraints:

x2 10,000
Max P 12 y 1 16 y 2
x3 0
y 1 2 y 2 16
x4 40,000
y1 y2 9
3y 1 y2 21
Maximum z = 1135000 y 1, y 2 0

EE 477 Dr. Mohamed Zribi 229 EE 477 Dr. Mohamed Zribi 230

Solution:
Form the Simplex Tableau for the Dual Problem
Perform row operations to get zeros in the column containing the pivot
The first pivot element is 2 (in red) because it is located in the column element. Result is shown below.
with the smallest negative number at the bottom (-16), and when divided Identify the next pivot element (0.5) (in red)
into the rightmost constants yields the smallest quotient (16/2=8)

y1 y2 x1 x2 x3 P
y1 y2 x1 x2 x3 P
y2 .5 1 .5 0 0 8
x1 1 2 1 0 0 16
x2 1 1 0 1 0 9
New pivot
element x2 .5 0 .5 1 0 1
x3 3 1 0 0 1 21 Pivot element
x3 2.5 0 .5 0 1 13
located in this
P 12 16 0 0 0 0 column because of P 4 0 8 0 0 128
negative indicator
EE 477 Dr. Mohamed Zribi 231 EE 477 Dr. Mohamed Zribi 232
Get zeros in the column containing the new pivot
element.
7. The Two-Phase
y1 y2 x1 x x P We have now obtained
2 3
the optimal solution
y2 0 1 1 1 0 8 since none of the
bottom row indicators Simplex Method
y1 1 0 1 2 0 2 are negative.

x3 0 0 2 5 1 8
Minimum of P is 136
P 0 0 4 8 0 136

EE 477 Dr. Mohamed Zribi 233 EE 477 Dr. Mohamed Zribi 234

Expanding our Reach Expanding our Reach

Until now, we have only considered LPs with “≤” constraints, Obviously, these assumptions do not hold for every LP. What do
nonnegative variables, and nonnegative right-hand-side values. we do when they don’t?
Why?
– Remember that simplex needs a place to start – it must start This is where Two-Phase Simplex comes in. It involves two
from a BFS then move to another BFS to improve the phases (thus the name!):
objective value.
– Phase I: Works to achieve feasibility.
– With these assumptions, we can obtain an initial BFS by
letting all slack variables be basic, all original variables be – Phase II: Works to achieve optimality.
non-basic.
EE 477 Dr. Mohamed Zribi 235 EE 477 Dr. Mohamed Zribi 236
Artificial Variables
Two Phase Method
For problems with constraints of the form
We now look at the Two-Phase method. As the name suggests, the
Ax b
method consists of two phases: In phase I, we minimize the sum of
x 0
all the artificial variables subject to the same constraint equations.
with b 0 , a basic feasible solution to the corresponding
If the original problem had a feasible solution this new problem will
standard form of the problem is provided by the slack
give a solution with all artificial variables zero. Taking this as a
variables. This provides us with the starting point for the
starting BFS, we solve the original problem. simplex method.

An initial basic feasible solution is not always apparent for


other types of LPs.
EE 477 Dr. Mohamed Zribi 237 EE 477 Dr. Mohamed Zribi 238

Artificial Variables Artificial Variables


When a basic feasible solution is not readily available, the two-
Hence artificial variables need to be added to play the role of
phase simplex method may be used.
slack variables.
In the two-phase simplex method, we add artificial variables to

This technique of solving the problem is called the two phase the same constraints. Then we find a BFS to the original LP by
technique. solving the Phase I LP.
In the Phase I, the objective function is to minimize the sum of all
Phase 1: Augment the artificial variables as necessary to secure a
starting solution. artificial variables.
At the completion of Phase I, we reintroduce the original LP’s
Phase 2: Use the optimum basic solution of phase 1 as a starting objective function and determine the optimal solution to the
solution for the original problem.
original LP.
EE 477 Dr. Mohamed Zribi 239 EE 477 Dr. Mohamed Zribi 240
Example 34:
Consider the constraints: We can see that we cannot get an identity matrix in the
x1 + 2x2 ≥ 4 coefficients and positive numbers on the right-hand
-3x1 + 4x2 ≥ 5 side. We need to add artificial variables:
2x1 + x2 ≤ 6 x1, x2 ≥ 0
x1 + 2x2 – x3 + a1 =4
Introduce the slack variables:
x1 + 2x2 – x3 =4 -3x1 + 4x2 – x4 + a2 =5
-3x1 + 4x2 – x4 =5
2x1 + x2 + x5 =6 2x1 + x2 + x5 =6

EE 477 Dr. Mohamed Zribi 241 EE 477 Dr. Mohamed Zribi 242

Example 35:
Now we have an identity matrix, made up of the Consider the constraints:
x1 + 2x2 – 5x3 ≥ -4
coefficient columns of a1, a2, & x5.
3x1 – x2 + 3x3 ≤ 2
-x1 + x2 + x3 = -1 x1, x2, x3 ≥ 0
We would solve the problem with the objective of
minimizing a1 + a2 to get rid of the artificial variables, Introduce the slack variables:
x1 + 2x2 – 5x3 – x4 = -4
then use whatever basis we had and continue solving,
3x1 – x2 + 3x3 + x5 =2
using the original objective function. -x1 + x2 + x3 = -1

EE 477 Dr. Mohamed Zribi 243 EE 477 Dr. Mohamed Zribi 244
Example 36: Motivation of the two phase method
We don’t have to add an artificial variable to the 1st constraint if max z 3x 1 x 2
we multiply it by -1. s.t. x1 x2 1
2x 1 x 2 4
x1 x 2 3
When we multiply the last constraint by -1 and add an artificial
x 1, x 2 0
variable, we have:
Step 1: Make all right-hand-side values nonnegative.
-x1 – 2x2 + 5x3 + x4 =4 max z 3x 1 x 2
3x1 – x2 + 3x3 + x5 =2 s.t. x1 x2 1
x1 – x2 – x3 + a1 =1 2x 1 x 2 4
x1 x 2 3
x1, x2, x3, x4, x5, a1 ≥ 0 x 1, x 2 0
EE 477 Dr. Mohamed Zribi 245 EE 477 Dr. Mohamed Zribi 246

Step 2: Put the LP in standard form. Artificial Variables

max z 3x 1 x 2
When we had a slack variable in each constraint, it was easy to
s.t. x1 x 2 s1 1 find an initial BFS to initiate simplex.
2x 1 x 2 s2 4
When there are rows without slack variables, it isn’t so obvious
x1 x 2 3
how to begin simplex.
x 1, x 2 0
To deal with the problem, we will use artificial variables.

Essentially, we will invent a basic variable for each row without


a slack (we will use the slacks when they are available).

EE 477 Dr. Mohamed Zribi 247 EE 477 Dr. Mohamed Zribi 248
max z 3x 1 x 2 A Problem
s.t. x1 x 2 s1 1
2x 1 x 2 s2 4 We have essentially made up extra variables to make our
x1 x 2 3
lives easier. Is this a valid thing to do?
x 1, x 2 0

Step 3: add an artificial variable to each row without a slack.


Yes and No. We can not start simplex with a BFS that
max z 3x 1 x 2 utilizes (positive) artificial variables. We can use
s.t. x1 x 2 s1 a1 1 artificial variables as a tool to obtain a starting BFS.
2x 1 x 2 s2 4
x1 x 2 a3 3
x 1 , x 2 , s1 , s 2 , a1 , a3 , 0
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi 250

Solving the Problem Forcing Artificial Variables to Zero

How do we use them? Starting with our dictionary that To force all artificial variables to be zero, we minimize the

uses artificial variables, we use simplex to find a BFS sum of all artificial variables.

in which all artificial variables are equal to zero. – If the minimum is zero, then all artificial variables

Then they don’t affect the real solution. equal zero (this is what we want!!)

– If the minimum is nonzero, then some artificial


x1 x 2 e1 a1
X 1 variable is positive. This implies infeasibility!!!
2 x1 x2 s2 4
x1 x2 a3
X 3
x1 , x 2 0
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi 252
252
Step 5: replace the objective with minimizing the sum of all
Remark:
artificial variables (call it “w” to keep it separate from the
If there is a tie for leaving variable, always choose an
original objective).
artificial variable over another variable.
min w a1 a3
If there is more than one candidate for entering variable,
s.t. x1 x 2 s1 a1 1
avoid choosing an artificial variable.
2x 1 x 2 s2 4
x1 x 2 a3 3 The goal is to make all artificial variables zero, which can be
x 1, x 2 , 0 achieved by making them nonbasic!!!

EE 477 Dr. Mohamed Zribi 253 EE 477 Dr. Mohamed Zribi 254

Remark: Remark: One more possibility….

Phase I is concerned only with feasibility, not optimality.


What if the Phase I LP is degenerate? That is, what if we
reach optimality (so that all artificial variables are zero),
The primary aim of Phase I is to obtain a BFS with which but one of the artificial variables is basic?
to start simplex. Notice that we essentially solve an LP
(using simplex!) to find this BFS.
Proceed with the Phase II LP, eliminating all non-basic
artificial variables. As soon as any of the remaining
artificial variables becomes non-basic, delete it.

EE 477 Dr. Mohamed Zribi 255


255 EE 477 Dr. Mohamed Zribi 256
Summary of the Two Phase Method
Step 6: Write the new objective in terms of non-basic variables.

Step 1: Make all right-hand-side values nonnegative Step 7: Solve the Phase I LP. If r > 0, the original LP is

Step 2: Put the LP in standard form. infeasible.

Step 3: Add an artificial variable to each row without a slack. Step 8: Replace the original objective, in terms of non-basic

Step 4: Write the initial tableau, using slack and artificial variables. Delete all non-basic artificial variables. This creates

variables as basic variables. the Phase II LP.

Step 5: Replace the objective with minimizing the sum of all Step 9: Optimize the Phase II LP. As artificial variables become

artificial variables (call it “r” to keep it separate from the non-basic, delete them.

original objective).
.
EE 477 Dr. Mohamed Zribi 257 EE 477 Dr. Mohamed Zribi 258

Remark: Example 37:


Minimize z 2 x1 x2
Three outcomes when solving Phase I of an LP:
– Minimum r > 0: LP infeasible
– Minimum r = 0, all artificial variables nonbasic:
Subject to
• replace objective
• delete artificial variables 3 x1 x2 9
• continue with Phase II
– Minimum r = 0, some artificial variable basic (and x1 x2 6
equal to zero):
• replace objective x1 , x 2 0
• delete nonbasic artificial variables
• continue with Phase II
• delete each artificial variable as it becomes
nonbasic.
EE 477 Dr. Mohamed Zribi 259 EE 477 Dr. Mohamed Zribi 260
Introducing the surplus and artificial variables, a1, a2, the
Phase I:
LPP is same as:

Minimize z 2 x1 x2 Minimize r a1 a2

Subject to Subject to

3 x1 x2 s1 a1 9 3x 1 x 2 s1 a1 9
x1 x2 s2 a2 6 x1 x 2 s2 a2 6
x1 , x 2 , s1 , s 2 , a 1 , a 2 0 x 1 , x 2 , s 1 , s 2 , a1 , a 2 0
We now solve it by Simplex method.
EE 477 Dr. Mohamed Zribi 261 EE 477 Dr. Mohamed Zribi 262

Write the initial Tableau. Since a1 and a2 are basic variables, we need to make sure that
their r coefficients are zero.

Basic r x1 x2 s1 s2 a1 a2 Sol. Basic r x1 x2 s1 s2 a1 a2 Sol.

a1 0 3 1 -1 0 1 0 9 a1 0 3 1 -1 0 1 0 9

a2 0 1 1 0 -1 0 1 6 a2 0 1 1 0 -1 0 1 6

r 1 0 0 0 0 1 1 0 r 1 -4 -2 1 1 0 0 -15

EE 477 Dr. Mohamed Zribi 263 EE 477 Dr. Mohamed Zribi 264
Basic r x1 x2 s1 s2 a1 a2 Sol. Basic r x1 x2 s1 s2 a1 a2 Sol.

x1 0 1 0 ½ ½ ½ ½ 3/2
x1 0 1 1/3 -1/3 0 1/3 0 3

x2 0 0 1 ½ -3/2 -1/2 3/2 9/2


a2 0 0 2/3 1/3 -1 -1/3 1 3

r 1 0 -2/3 -1/3 1 4/3 0 -3 r 1 0 0 0 0 1 1 0

EE 477 Dr. Mohamed Zribi 265 EE 477 Dr. Mohamed Zribi 266

Note that Phase I has ended as min r =0.


Basic z x1 x2 s1 s2 Sol.
Phase II:

Now we solve the original LPP with


x1 0 1 0 -1/2 1/2 3/2
The starting BFS: x1= 1.5 and x2=4.5
3 9
x1 , x2
2 2

Note that the starting Simplex tableau is the same as the last x2 0 0 1 1/2 -3/2 9/2
tableau except for the first row which is our z-Row. Since a1,
a2 have served their purpose (of giving a starting BFS), we
suppress their columns. z 1 2 1 0 0 0
3 9
x1 , x2
2 2
EE 477 Dr. Mohamed Zribi 267 EE 477 Dr. Mohamed Zribi 268
Since x1 and x2 are basic variables, we need to make sure that Therefore, for the problem
their z coefficients are zero.
Minimize z 2 x1 x2
Basic z x1 x2 s1 s2 Sol.
Subject to

x1 0 1 0 -1/2 1/2 3/2 3 x1 x2 9


x1 x2 6
x2 0 0 1 1/2 -3/2 9/2
x1 , x 2 0
Optimal solution: x1 = 1.5, x2 = 4.5

z 1 0 0 1/2 1/2 -15/2 Optimal value : Min z = 7.5

EE 477 Dr. Mohamed Zribi 269 EE 477 Dr. Mohamed Zribi 270

Example 38: Phase I:


Minimize z 5x1 7 x2 Minimize r a1 a2 a3
Subject to
Subject to
2 x1 3 x2 42
3 x1 4 x2 60 2x 1 3x 2 s1 a1 42

x1 x2 18 3x 1 4x 2 s 2 a2 60
x 1 x 2 s3 a3 18
x1 , x 2 0 x 1, x , s 1 , s 2 , s 3 , a1 , a 2 , a 3 0
2

Here s1,s2,s3 are surplus variables; a1, a2,a3 are artificial


We shall solve this problem by two phase method.
variables.
EE 477 Dr. Mohamed Zribi 271 EE 477 Dr. Mohamed Zribi 272
Write the initial Tableau. Since a1 and a2 are basic variables, we need to make sure that
their r coefficients are zero.

Basic r x1 x2 s1 s2 s3 a1 a2 a3 Sol Basic r x1 x2 s1 s2 s3 a1 a2 a3 Sol

a1 0 2 3 -1 0 0 1 0 0 42 a1 0 2 3 -1 0 0 1 0 0 42

a2 0 3 4 0 -1 0 0 1 0 60 a2 0 3 4 0 -1 0 0 1 0 60

a3 0 1 1 0 0 -1 0 0 1 18 a3 0 1 1 0 0 -1 0 0 1 18

r 1 0 0 0 0 0 1 1 1 0
r 1 -6 -8 1 1 1 0 0 0 -120

EE 477 Dr. Mohamed Zribi 273 EE 477 Dr. Mohamed Zribi 274

Basic r x1 x2 s1 s2 s3 a1 a2 a3 Sol Basic r x1 x2 s1 s2 s3 a1 a2 a3 Sol

x2 0 2/3 1 -1/3 0 0 1/3 0 0 14 x2 0 3/4 1 0 -1/4 0 0 1/4 0 15

a2 0 1/3 0 4/3 -1 0 -4/3 1 0 4 s1 0 1/4 0 1 -3/4 0 -1 3/4 0 3

a3 0 1/3 0 1/3 0 -1 -1/3 0 1 4


a3 0 1/4 0 0 1/4 -1 0 -1/4 1 3

r 1 -2/3 0 -5/3 1 1 8/3 0 0 -8 r 1 -1/4 0 0 -1/4 1 1 5/4 0 -3

EE 477 Dr. Mohamed Zribi 275 EE 477 Dr. Mohamed Zribi 276
This is the optimal tableau. Thus Phase I has ended and we now
start Phase II with the starting BFS as the optimal solution of
Basic r x1 x2 s1 s2 s3 a1 a2 a3 Sol
Phase I.

x2 0 0 1 0 -1 3 0 1 -3 6

s1 0 0 0 1 -1 1 -1 1 -1 0 Phase II:
Minimize z 5 x1 7 x2
x1 0 1 0 0 1 -4 0 -1 4 12

subject to the same constraints as given in the original


r 1 0 0 0 0 0 1 1 1 0
problem.

EE 477 Dr. Mohamed Zribi 277 EE 477 Dr. Mohamed Zribi 278

Basic r x1 x2 s1 s2 s3 Sol Basic r x1 x2 s1 s2 s3 Sol

x2 0 0 1 0 -1 3 6 x2 0 0 1 0 -1 3 6

s1 0 0 0 1 -1 1 0 s1 0 0 0 1 -1 1 0

x1 0 1 0 0 1 -4 12 x1 0 1 0 0 1 -4 12

z 1 5 7 0 0 0 0 z 1 0 0 0 2 -1 -102

EE 477 Dr. Mohamed Zribi 279 EE 477 Dr. Mohamed Zribi 280
This is the optimal tableau.
Basic r x1 x2 s1 s2 s3 Sol
Optimal solution: x1 = 12, x2 = 6

x2 0 0 1 -3 2 0 6 Optimal value : z = 102

s1 0 0 0 1 -1 1 0

x1 0 1 0 4 -3 0 12

z 1 0 0 1 1 0 -102

EE 477 Dr. Mohamed Zribi 281 EE 477 Dr. Mohamed Zribi 282

Example 39: Phase I:


Minimize z 2 x1 5 x2 3 x3 Minimize r a1 a2
Subject to Subject to

x1 2 x2 x3 20 x1 2x x3 s1 a1 20
2
2 x1 4 x2 x3 50
2x1 4x 2 x3 a2 50
x1 , x 2 , x 3 0
x 1 , x 2 , x 3 , s 1 , a1 , a 2 0

Here s1 is a surplus variable; a1,a2 are artificial variables.

EE 477 Dr. Mohamed Zribi 283 EE 477 Dr. Mohamed Zribi 284
Basic r x1 x2 x3 s1 a1 a2 Sol Basic r x1 x2 x3 s1 a1 a2 Sol

a1 0 1 -2 1 -1 1 0 20 x1 0 1 -2 1 -1 1 0 20
a2 0 2 4 1 0 0 1 50
r2 0 0 8 -1 2 -2 1 10
-3 -2 -2 1 0 0 -70
r 1 0 0 0 0 1 1 0 r 1 0 -8 1 -2 3 0 - 10

x1 0 1 -2 1 -1 1 0 20 x1 0 1 0 3/4 -1/2 1/2 1/4 45/2

a2 0 0 8 -1 2 -2 1 10 x2 0 0 1 -1/8 1/4 -1/4 1/8 5/4

r 1 0 -8 1 -2 3 0 - 10 r 1 0 0 0 0 1 1 0

EE 477 Dr. Mohamed Zribi 285 EE 477 Dr. Mohamed Zribi 286

Basic z x1 x2 x3 s1 a1 a2 Sol
This is optimal tableau. Thus Phase I has ended and we now start
Phase II with the starting BFS as the optimal solution of Phase I. x1 0 1 0 3/4 -1/2 45/2
x2 0 0 1 -1/8 1/4 5/4
0 0 17/8 -1/4 -205/4
z 1 2 5 3 0 0

x1 0 1 2 1/2 0 25
Phase II:
s1 0 0 4 -1/2 1 5
Minimize
z 2 x1 5x2 3x3
z 1 0 1 2 0 - 50
subject to the same constraints as given in the original
problem. Thus the optimal solution is : x1 = 25, x2 = 0, x3 = 0
And the optimal z = Min z = 50.
EE 477 Dr. Mohamed Zribi 287 EE 477 Dr. Mohamed Zribi 288
Adding surplus and slack variables, the problem becomes:
Example 40:
Consider the LPP

Minimize z 2x1 4x2 3x3 Minimize z 2x1 4x2 3x3

Subject to Subject to

5 x1 6 x2 2 x3 5 5 x1 6 x2 2 x3 s1 5
x1 3 x2 5 x3 8 x1 3 x2 5 x3 s2 8
2 x1 5 x2 4 x3 9 2 x1 5 x2 4 x3 s3 9
x1 , x 2 , x 3 0 x 1 , x 2 , x 3 , s1 , s 2 , s 3 0
EE 477 Dr. Mohamed Zribi 289 EE 477 Dr. Mohamed Zribi 290

Minimize z 2x1 4x2 3x3


Normally we have to add two artificial variables,
one to each of the first two constraint equations to Subject to

get a starting BFS. 6 x1 9 x2 3 x3 s1 s2 3


x1 3 x2 5 x3 s2 8
But by subtracting the first constraint from the second
2 x1 5 x2 4 x3 s3 9
constraint equation, we get the equivalent LPP:
x1 , x 2 , x 3 , s1 , s 2 , s 3 0

Thus we need to add only one artificial variable to the second


constraint equation
EE 477 Dr. Mohamed Zribi 291 EE 477 Dr. Mohamed Zribi 292
to get a starting BFS (= to get a 3x3 identity sub- We shall solve this by two phase method.
matrix). Doing this , the LPP is
Phase I:
Minimize z 2x1 4x2 3x3 Minimize r a2
Subject to Subject to
6x 1 9x 2 3x 3 s1 s2 3
6x 1 9x 2 3x 3 s1 s2 3
x1 3x 2 5x 3 s2 a2 8
x1 3x 2 5x 3 s2 a2 8
2x 1 5x 2 4x 3 s3 9
2x 1 5x 2 4x 3 s3 9
x 1 , x 2 , x 3 , s1 , s 2 , s 3 , a2 0
x 1 , x 2 , x 3 , s1 , s 2 , s 3 , a2 0

EE 477 Dr. Mohamed Zribi 293 EE 477 Dr. Mohamed Zribi 294

Basic r x1 x2 x3 s1 s2 a2 s3 Sol.
Initial Tableau is such that:
s1 0 -6 9 3 1 -1 0 0 3
Basic r x1 x2 x3 s1 s2 a2 s3 Sol.
a2 0 -1 3 5 0 -1 1 0 8

s3 0 2 5 -4 0 0 0 1 9
s1 0 -6 9 3 1 -1 0 0 3
r 1 1 -3 -5 0 1 0 0 -8
a2 0 -1 3 5 0 -1 1 0 8
x3 0 -2 3 1 1/3 -1/3 0 0 1
s3 0 2 5 -4 0 0 0 1 9 a2 0 9 -12 0 -5/3 2/3 1 0 3

r 1 0 0 0 0 0 1 0 0 s3 0 -6 17 0 4/3 -4/3 0 -1 13

r 1 -9 12 0 5/3 -2/3 0 0 -3
EE 477 Dr. Mohamed Zribi 295 EE 477 Dr. Mohamed Zribi 296
Phase I has ended. And we now start Phase II with the
Basic r x1 x2 x3 s1 s2 a2 s3 Sol.
starting BFS obtained in the optimal tableau of Phase I.
x3 0 0 1/3 1 -1/27 -5/27 2/9 0 5/3
Also we do not carry the a2 column as it has served its

x1 0 1 -4/3 0 -5/27 2/27 1/9 0 1/3 purpose.

s3 0 0 9 0 2/9 -8/9 2/3 -1 15

r 1 0 0 0 0 0 1 0 0

EE 477 Dr. Mohamed Zribi 297 EE 477 Dr. Mohamed Zribi 298

Phase II:
Minimize z 2x1 4x2 3x3
Basic r x1 x2 x3 s1 s2 s3 Sol.
Subject to

6 x1 9 x2 3 x3 s1 s2 3 x3 0 0 1/3 1 -1/27 -5/27 0 5/3


x1 3 x2 5 x3 s2 8
2 x1 5 x2 4 x3 s3 9 x1 0 1 -4/3 0 -5/27 2/27 0 1/3

x1 , x 2 , x 3 , s1 , s 2 , s 3 0
s3 0 0 9 0 2/9 -8/9 -1 15

r 1 2 -4 3 0 0 0 0

EE 477 Dr. Mohamed Zribi 299 EE 477 Dr. Mohamed Zribi 300
More work is needed to obtain the optimal tableau.

Basic r x1 x2 x3 s1 s2 s3 Sol.
And the optimal solution is

23 15 10
x3 0 0 1/3 1 -1/27 -5/27 0 5/3
x1 , x2 , x3
9 9 9
x1 0 1 -4/3 0 -5/27 2/27 0 1/3
16
Optimum z = Minimum z = .
s3 0 0 9 0 2/9 -8/9 -1 15 9

r 1 0 -7/3 0 13/27 11/27 0 -17/3 It is clear that the same procedure can be applied to
more than two ≥ constraints.
EE 477 Dr. Mohamed Zribi 301 EE 477 Dr. Mohamed Zribi 302

Example 41: Phase I:


min z=x1 x2 x3 x4 x5
subject to 3 x1 2 x2 x3 1
5 x1 x2 x3 x4 3 x1 x2 x3 x4 x5 a1 a2 a3 b
3 2 1 0 0 1 0 0 1
2 x1 5 x2 x3 x5 4
5 1 1 1 0 0 1 0 3
2 5 1 0 1 0 0 1 4
Solution: 0 0 0 0 0 1 1 1 0
Phase I:
min r a1 a2 a3 x1 x2 x3 x4 x5 a1 a2 a3 b
subject to 3x1 2 x2 x3 a1 1 3 2 1 0 0 1 0 0 1
Phase I
5 x1 x2 x3 x4 a2 3 5 1 1 1 0 0 1 0 3
2 x1 5 x2 x3 x5 a3 4 2 5 1 0 1 0 0 1 4
10 8 3 1 1 0 0 0 8304
EE 477 Dr. Mohamed Zribi 303 EE 477 Dr. Mohamed Zribi
x1 x2 x3 x4 x5 a1 a2 a3 b
x1 x2 x3 x4 x5 a1 a2 a3 b
1.5 1 0.5 0 0 0.5 0 0 0.5
1 2/3 1/3 0 0 1/3 0 0 1/3
3.5 0 0.5 1 0 0.5 1 0 2.5
0 7/3 2/3 1 0 5/3 1 0 4/3
5.5 0 1.5 0 1 2.5 0 1 1.5
0 11/3 1/3 0 1 2/3 0 1 10/3
5.5 0 1.5 0 1 3.5 1 0 1.5
0 4/3 1/3 1 1 10/3 0 0 14/3

x1 x2 x3 x4 x5 a1 a2 a3 b
x1 x2 x3 x4 x5 a1 a2 a3 b
1.5 1 0.5 0 0 0.5 0 0 0.5
1.5 1 0.5 0 0 0.5 0 0 0.5 3.5 0 0.5 1 0 0.5 1 0 2.5
3.5 0 0.5 1 0 0.5 1 0 2.5 5.5 0 1.5 0 1 2.5 0 1 1.5
5.5 0 1.5 0 1 2.5 0 1 1.5 0 0 0 0 0 1 1 1 0
2 0 1 1 1 4 0 0 4
305 306
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Phase II: min z=x1 x2 x3 x4 x5 min z=x1 x2 x3 x4 x5


subject to 3x1 2 x2 x3 1 subject to 3x1 2 x2 x3 1
5 x1 x2 x3 x4 3 5 x1 x2 x3 x4 3
2 x1 5 x2 x3 x5 4 2 x1 5 x2 x3 x5 4

x1 x2 x3 x4 x5 b
1.5 1 0.5 0 0 0.5 We now can enter the Phase II of the two-phase simplex algorithm.
3.5 0 0.5 1 0 2.5
5.5 0 1.5 0 1 1.5 However, we are now already in optimum.
1 1 1 1 1 0
x1 x2 x3 x4 x5 b
x1 = 0
1.5 1 0.5 0 0 0.5
x1 x2 x3 x4 x5 b x2 = 0.5
3.5 0 0.5 1 0 2.5
1.5 1 0.5 0 0 0.5 x3 = 0
5.5 0 1.5 0 1 1.5
3.5 0 0.5 1 0 2.5 x4 = 2.5
5.5 0 1.5 0 1 1.5 1.5 0 1.5 0 0 4.5
x5 = 1.5
1.5 0 1.5 0 0 4.5
R4 R1 R2 R3 EE 477 Dr. Mohamed Zribi
307
EE 477 Dr. Mohamed Zribi
308
Example 42: The simplex method with equality constraints
Use the simplex method to find the maximum value of
z = 3x1 + 2x2 + x3,
Subject to
4 x1 x2 x3 30
2 x1 3 x2 x3 60
x1 2 x2 3 x3 40
where x1 0, x2 0, and x3 0

Solution:
The initial basic solution is (x1, x2, x3, s1, s2, s3)
= (0, 0, 0, 30, 60, 40)

The variable s1 is an artificial variable, rather than


a slack variable
Since the first constraint is an equality, s1 in the
optimal solution must be zero, i.e., s1 must be
the nonbasic variable and thus be 0 in the
optimal solution
EE 477 Dr. Mohamed Zribi 309 EE 477 Dr. Mohamed Zribi 310

Example 43:
Minimize z 2x1 3x2 x3
Subject to

x1 4 x2 2 x3 8
3 x1 2 x2 6
So the optimal solution is
(x1, x2, x3, s1, s2, s3) = (3, 18, 0, 0, 0, 1) x1 , x 2 , x3 0
with
z = 3x1 + 2x2 + x3 = 3(3) + 2(18) + 1(0) = 45
Note: Since s1 is not a basic variable and thus s1 = 0 in the optimal Ans.: Optimal Solution: x1 = 4/5, x2 = 9/5, x3 = 0
solution, this solution satisfies the first constraints (4(3) + 1(18) Optimal value: z = 7
+ 1(0) = 30)
EE 477 Dr. Mohamed Zribi 311 EE 477 Dr. Mohamed Zribi 312
Example 44: Solution:
• For the first inequality, it does involve inequalities, so we
Find the maximum value of z = x1 + x2 + 2x3,
add a slack variable to form the equation as before
2 x1 x2 x3 s1 50
subject to the constraints
• For the last two inequalities, a surplus variable, is
introduced as follows
2 x1 x2 x3 50
2 x1 x2 s2 36
2 x1 x2 36
x1 x3 s3 = 10
x1 x3 10

Note: The surplus variables as well as the slack variables must


where x1 0, x2 0, and x3 0 be nonnegative, i.e., s1 0, s2 0, and s3 0 in the above case

EE 477 Dr. Mohamed Zribi 313 EE 477 Dr. Mohamed Zribi 314

The initial simplex tableau can be formed as follows After some work, you can obtain the following simplex tableau

Note: The initial basic solution is (x1, x2, x3, s1, s2, s3) =
(0, 0, 0, 50, –36, –10), which is not a feasible solution because the Note that it is the final tableau because it represents a feasible
values of the two surplus variables are negative solution and there are no negative entries in the bottom row
In other words, the point (x1, x2, x3) = (0, 0, 0) is not an vertex of the So, you can conclude that the maximum value of z = 64 and this
feasible solution region (in fact, (0, 0, 0) is not even in the feasible occur when (x1, x2, x3, s1, s2, s3)= (0, 36, 14, 0, 0, 4)
solution region)
So, we cannot apply the simplex method directly from this initial basic
solution
EE 477 Dr. Mohamed Zribi 315 EE 477 Dr. Mohamed Zribi 316
Special Cases
Usually an LPP will have a unique optimal solution.
But there are problems where there may be no solution,

8. Special Cases may have alternative optimum solutions and may be


“unbounded” solutions.

We note that the (unique) optimum solution occurs at


one of the “corners” of the set of all feasible points.

EE 477 Dr. Mohamed Zribi 317 EE 477 Dr. Mohamed Zribi 318

Special Cases Special Case 1: Alternative Optimal


Solutions
• Some LPs have an infinite number of solutions
When the objective function is parallel to a binding
(alternative or multiple optimal solutions).
constraint (i.e. a constraint that is satisfied as an equation),
then the objective function will assume the same optimal
• Some LPs have no feasible solution (infeasible LPs). value at more than one corner point. We say the problem
has alternative optimal solutions. In this case there also
• Some LPs are unbounded: There are points in the will be an infinity of (non-basic) feasible solutions where
feasible region with arbitrarily large (in a the objective function has the same optimum value.

maximization problem) z-values.


EE 477 Dr. Mohamed Zribi 319 EE 477 Dr. Mohamed Zribi 320
Multiple (Alternative) Optimal Solutions Multiple Optimal Solutions
Suppose in the optimal tableau, some nonbasic variable has zero Criterion for the existence of alternative optimal solutions
coefficient in the objective function row. Then that variable can from the optimal tableau:
become basic and we would get another BFS.
A zero reduced cost of a non-basic variable in the final
simplex tableau indicates the existence of multiple optimal
Since the coefficient of the entering variable in the objective
solutions.
function row is zero, the objective function does not improve.
Then that variable can enter the basis and the objective
Hence the new BFS we get is an alternative Optimal Solution. function will not change. Thus we shall have alternative

Usually you are supposed to give all Optimal Solutions. optimal solutions as the following example illustrates.
EE 477 Dr. Mohamed Zribi 321 EE 477 Dr. Mohamed Zribi 322

Example 45: Alternative optimal solutions The initial tableau is such that:
Maximize z x1 x2 x1 x2 s1 s2 Sol.

Subject to:

x1 x2 6 1 1 1 0 6
x1 2 x2 10
x1 , x 2 0 1 2 0 1 10

Solution: We will solve this problem by the Simplex method.


-1 -1 0 0 0

EE 477 Dr. Mohamed Zribi 323 EE 477 Dr. Mohamed Zribi 324
x1 x2 s1 s2 Sol. x1 x2 s1 s2 Sol.

1 1 1 0 6 1 0 2 -1 2

0 1 -1 1 4 0 1 -1 1 4

0 0 1 0 6 0 0 1 0 6

This is the optimal tableau. Optimal Solution is x1=6, x2=0 and z=6 Note that we have got an alternative optimal solution.
However,
The optimal solution is x1=2, x2=4 and z = 6.
Since coefficient of the nonbasic variable x2=0, alt. opt. soln. exists.

EE 477 Dr. Mohamed Zribi 325 EE 477 Dr. Mohamed Zribi 326

Example 46: Alternative optimal solutions


Maximize z 2 x1 x2
Subject to:
(0,6) Optimal BFSs All points on this line segment (except
the endpoints) are nonbasic optimal x1 x2 10
(0,5) feasible solutions.
(2,4) 2 x1 x2 40
x1 , x2 0
We shall solve this problem by the Simplex method.
(6,0) (10,0)
Note that the objective function line is parallel to the first constraint line.
EE 477 Dr. Mohamed Zribi 327 EE 477 Dr. Mohamed Zribi 328
x1 x2 s1 s2 Sol.

x1 x2 s1 s2 Sol.
1 -1 1 0 10

0 1 -2 1 20
1 -1 1 0 10
0 -1 2 0 20

2 -1 0 1 40
This is the optimal tableau. Optimal Solution is x1=6, x2=0 and z=6
However,
-2 1 0 0 0
Since coefficient of the nonbasic variable x2=0, alt. opt. soln. exists.

EE 477 Dr. Mohamed Zribi 329 EE 477 Dr. Mohamed Zribi 330

Since the coefficient of the nonbasic variable s1 is zero in the


x1 x2 s1 s2 Sol.
objective function row, we expect an alternative optimal BFS to
exist. We see that the problem indeed has an infinite number of
1 0 -1 1 30
alternative feasible solutions which are NOT basic.
0 1 -2 1 20 Could you guess them?

Answer:
0 0 0 1 40

x1= 30+t; x2 = 20+2t, where t is any nonnegative number.


Note that we have got an optimal solution.

The optimal solution is x1=30, x2=20 and z = 40.


We can easily see this graphically also.

EE 477 Dr. Mohamed Zribi 331 EE 477 Dr. Mohamed Zribi 332
Example 47: Alternative optimal solutions

(30,20)

Maximize z 10 x1 5 x2
All points on this line from (30,20)
onwards are Optimal non-basic Subject to: x1 150
solutions.
x2 200
2 x1 x2 400
x1 , x2 0

EE 477 Dr. Mohamed Zribi 333 EE 477 Dr. Mohamed Zribi 334

Graphical solution
x2
Maximize z=10x1+5x2 Thus we see that the objective function z is maximum at the corner

Subject to: (150, 200) and also has an alternative optimum solution at the

2x1+x2 400 corner (100, 200). It may also be noted that z is maximum at each
point of the line segment joining them. Thus the problem has an
(100,200)
x1 150
infinite number of (finite) optimum solutions. This happens when
0,200)
z maximum x2 200
=2000 at
the objective function is “parallel” to one of the constraint
z=600 z=1500 x1,x2 0 equations.
(150,100)
z=2000 Solution is such that:
z=1000

α(150, 200)+(1- α) (100, 200)=(100 +50α, 200) where 0 ≤ α ≤ 1


x1
z=400 (150,0) EE 477 Dr. Mohamed Zribi 335 EE 477 Dr. Mohamed Zribi 336
Example 48: Alternative optimal solutions
Example 49: Alternative optimal solutions
BV Eq. # x1 x2 x3 x4 x5 RHS
Maximize z 2 x1 x2 3x3 x2
x4
1
2
0
0
1
0
1 0
1 1
2 10
5
1
Subject to: x1 3 1 0 0 0 1 15
Z Z 0 0 2 0 0 80
x1 x2 5 x3 10
There is a nonbasic variable (x5) whose reduced
2 x1 x2 3x3 40
cost is equal to zero. If we put it in the basis
x1 , x2 , x3 0 the resulting solution will also be optimal.

Show that the above LPP has an infinite number of Optimal


(nonbasic) feasible solutions.

EE 477 Dr. Mohamed Zribi 337 EE 477 Dr. Mohamed Zribi 338

Special Case 2: No Feasible Solution Example 50: No Feasible Solutionx 2

Maximize z = 5x1 + 7 x2
If an LP is in the standard form with slack variables Subject to
only, then the problem has solution (s). 2 x1 - x2 ≤ -1
- x1 + 2 x2 ≤ -1
If a LP uses artificial variables, and the solution of the
x1, x2 ≥ 0
Phase I LP is such that r > 0, the original LP is infeasible.

No feasible solution

x1

EE 477 Dr. Mohamed Zribi 339 EE 477 Dr. Mohamed Zribi 340
Example 51: No feasible solution

Example 52: No feasible solution

Using the Simplex method, show that the following problem is infeasible
Max z = 3x1 5x2
x2
s.t.
x1 7 Min 2 x1 3 x2
2 x2 12 s.t. 3 x1 4 x2 12
3 x1 2 x2 18 7 x1 6 x2 42
x1 0, x2 0 x1 , x2 0
x1
infeasible No optimal solution!

EE 477 Dr. Mohamed Zribi 341 EE 477 Dr. Mohamed Zribi 342

Solution:
x1 x2 s1 s2 a1 b x1 x2 s1 s2 a1 b
minz=2x1 3x2
3 4 1 0 0 12 3 4 1 0 0 12
subject to 3 x1 4 x2 s1 12
7 6 0 1 1 42 7 6 0 1 1 42
7 x1 62 s2 42
0 0 0 0 1 0 7 6 0 1 0 42
x1 0 x2 0 s1 0 s2 0

Phase I x1 x2 s1 s2 a1 b x1 x2 s1 s2 a1 b
1 4 1 0 0 4 1 4 1 0 0 4
min r=a1 3 3 3 3

7 6 0 1 1 42 0 10 7 1 1 14
subject to 3 x1 4 x2 s1 12 3 3

7 6 0 1 0 42 0 10 7 1 0 14
7 x1 62 s2 a1 42 3 3

x1 0 x2 0 s1 0 s2 0
Minimum r =14 > 0 => the LP is infeasible
EE 477 Dr. Mohamed Zribi 343 EE 477 Dr. Mohamed Zribi 344
Special Case 3: Unbounded Solutions
From the graph, it is clear that the LP has No feasible solution

In some LPPs, the values of some decision variables can be


Min 2 x1 3x2 increased indefinitely without violating any of the constraints,
s.t. 3 x1 4 x2 12
meaning that the solution space is unbounded in at least one
7 x1 6 x2 42
x1 , x2 0 direction.

As a result the objective value may increase (maximization case) or


decrease (minimization case) indefinitely. Thus both the feasible
solution space and the objective function are unbounded.

EE 477 Dr. Mohamed Zribi 345 EE 477 Dr. Mohamed Zribi 346

Unbounded Solutions Unbounded Solutions


This case refers to the situation where the new basic solution can be
Suppose in a Simplex iteration, some variable can enter but no
increased indefinitely without causing any one of the old basic variables
variable can leave. This will happen when all the entries in the
to become negative.
entering variable column are either zero or negative, this means
the entering variable (which is right now having the zero value)
This will be the case if the Ratio Test fails to identify a variable to be
can be increased indefinitely without violating any of the taken out of the basis.
constraints and thus z can be increased indefinitely or the problem
has unbounded solution. The symptom is that the column of the new basic variable consists of
non-positive elements (thus the Ratio Test fails).

Therefore, if every coefficient in the column of the new basic variable

EE 477 Dr. Mohamed Zribi 347


is non-positive, the solution is unbounded.
EE 477 Dr. Mohamed Zribi 348
Example 53: Unbounded Solutions x2 Example 54: Unbounded Solutions

Maximize z = x1 + x2 z=70
Max 2 x1 3 x2
Subject to
s.t. x1 4 x2 8
- x1 + 3 x2 ≥ 30 - 3 x1 + x2 ≤ 2 x1 x2 4 Feasible region
30 z=50
x1 , x2 0 is unbounded
x1, x2 ≥ 0 Feasible region
is unbounded
z=30

z=20

unbounded solution x1

EE 477 Dr. Mohamed Zribi 349 EE 477 Dr. Mohamed Zribi 350

Example 55: Unbounded Solutions Example 56: Unbounded Solutions


Feasible region
is unbounded BV Eq. # x1 x2 x3 x4 x5 RHS
x5 1 0 6 0 1 1 25
Max z = x1 2 1 2 0 6 0 40
3x1 5x2 x2 x3 3 0 0 1 1 0 10
x1 4
s.t. x1 4 Z Z 0 3 0 2 0 80
x1 0, x2 0
z 3x1 5 x2 According to the Rule, x2 is the new basic variable.
If we conduct the Ratio Test on the x2 column, we fail to find a variable to be
taken out of the basis.
(4,0) x1
This means that x2 can be increased indefinitely => unbounded solutions.

EE 477 Dr. Mohamed Zribi 351 EE 477 Dr. Mohamed Zribi 352
Example 57: Unbounded Solutions Thus the variable x2 can be increased indefinitely without

Maximize violating any of the constraints and thus the solution space
z 20 x1 10 x 2 x3
and the objective function are both unbounded.
Subject to:

3 x1 3 x2 5 x3 50
x1 x3 10 (You can form the Simplex tableau and verify that in x2

x1 x2 4 x3 20 column all the entries in the constraint rows are negative or

x1 , x 2 , x 3 0 zero and that in the z-Row, it is negative.)

Show that the solution space is unbounded in the x2 direction.

EE 477 Dr. Mohamed Zribi 353 EE 477 Dr. Mohamed Zribi 354

Example 58: Unbounded solution Solution: Introducing the slack variables x3 ≥ 0 and x4 ≥ 0,
the given system of equations can be written in canonical
form as:
Minimize z = -3x1- 2x2 x1 x2 x3 1
3x1 2 x2 x4 6
3x1 2 x2 z 0
subject to: x1 x2 1
The basic feasible solution corresponding to this canonical
3 x1 2 x2 6 form is given by:
x1 0, x2 0
x3 1, x4 6 (basic variables)
x1 x2 0 (nonbasic variables)
z 0

EE 477 Dr. Mohamed Zribi 355 EE 477 Dr. Mohamed Zribi 356
Variables Variables

Basic x1 x2 x3 x4 -f bi” b1”/ ais” for Basic x1 x2 x3 x4 -f bi” b1”/ ais” for
variables ais”>0 variables ais”>0

x3 1 -1 1 0 0 1 1 Smaller value x1 1 -1 1 0 0 1
1 (x3 leaves the
basis) Smaller value
x4 3 -2 0 1 0 6 2 x4 0 11 -3 1 0 3 3 (x4 leaves the
basis)

-f -3 -2 0 0 1 0 -f 0 -5 3 0 1 3

Most negative ci (x1 enters the next basis) Most negative ci (x2 enters the next basis)

EE 477 Dr. Mohamed Zribi 357 EE 477 Dr. Mohamed Zribi 358

At this stage, we notice that x3 has the most negative cost


coefficient and hence it should be brought into the next basis.
Variables

Basic
variables
x1 x2 x3 x4 -f bi” b1”/ ais” for
However, since all the coefficients ai3” are negative, the value of
ais”>0
z can be decreased indefinitely without violating any of the
x1 1 0 -2 1 0 4
Both ais” are negative constraints if we bring x3 into the basis. Hence the problem has
(i.e. No variable leaves
x2 0 1 -3 1 0 3
the basis
no bounded solution.

-f 0 0 -12 5 1 18

In general, if all the coefficients of the entering variable xs (ais”)


Most negative ci (x3 enters the next basis)
have negative or zero values at any iteration, we can conclude
that the problem has an unbounded solution.
EE 477 Dr. Mohamed Zribi 359 EE 477 Dr. Mohamed Zribi 360
Special Case 4: Degeneracy Example 59:

If in a basic feasible solution (BFS) one (or more) of the basic


Maximize z 3 x1 2 x2
variables is equal to zero then we say we have a degenerate
Subject to
BFS. This usually happens when there is a tie for the leaving 4 x1 x2 8
variable. There is nothing alarming in having a degenerate BFS 4 x1 3x2 12
except that in some cases it may lead to cycling.
4 x1 x2 8
x1 , x 2 0
Any basic feasible solution with a basic variable equal to zero is
said to be a degenerate BFS. We solve it by Simplex method.
EE 477 Dr. Mohamed Zribi 361 EE 477 Dr. Mohamed Zribi 362

Solution: Solution:
x1 x2 s1 s2 s3 b
x1 x2 s1 s2 s3 b
4 -1 1 0 0 8 1 -1/4 1/4 0 0 2

4 3 0 1 0 12 0 4 -1 1 0 4

4 1 0 0 1 8 0 2 -1 0 1 0

-3 -2 0 0 0 0 0 -11/4 3/4 0 0 6

We observe that there is a tie for the leaving variable.

EE 477 Dr. Mohamed Zribi 363 EE 477 Dr. Mohamed Zribi 364
Special Case 5: Cycling
x1 x2 s1 s2 s3 b
It is possible that the simplex method could go through several
1 0 1/8 0 1/8 2 iterations, each time encountering a BFS with the same z-value, and
0 0 1 1 -2 4 return to a BFS it has seen before!!
0 1 -0.5 0 0.5 0
0 0 -5/8 0 11/8 6
This is called cycling.
x1 x2 s1 s2 s3 b This is the optimal Once the simplex method encounters the first repeated BFS, it will
1 0 0 -1/8 3/8 3/2 tableau. Note that continue to cycle through the same pivots, effectively becoming
0 0 1 1 -2 4
the optimal BFS stuck!
0 1 0 1/2 -3/2 2
0 0 0 5/8 1/8 17/2 obtained is NOT
degenerate.
EE 477 Dr. Mohamed Zribi 365 EE 477 Dr. Mohamed Zribi 366

Cycling Cycling
Is it possible that the simplex procedure we described will never
In practice, cycling is extremely rare stop?
The answer is Yes!

Reason: If there is a change in the basis but not in the value of the
Simplex can be modified so that cycling cannot occur because
objective function, i.e. a basic variable whose value is zero leaves
there are simple remedies to prevent cycles, for example the the basis, we can cycle indefinitely between the two solutions.
Bland’s Rule. A basis with one or more of the basic variables equal zero is called
degenerate.

EE 477 Dr. Mohamed Zribi 367 EE 477 Dr. Mohamed Zribi 368
Example 60: Cycling
Exceptional cases Identified from the Simplex
tableau Table 1

BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS
* Tie for leaving variable - Degeneracy x5 1 1/2 11/2 5/2 9 1 0 0 0
x6 2 1/2 3/2 1/2 1 0 1 0 0
If in a Simplex iteration, there is a tie for leaving variable, x7 3 1 0 0 0 0 0 1 1
Z Z -10 57 9 24 0 0 0 0
then the resulting BFS will be degenerate, in the sense Table 2

that one of the basic variables will also be zero. This may BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS
x1 1 1 11 5 18 2 0 0 0
result in getting a new BFS without improving z. And in x6 2 0 4 2 8 1 1 0 0
some cases this may lead to “cycling.” x7 3 0 11 5 18 2 0 1 1
Z Z 0 53 41 204 20 0 0 0

EE 477 Dr. Mohamed Zribi 369 EE 477 Dr. Mohamed Zribi 370

Table 3 Table 5

BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS
BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS x3 1 2 4 1 0 1/2 9/2 0 0
x1 1 1 0 1/2 4 3/4 11/4 0 0 x4 2 1/2 1/2 0 1 1/4 5/4 0 0
x2 2 0 1 1/2 2 1/4 1/4 0 0 x7 3 1 0 0 0 0 0 1 1
x7 3 0 0 1/2 4 3/4 11/4 1 1 Z Z 20 9 0 0 21/2 141/2 0 0
Z Z 0 0 29/2 98 27/4 53/4 0 0
Table 6
Table 4

BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS BV Eq. # x1 x2 x3 x4 x5 x6 x7 RHS


x3 1 2 0 1 8 3/2 11/2 0 0 x5 1 4 8 2 0 1 9 0 0
x2 2 1 1 0 2 1/2 5/2 0 0 x4 2 1/2 3/2 1/2 1 0 1 0 0
x7 3 1 0 0 0 0 0 1 1 x7 3 1 0 0 0 0 0 1 1
Z Z 29 0 0 18 15 93 0 0 Z Z 22 93 21 0 0 24 0 0

EE 477 Dr. Mohamed Zribi 371 EE 477 Dr. Mohamed Zribi 372
Table 7 = Table 1 Example 61: Cycling happens in this example
x1 x2 x3 x4 x5 x6
BV Eq. # x7 RHS
3 1
x5 1 1/2 11/2 5/2 9 1 0 0 0 Maximize z x1 20 x2 x3 6 x4
x6 2 1/2 3/2 1/2 1 0 1 0 0 4 2
x7 3 1 0 0 0 0 0 1 1
Z Z 10 57 9 24 0 0 0 0 Subject to:
1
Remark: x1 8 x2 x3 9 x4 0
4
In practice this is not an issue because there are simple 1 1
remedies to prevent cycles, eg. Bland’s Rule.
x1 12 x2 x3 3 x4 0
2 2
x3 1
x1 , x2 , x3 , x4 0

EE 477 Dr. Mohamed Zribi 373 EE 477 Dr. Mohamed Zribi 374

Example 62: Cycling Cycling

x1 x2 x3 x4 x5 x6 x7 b
x1 x2 x3 x4 x5 x6 x7 Ans
1
4 8 1 9 1 0 0 0
1 0 8 84 12 8 0 0
1 1
2 12 2 3 0 1 0 0 0 1 3
8
15
4
1
2
1
4 0 0
0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1
3 1
4 20 2 6 0 0 0 3 0 0 2 18 1 1 0 3

x1 x2 x3 x4 x5 x6 x7 b x1 x2 x3 x4 x5 x6 x7 Ans
1 32 4 36 4 0 0 0 1 32 4 36 4 0 0 0
3 3
0 4 2 15 2 1 0 0 0 4 2 15 2 1 0 0
0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1
7 7
0 4 2 33 3 0 0 3 0 4 2 33 3 0 0 3
375 376
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Cycling Cycling

x1 x2 x3 x4 x5 x6 x7 Ans x1 x2 x3 x4 x5 x6 x7 Ans
5
1 0 8 84 12 8 0 0 2 56 1 0 2 6 0 0
3 15 1 1 1 16 1 2
0 1 8 4 2 4 0 0 4 3 0 1 3 3 0 0
5
0 0 1 0 0 0 1 1 2 56 0 0 2 6 1 1
0 0 2 18 1 1 0 3 1
2 16 0 0 1 1 0 3

x1 x2 x3 x4 x5 x6 x7 Ans x1 x2 x3 x4 x5 x6 x7 Ans
1 11 3 1 11 3
8 0 1 2 2 1 0 0 8 0 1 2 2 1 0 0
3 3 1 1 3 3 1 1
64 1 0 16 16 8 0 0 64 1 0 16 16 8 0 0
1 11 3 1 11 3
8 0 0 2 2 1 1 1 8 0 0 2 2 1 1 1
1
4 0 0 3 2 3 0 3 1
4 0 0 3 2 3 0 3
377 378
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Cycling Cycling

x1 x2 x3 x4 x5 x6 x7 Ans x1 x2 x3 x4 x5 x6 x7 Ans
5 1
2 56 1 0 2 6 0 0 4 8 1 9 1 0 0 0
1 16 1 2 1 1
4 3 0 1 3 3 0 0 2 12 2 3 0 1 0 0
5
2 56 0 0 2 6 1 1 0 0 1 0 0 0 1 1
3 1
1
2 16 0 0 1 1 0 3 4 20 2 6 0 0 0 3

x1 x2 x3 x4 x5 x6 x7 Ans x1 x2 x3 x4 x5 x6 x7 Ans
5 1 5 1
4 28 2 0 1 3 0 0 4 28 2 0 1 3 0 0
1 1 1 1 1 1
6 4 6 1 0 3 0 0 6 4 6 1 0 3 0 0
0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1
7 1 7 1
4 44 2 0 0 2 0 3 4 44 2 0 0 2 0 3
379 380
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Duality Theory

The theory of duality is a very elegant and important


concept within the field of optimization. This
9. Introduction to Duality theory was first developed in relation to linear
programming, but it has many applications, and
perhaps even a more natural and intuitive
interpretation, in several related areas such as
nonlinear programming, networks and game theory.
EE 477 Dr. Mohamed Zribi 381 EE 477 Dr. Mohamed Zribi 382

Duality Theory Duality

The notion of duality within linear programming asserts Associated with every linear programming problem is a
that every linear program has associated with it a corresponding dual linear programming problem. If
related linear program called its dual. The original
one of these problems is one of minimization the
problem in relation to its dual is termed the primal.
other one is of maximization, and the optimal values
of the corresponding objective functions are equal.
It is the relationship between the primal and its dual,
both on a mathematical and economic level, that is
truly the essence of duality theory.

EE 477 Dr. Mohamed Zribi 383 EE 477 Dr. Mohamed Zribi 384
Symmetric Duals
Duality
The original Problem (Primal) is:
n
max becomes min max Z cjxj
x variables go
away x j 1
subject to

a11 x1 a12 x 2 ... a1 n x n b1


Primal
a 21 x1 a 22 x 2 ... a2 n xn b2
RHS coefficients ... ... ... ...
swap places with
objective function y variables ... ... ... ...
coefficients
appear a m 1 x1 a m 2 x2 ... a mn x n bm
sense
changes x1 , x 2 ,..., x n 0

EE 477 Dr. Mohamed Zribi 385 EE 477 Dr. Mohamed Zribi 386

The Dual Problem is: Symmetric Duals


n
m maximize c jx j
min w bi yi j 1
y n
i 1 Primal
subject to subject to a ij x j bi for i 1, 2, ..., m
j 1
a11 y1 a21 y 2 a m1 y m c1 xj 0 for j 1, 2, ..., n.
a12 y1 a22 y 2 am 2 ym c2 dual problems

Dual m
minimize bi yi
i 1
a1n y1 a2 n y2 amn y m cn m Dual
subject to a ij y i cj for j 1, 2, ..., n
y1 , y 2 , , ym 0 i 1

yi 0 for i 1, 2, ..., m.
EE 477 Dr. Mohamed Zribi 387 EE 477 Dr. Mohamed Zribi 388
Definition: Symmetric Duals Symmetric Duals
Primal Problem Dual Problem Primal Problem Dual Problem
n m
Max Z cjxj, Min W bi yi , Maximize Z cT x, Minimize W y T b,
j 1 i 1
s.t. n s.t. m subject to subject to
aij x j bi , aij yi c j, Ax b AT y c
j 1 i 1
for i 1,2, , m. for j 1,2, , n. x 0. y 0.
xj 0, for j 1,2, , n. yi 0, for i 1,2, , m.

The dual problem uses exactly the same parameters b is not assumed to be non-negative
as the primal problem, but in different location.
EE 477 Dr. Mohamed Zribi 389 EE 477 Dr. Mohamed Zribi 390

Symmetric Duals Primal-dual table for LPs


Primal Problem
Primal Problem Dual Problem Coefficient of: Right
min z cT x max w yT b x1 x2 xn Side

Objective Function
y 1 a11 b1
Coefficient
a12 a1n
subject to: Dual Problem

Coefficients for
subject to
y 2 a21

(Minimize)
a22 a2 n b2
of:
T T
Ax b y A c
y m am1 am 2 amn bm
x 0 y 0
Right
Side ≥ ≥ ≥
c1 c2 cn
Coefficients for
Objective Function
EE 477 Dr. Mohamed Zribi 391 (Maximize)
EE 477 Dr. Mohamed Zribi 392
Relationships between Primal and Dual Problems General Rules for Constructing Duals
1. The number of variables in the dual problem is equal to the
One Problem Other Problem
number of constraints in the original (primal) problem. The
Constraint i Variable i
number of constraints in the dual problem is equal to the
Objective function Right sides number of variables in the original problem.

Minimization Maximization 2. Coefficient of the objective function in the dual problem


0 come from the right-hand side of the original problem.
Variables 0 Constraints
Unrestricted
0 3. If the original problem is a max model, the dual is a min
Constraints 0 Variables model; if the original problem is a min model, the dual

EE 477
Unrestricted
Dr. Mohamed Zribi 393
problem is the max problem.
EE 477 Dr. Mohamed Zribi 394

4. The coefficient of the first constraint function for the dual problem are the 8. The ith variable in the dual is unrestricted in sigh if and only if
coefficients of the first variable in the constraints for the original the ith constraint in the original problem is an equality.
problem, and the similarly for other constraints.
9. If the original problem is max (min) model, then after
5. The right-hand sides of the dual constraints come from the objective applying Rule 8, assign to the remaining variables in the dual
function coefficients in the original problem. a sense opposite to (the same as) the corresponding
constraints in the original problem.
6. The sense of the ith constraint in the dual is = if and only if the ith
variable in the original problem is unrestricted in sign. Max model Min model
xi ≥ 0 <=> ith constraint ≥
xi ≤ 0 <=> ith constraint ≤
7. If the original problem is max (min ) model, then after applying Rule 6, xi free <=> ith constraint =
assign to the remaining constraints in the dual a sense the same as ith const ≤ <=> yi ≥ 0
(opposite to ) the corresponding variables in the original problem. ith const ≥ <=> yi ≤ 0
ith const = <=> yi free
EE 477 Dr. Mohamed Zribi 395 EE 477 Dr. Mohamed Zribi 396
Example 63: Example 64:
The Primal
maximize 3x1 x 2 2x 3
Primal subject to x1 x 2 3x 3 30
2 x1 2x 2 5x 3 24
4 x1 x2 2x 3 36
x1 , x 2 , x 3 0

The dual
minimize 30y1 24y 2 36y 3
subject to y1 2y 2 4y 3 3
Dual
y1 2y 2 y3 1
3y1 5y 2 2y 3 2
y1 , y 2 , y 3 0
EE 477 Dr. Mohamed Zribi 397 EE 477 Dr. Mohamed Zribi 398

Example 65: Example 66:


Write the dual of the following LPP

max z 5.24 x1 7.30 x2 8.34 x3 4.18 x4


s.t.
1.5 x1 x2 2.4 x3 x4 2000
x1 5 x2 x3 3.5 x4 8000
x1 3 x2 3.5 x3 x4 5000

x1 , x2 , x3 , x4 0
EE 477 Dr. Mohamed Zribi 399 EE 477 Dr. Mohamed Zribi 400
Solution: Example 67:
The Dual Problem is
Primal Problem Dual Problem
min w 2000 y1 8000 y2 5000 y3
s.t.
Max Z 3 x1 5 x2 , Min W 4 y1 12 y2 18 y3 ,
1.5 y1 y 2 1.5 y3 5.24 s.t.
s.t.
y1 5 y2 + 3.0 y3 7.30 x1 4
2 x2 12 y1 3 y3 3
2.4y1 y2 3.5 y3 8.34
y1 3.5 y2 y3 4.18 3 x1 2 x2 18 2 y2 2 y3 5
x1 0, x 2 0 y1 0, y2 0, y3 0
y1 , y2 , y3 0
EE 477 Dr. Mohamed Zribi 401 EE 477 Dr. Mohamed Zribi 402

Primal Problem Dual Problem Example 68: Find the dual


in Matrix Form in Matrix Form
Max Min 4 Find the dual of the following LP:
x
Z 35 1 , W y1 y2 y3 12 Reversed
s.t. x2 s.t. 18 Constraint constants

1 0 4 1 0 Objective coefficients
x
0 2 1 , 12 y1 , y2 , y3 0 2 3,5
x Columns into constraints and
3 2 2 18 3 2 constraints into columns

x1 0
. y1 , y2 , y3 0,0,0 .
x2 0
EE 477 Dr. Mohamed Zribi 403 EE 477 Dr. Mohamed Zribi 404
Solution: Example 69:

There is a small company in Melbourne which has recently become


engaged in the production of office furniture. The company
manufactures tables, desks and chairs. The production of a table
requires 8 kgs of wood and 5 kgs of metal and is sold for $80; a desk
uses 6 kgs of wood and 4 kgs of metal and is sold for $60; and a
chair requires 4 kgs of both metal and wood and is sold for $50. We
would like to determine the revenue maximizing strategy for this
company, given that their resources are limited to 100 kgs of wood
and 60 kgs of metal.

EE 477 Dr. Mohamed Zribi 405 EE 477 Dr. Mohamed Zribi 406

Solution:
Dual:
Primal:

max Z 80x1 60x2 50x3


x
min w 100 y1 60 y2
y
Subject to:
8x1 6x2 4x3 100 Subject to: 8 y1 5 y2 80
5x1 4x2 4x3 60 6 y1 4 y2 60
x1 ,x2 ,x3 0 4 y1 4 y2 50
y1 , y 2 0
EE 477 Dr. Mohamed Zribi 407 EE 477 Dr. Mohamed Zribi 408
Example 70: Solution:

An individual has a choice of two types of food to eat, meat and Primal:
potatoes, each offering varying degrees of nutritional benefit.
He has been warned by his doctor that he must receive at least
min Z 10x1 2x2
400 units of protein, 200 units of carbohydrates and 100 units x

of fat from his daily diet. Given that a kg of steak costs $10 and
Subject to: 8 0 x1 40 x2 400
provides 80 units of protein, 20 units of carbohydrates and 30
units of fat, and that a kg of potatoes costs $2 and provides 40 2 0 x1 50 x2 200
units of protein, 50 units of carbohydrates and 20 units of fat, he 3 0 x1 20 x2 100
would like to find the minimum cost diet which satisfies his x1 , x 2 0
nutritional requirements

EE 477 Dr. Mohamed Zribi 409 EE 477 Dr. Mohamed Zribi 410

Example 71:
Dual:
max w 400 y 1 200 y 2 100 y 3 Primal Dual
y

min 7 x1 x2 5 x3 max 10 y1 6 y2
Subject to :
s.t. x1 x2 3 x3 10 s.t. y1 5 y2 7
80 y 1 20 y 2 30 y 3 10 5 x1 2 x2 x3 6 y1 2 y2 1
x1 , x2 , x3 0 3 y1 y2 5
40 y 1 50 y 2 20 y 3 2
y1 , y2 0
y1 , y 2 , y 3 0

EE 477 Dr. Mohamed Zribi 411 EE 477 Dr. Mohamed Zribi 412
Example 72: Dual
m in w 20 y1 30 y 2
y

Primal
3 y1 18 y 2 5
max Z 5x1 3x2 8x3 0 x4 12 x5
x 8 y1 5 y2 3
Subject to: 8 y2 8
3x1 8x2 9 x4 15x5 20 9 y1 4 y2 0
18x1 5x2 8x3 4 x4 12 x5 30 15 y1 12 y 2 12
x1 ,x2 ,x3 ,x4 ,x5 0 y1 , y 2 0

EE 477 Dr. Mohamed Zribi 413 EE 477 Dr. Mohamed Zribi 414

Primal-Dual Relationship Example 73:

max Z 4 x1 10 x 2 9 x3
x

x1 0 x2 0 xn 0 w=
Subject to :
y1 0 a11 a12 a1n b1
y2 0 a21 a22 a2n b2
5 x1 18 x 2 5 x3 15
Dual
(min w) ... ... ... ... ... 8 x1 12 x 2 8 x3 8
ym 0 am1 am2 amn bn 12 x1 4 x2 8 x3 10
2 x1 5 x3 5
Z= c1 c2 cn

x1 , x 2 , x 3 0

EE 477 Dr. Mohamed Zribi 415 EE 477 Dr. Mohamed Zribi 416
Dual

x1 0 x2 0 x3 0 w=
min w 15 y1 8 y2 10 y3 5 y4
y1 0 5 18 5 15
y
y2 0 8 12 -8 8
Dual
y3 0 12 4 8 10
(min w)
y4 0 2 0 5 5

Z= 4 10 9
5 y1 8 y2 12 y 3 2 y4 4
18 y1 12 x 2 4 y3 10
5 y1 8 y3 5 y4 9
y1 , y 2 , y 3 , x 4 0

EE 477 Dr. Mohamed Zribi 417 EE 477 Dr. Mohamed Zribi 418

Example 74: Dual:

Primal:

Reversed

Constraint constants

Objective coefficients

Columns into constraints and


constraints into columns

EE 477 Dr. Mohamed Zribi 419 EE 477 Dr. Mohamed Zribi 420
Un-symmetric Duals (Maximize)
Given the primal problem (in standard form)

Maximize
z c1 x1 c2 x2 ... cn xn
subject to a11 x1 a12 x 2 ... a1 n x n b1
10. Un-Symmetric Duals
a 21 x1 a 22 x 2 ... a 2 n x n b2
.
.
a m 1 x1 a m 2 x2 ... a mn x n bm
x1 , x 2 , ..., x n 0, b1 , b2 , ..., bm 0
EE 477 Dr. Mohamed Zribi 421
421 EE 477 Dr. Mohamed Zribi 422

The dual problem is the LPP Un-symmetric Duals


Minimize w b1 y1 b2 y 2 ... bm y m
subject to Primal Problem Dual Problem
a11 y1 a 21 y 2 ... a m1 y m c1
max z cT x
a12 y1 a 22 y 2 ... a m 2 y m c2 min w yTb
. Subject to :
Subject to :
. Ax b
y T A cT
a1n y1 a2 n y2 ... a mn y m cn x 0 and b 0
y1 , y 2 ,..., y n unrestricted in sign

EE 477 Dr. Mohamed Zribi 423 EE 477 Dr. Mohamed Zribi 424
Un-symmetric Duals (Minimize) Then the dual problem is the LPP
If the primal problem (in standard form) is
Minimize z c1 x1 c2 x2 ... c n x n Maximize w b1 y1 b2 y 2 ... bm y m
subject to
subject to
a11 x1 a12 x2 ... a1n xn b1
a11 y1 a 21 y 2 ... a m 1 y m c1
a21 x1 a22 x2 ... a2 n xn b2
a12 y1 a 22 y 2 ... a m 2 y m c2
. .
. .
am1 x1 am 2 x2 ... amn xn bm a1 n y1 a2 n y2 ... a mn y m cn
x1 , x2 ,..., xn
EE 477
0, b1 , b2 ,..., bm
Dr. Mohamed Zribi
0 425
y1 , y 2 , ..., y n unrestricted in sign
EE 477 Dr. Mohamed Zribi 426

Un-symmetric Duals
Example 75:

Write the dual of the LPP


Primal Problem Dual Problem Maximize z 5 x1 2 x2
min z cT x max w yT b subject to
x1 x2 2
subject to subject to:
2 x1 3x2 5
Ax b y T A cT
x1 , x2 0
x 0 and b 0

EE 477 Dr. Mohamed Zribi 427 EE 477 Dr. Mohamed Zribi 428
Thus the primal in the standard form is: Hence the dual is:

Maximize z 5x1 2x2 0x3 0x4 Minimize w 2 y1 5 y2


subject to: subject to
x1 x2 x3 2
y1 2 y2 5
2 x1 3 x2 x4 5
y1 3 y2 2
x1 , x2 , x3 , x4 0
y1 0
y1 0, y2 0
y2 0
EE 477 Dr. Mohamed Zribi 429 y1 , y 2 unrestricted in sign EE 477 Dr. Mohamed Zribi 430

Example 76: Thus the primal in the standard form is:

Write the dual of the LPP


Minimize z 6x1 3x2 0x3 0x4 0x5

Minimize z 6 x1 3x2 subject to:

subject to: 6 x1 3 x2 x3 x4 2
6 x1 3 x2 x3 2
3 x1 4 x2 x3 x5 5
3 x1 4 x2 x3 5
x1 , x2 , x3 , x4 , x5 0
x1 , x2 , x3 0

EE 477 Dr. Mohamed Zribi 431 EE 477 Dr. Mohamed Zribi 432
Hence the dual is:
Example 77:

Maximize w 2 y1 5 y2 Write the dual of the LPP

subject to:
Maximize z x1 x2
6 y1 3 y2 6
3 y1 4 y2 3 subject to

y1 y2 0
2 x1 x2 5
y1 0 3 x1 x2 6
y1 , y2 0
y2 0 x1 , x2 unrestricted in sign
y1 , y 2 u n r e s t r i c t e d i n s i g n
EE 477 Dr. Mohamed Zribi 433 EE 477 Dr. Mohamed Zribi 434

Thus the primal in the standard form is: Hence the dual is:

Maximize z x1 x1 x2 x2 Minimize w 5 y1 6 y 2
subject to:
subject to:

2 x1 2 x1 x2 x2 5 2 y1 3 y2 1
2 y1 3 y2 1 2 y1 3y2 1
3 x1 3 x1 x2 x2 6 y1 y2 1
y1 y2 1
x1 , x1 , x2 , x2 0 y1 y2 1
y 1 , y 2 u n r e s tr ic te d in s ig n
EE 477 Dr.435
Mohamed Zribi 435 EE 477 Dr.436
Mohamed Zribi 436
Finding the Dual of Nonstandard Linear
Conversion of Equality Constraints
Programs
k
d ixi e
We handle “=“ constraints by writing them as “<=“ i 1

constraints. k
k
d i xi e d i xi e
This is possible here because we do not require here i 1 i 1
k
k
d i xi e d i xi e
that the RHS is non-negative. i 1
i 1

Standard form!

EE 477 Dr. Mohamed Zribi 437 EE 477 Dr. Mohamed Zribi 438

Example 78: Conversion


Maximize z x1 x2 x3
Multiply through the greater-than-or-equal-to
Subject to inequality constraint by -1
2 x2 x3 4
Use the approach described above to convert the
x1 3x2 4 x3 5
equality constraint to a pair of inequality
x1 2 x2 2 constraints.

Replace the variable unrestricted in sign, , by the


x1 , x2 0, x3 is unrestricted
difference of two nonnegative variables.
EE 477 Dr. Mohamed Zribi 439 EE 477 Dr. Mohamed Zribi 440
Therefore, the original problem can be written
Dual
such that:
max Z x1 x2 x3, x3,, min w 4y1 5y2 5y3 3y4
x
y

Subject to:
2 x2 x3, x3,, 4 y2 y3 y4 1
, ,,
x1 3 x2 4x 3 4x 3 5 2 y1 3 y2 3 y3 2 y4 1
x1 3 x2 4 x3, 4 x3,, 5 y1 4 y2 4 y3 1
x1 2 x2 3 y1 4 y2 4 y3 1
x1 , x2 , x3, , x3,, 0 y1 , y 2 , y 3 , y 4 0

EE 477 Dr. Mohamed Zribi 441 EE 477 Dr. Mohamed Zribi 442

Streamlining the conversion ... Going back to the example:

An equality constraint in the primal generates a dual


min w 4 y1 5 y2 5 y3 3y4
y
variable that is unrestricted in sign.
y2 y3 y4 1
2 y1 3 y2 3 y3 2 y4 1
An unrestricted in sign variable in the primal
y1 4 y2 4 y3 1
generates an equality constraint in the dual.
y1 4 y2 4 y3 1
y1 , y 2 , y3 , y 4 0

EE 477 Dr. Mohamed Zribi 443 EE 477 Dr. Mohamed Zribi 444
Hence, Example 79:
Consider the following primal problem:
min w 4 y1' 5 y'2 3y3'

y '2 y3' 1
2 y1' 3 y '2 2 y3' 1
y1' 4 y '2 1
The first inequality requires no modification.
' ' '
y ,y
1 3 0, , y 2 urs
EE 477 Dr. Mohamed Zribi 445 EE 477 Dr. Mohamed Zribi 446

Therefore, the original problem can be written as,


The second inequality can be changed to the less-than-or-equal-to
type by multiplying both sides of the inequality by -1 and reversing
the direction of the inequality; that is,
The primal problem can now take the following standard form:
The equality constraint can be replaced by the following two
inequality constraints:

The equality can be written as:

If both of these inequality constraints are satisfied, the original


equality constraint is also satisfied.

EE 477 Dr. Mohamed Zribi 447 EE 477 Dr. Mohamed Zribi 448
Hence, the dual problem is such that: Example 80:
The dual of this problem can now be obtained as follows:
Write the dual of the LPP

Maximize z 5 x1 4 x2
subject to 3 x1 8 x2 6
x1 6 x2 5
8 x1 10
x2 0, x1 unrestricted in sign
EE 477 Dr. Mohamed Zribi 449 EE 477 Dr. Mohamed Zribi 450

Solution:

Equivalent non-standard form Dual problem is such that:

Maximize z 5 x1 4 x2 Minimize W 6 y1 5 y2 10 y3
subject to 3 x1 8 x2 6 subject to
3 y1 y2 8 y3 5
x1 6 x2 5 8 y1 6 y2 4
8 x1 10
x2 0, x1 unrestricted in sign y1 0, y2 , y3 unrestricted in sign
EE 477 Dr. Mohamed Zribi 451 EE 477 Dr. Mohamed Zribi 452
Example 81: The equivalent form is such that:

max Z 6 x1 4 x2 max Z 6 x1 4 x2
x x

Subject to: Subject to:


3 x1 5 x2 12 3 x1 5 x2 12
x1 2 x2 8 x1 2 x2 8
5 x1 x2 10 5 x1 x2 10
x1 , x2 0 x1 , x2 0

EE 477 Dr. Mohamed Zribi 453 EE 477 Dr. Mohamed Zribi 454

The dual is such that: Example 82: Min 0.4 x1 0.5 x2


s.t. 0.3x1 0.1x2 2.7
min W 12 y1 8 y2 10 y3
y 0.5 x1 0.5 x2 6
0.6 x1 0.4 x2 6
Subject to: x1 0, x2 0
3 y1 y2 5 y3 6
5 y1 2 y2 y3 4 Min 0.4 x1 0.5 x2
y1 , y3 0 , y 2 urs s.t. 0.3 x1 0.1x2 2.7 [y1 ]
0.5 x1 0.5 x2 6 [y 2 ]
0.5 x1 0.5 x2 6 [y -2 ]
0.6 x1 0.4 x2 6 [y 3 ]
EE 477 Dr. Mohamed Zribi 455
x1 0, x2 0
EE 477 Dr. Mohamed Zribi 456
Max 2.7 y1 6( y2 y 2 ) 6 y3
s.t. 0.3 y1 0.5( y2 y 2 ) 0.6 y 3 0 .4
0.1 y1 0.5( y2 y 2 ) 0.4 y 3 0 .5
y1 0, y2 0, y2 0, y3 0. 11. Solving LPs Using
Max 2.7 y1 6 y2 6 y3 Duality
s.t. 0.3 y1 0.5 y2 0.6 y3 0 .4
0.1 y1 0.5 y2 0.4 y3 0 .5
y1 0, y2 : URS, y3 0.
EE 477 Dr. Mohamed Zribi 457 EE 477 Dr. Mohamed Zribi 458
458

Property 1 Proof :

For any feasible solution to the primal problem and any Am nxn 1 bm 1
feasible solution to the dual problem, the value of
y1T m A m n x n 1 y1T m b m 1
the primal objective function being maximized is
always equal to or less than the value of the dual
objective function being minimized. A Tn m y m 1 c n 1 or y1T m A m n c1T n
y1T m A m n x n 1 c1T n x n 1

y1T m b m 1 c1T n x n 1

EE 477 Dr. Mohamed Zribi 459 EE 477 Dr. Mohamed Zribi 460
Property 2 Proof:

If x* is a feasible solution to the primal problem According to the previous property, no feasible x
*
and y is a feasible solution to the dual problem can make cT x larger than bT y. Since x* achieves this value,
such that n m
it is optimal (maximum).
*
T
c x *
b yT * cjx j bi yi*
j 1 i 1
* Similarly, no feasible y can bring by below the number
then x is an optimal solution to the primal problem
* cT x, and any y * that achieves this minimum must be optimal.
and y is an optimal solution to the dual problem.

EE 477 Dr. Mohamed Zribi 461 EE 477 Dr. Mohamed Zribi 462

Duality Theorem Theorem 1:

If either the primal or dual problem has a finite optimal


The Fundamental Theorem of Duality
solution, so does the other, and the corresponding A primal problem has a solution if and only if the
values of objective functions are equal. If either corresponding dual problem has a solution.
Furthermore, if a solution exists, then:
problem has an unbounded objective, the other
a. The objective functions of both the primal
problem has no feasible solution. and the dual problem attain the same
optimal value.
b. The optimal solution to the primal problem
appears under the slack variables in the last
row of the final simplex tableau associated
EE 477 Dr. Mohamed Zribi 463 with the dual
EE 477problem.
Dr. Mohamed Zribi 464
Lemma: Remark:
n
maximize c jx j n m
j 1 . c jx * j b i y *i Optimal solution for both
n
j 1 i 1
subject to a ij x j bi for i 1, 2, ..., m
j 1

xj 0 for j 1, 2, ..., n. feasible solutions for feasible solutions for


Proof:
primal (maximization) dual (minimization)
n n m

m
c jx * j a ijy*i x * j
minimize bi yi j 1 j 1 i 1
i 1 m n

subject to
m
a ij y i cj for j 1, 2, ..., n
a ijx * j y*i
i 1 j 1
i 1

yi 0 for i 1, 2, ..., m. m
b i y *i
i 1

EE 477 Dr. Mohamed Zribi 465 EE 477 Dr. Mohamed Zribi 466

Example 83: Remark:

Primal Dual
Any pair of primal and dual problems can be
min 7 x1 x2 5 x3 max 10 y1 6 y2
s.t. x1 x2 3 x3 10 s.t. y1 5 y2 7 converted to each other.
5 x1 2 x2 x3 6 y1 2 y2 1
3 y1 y2 5 The dual of a dual problem always is the primal
x1 , x2 , x3 0
y1 , y2 0 problem.
x=(7/4,0,11/4) and y=(2,1) are feasible solutions
7*7/4 + 0 + 5*11/4 = 10*2 + 6*1 = 26
Thus, x and y are optimal
EE 477 Dr. Mohamed Zribi 467 EE 477 Dr. Mohamed Zribi 468
Remark: Relations between Primal and Dual
1. The dual of the dual problem is again the primal problem.
The feasible solutions for a dual problem are
2. Either of the two problems has an optimal solution if and
those that satisfy the condition of optimality for only if the other does; if one problem is feasible but
its primal problem. unbounded, then the other is infeasible; if one is
infeasible, then the other is either infeasible or
feasible/unbounded.
A maximum value of z in a primal problem
equals the minimum value of w in the dual 3. Weak Duality Theorem: The objective function value of
the primal (dual) to be maximized evaluated at any
problem. primal (dual) feasible solution cannot exceed the dual
(primal) objective function value evaluated at a dual
(primal) feasible solution.
EE 477 Dr. Mohamed Zribi 469 cTx >= bTy (in theDr.standard
EE 477 Mohamed Zribi equality form) 470

Duality of LP
4. Strong Duality Theorem: When there is an optimal
solution, the optimal objective value of the primal is
the same as the optimal objective value of the dual. Every linear programming problem has an associated

cTx* = bTy* linear program called its dual such that a solution to
the original linear program also gives a solution to its
5. Complementary Slackness Theorem: Consider an
inequality constraint in any LP problem. If that dual
constraint is inactive for an optimal solution to the
problem, the corresponding dual variable will be zero
in any optimal solution to the dual of that problem.
Solve one, get one free!!
x*j (c-ATy*)j = 0, j=1,…,n.
EE 477 Dr. Mohamed Zribi 471 EE 477 Dr. Mohamed Zribi 472
Solution of a Minimization Problem

Given a minimization problem with non-negative


coefficients in the objective function, 4. Use the simplex method to solve the dual
1. Write all problem constraints as ≥ inequalities. problem.
(This may introduce negative numbers on the
right side of some problem constraints.) 5. Read the solution of the minimization problem
2. Form the dual problem. from the bottom row of the final simplex tableau
3. Write the initial system of the dual problem, using in step 4.
the variables from the minimization problem as
slack variables. Note: If the dual problem has no optimal solution,
the minimization problem has no optimal solution.
EE 477 Dr. Mohamed Zribi 473 EE 477 Dr. Mohamed Zribi 474

Example 84: Solution:


※ The corresponding maximization problem is called the dual
maximization problem of the original minimization problem,
we want to minimize w 0.12 x1 0.15 x2 , which is as follows
subject to the constraints
Find the maximum value of z 300 y1 36 y2 90 y3 ,
60 x1 60 x2 300
subject to the constraints
12 x1 6 x2 36
10 x1 30 x2 90 60 y1 12 y2 10 y3 0.12
60 y1 6 y2 30 y3 0.15
where x1 0 and x2 0
where y1 0, y2 0, and y3 0

※ The solution of the original minimization problem can be found


by applying the simplex method to the new dual maximization
problem

EE 477 Dr. Mohamed Zribi 475 EE 477 Dr. Mohamed Zribi 476
Apply the simplex method with the initial basic solution (y1, y2,
y3, s1, s2)= (0, 0, 0, 0.12, 0.15)

So the optimal solution is (y1, y2, y3, s1, s2) = (7/4000, 0, 3/2000, 0, 0) with the
maximum value to be 300(7/4000)+36(0)+90(3/2000) = 33/50 = 0.66

※ The optimal values of xi’s for the original minimization can be obtained
from the entries in the bottom row corresponding to slack variable columns,
i.e., x1=3 and x2=2
※ So the minimum value for the original objective function is 0.12(3)+0.15(2)
= 0.66, which is exactly the maximum value for the dual maximization
problem.
EE 477 Dr. Mohamed Zribi 477 EE 477 Dr. Mohamed Zribi 478

Example 85: Solving a minimization problem 2. Derive the matrix corresponding to the dual maximization
Find the minimum value of w = 3x1 + 2x2, subject to the constraints
problem by taking transpose
2 x1 x2 6
x1 x2 4
where x1 0 and x2 0

Solution: The above augmented matrix implies the following


1. The augmented matrix corresponding the this maximization problem:
minimization problem Find the maximum value of z = 6y1+ 4y2, subject to the
constraints
2 y1 y2 3
y1 y2 2
where y1 0 and y2 0
EE 477 Dr. Mohamed Zribi 479 EE 477 Dr. Mohamed Zribi 480
Apply the simplex method with the initial basic solution
(y1, y2, s1, s2)= (0, 0, 3, 2)

From this final simplex tableau, you can see the


maximum value of z is 10. So the solution of the
original minimization problem is w =10, and this
occurs when (x1, x2) = (2, 2)

EE 477 Dr. Mohamed Zribi 481 EE 477 Dr. Mohamed Zribi 482

Example 86: Solving a minimization problem


Find the minimum value of w = 2x1 + 10x2 + 8x3, subject to the The corresponding maximization problem:
constraints Find the maximum value of z = 6y1 + 8y2 + 4y3,
x1 x2 x3 6 subject to the constraints
x2 2 x3 8 y1 y3 2
x1 2 x2 2 x3 4 y1 y2 2 y3 10
where x1 0, x2 0, and x3 0 y1 2 y2 2 y3 8

where y1 0, y2 0, and y3 0
Solution:
First, transpose the augmented matrix The initial simplex tableau

transpose

EE 477 Dr. Mohamed Zribi 483 EE 477 Dr. Mohamed Zribi 484
Example 87:
A small petroleum company owns two refineries. Refinery 1 costs
$20,000 per day to operate, and it can produce 400 barrels of high-
grade oil, 300 barrels of medium-grade oil, and 200 barrels of low-
grade oil each day. Refinery 2 is newer and more modern. It costs
$25,000 per day to operate, and it can produce $300 barrels of high-
grade oil, 400 barrels of medium-grade oil, and 500 barrels of low-
grade oil each day
The company has orders totaling 25,000 barrels of high-grade
oil, 27,000 barrels of medium-grade oil, and 30,000 barrels of low-
grade oil. How many days should this petroleum company run each
From the last row of this final simplex tableau, you can see the refinery to minimize its costs and still refine enough oil to meet its
maximum value of z is 36. So the solution of the original minimization orders?
problem is w =36, and thisEEoccurs
477 Dr.when
Mohamed (x
Zribi, x , x ) = (2, 0, 4)
1 2 2
485 EE 477 Dr. Mohamed Zribi 486

Solution:
Now apply the simplex method to the dual problem
Let x1 and x2 represent the numbers of days on which the two
refineries are operated. Then the total cost is represented by
C = 20,000x1 + 25,000x2,
and the constraints are
400 x1 300 x2 25, 000 (high-grade oil)
300 x1 400 x2 27, 000 (medium-grade oil)
200 x1 500 x2 30, 000 (low-grade oil)
where x1 0 and x2 0

transpose

EE 477 Dr. Mohamed Zribi 487 EE 477 Dr. Mohamed Zribi 488
Example 88:

max x1 4 x2 3 x3
s.t.
PRIMAL
2 x1 2 x2 x3 4
x1 2 x2 2 x3 6
x1 , x2 , x3 0
From this final simplex tableau, you can see the
solution for the original minimization problem is C = min 4 y1 6 y2
s.t.
$ 1,750,000 and this occurs when x1 = 25 and x2 = DUAL
2 y1 y2 1
50, i.e., the two refineries should be operated for 25 2 y1 2 y2 4
y1 2 y2 3
and 50 days, respectively
y1 , y2 0
EE 477 Dr. Mohamed Zribi 489 EE 477 Dr. Mohamed Zribi 490

x1 x2 x3 x4 x5
x4 2 2 1 1 0 4 Example 89:
x5 1 2 2 0 1 6 Dual:
Primal:
1 4 3 0 0 0
maximize: minimize:
z = 2x1 + 3x2 z = 4y1 + 18y2 + 10y3
x1 x2 x3 x4 x5
x2 1 1 1/ 2 1/ 2 0 2
x1 0 subject to:
subject to:
x5 1 0 1 1 1 2 x2 1 x1 – ≤ 4
2x2 y1 + 2y2 ≥2
3 0 1 2 0 8 x3 2
2x1 + ≤ 18 ≥3
-2y1 + Y2 + Y3
x1 x2 x3 x4 x5 B 1 x2
y1 1 x2 ≤ 10 y1 , y 2 , y 3 ≥ 0
x2 3/ 2 1 0 1 1/ 2 1
x3 1 0 1 1 1 2 y2 1 x1 , x 2 ≥ 0
2 0 0 1 EE 477 1Dr. Mohamed
10Zribi T 1
Solution to both is 38 (x1=4, x2=10), (y1=0, y2=1, y3=2).
c BB 491 EE 477 Dr. Mohamed Zribi 492
Example 90: The dual is the LPP
Consider the LPP Minimize w y1 5 y2 6 y3
Maximize z 50 x1 30 x2 10 x3 subject to
2 y1 4 y3 50
y1 2 y2 30
subject to 2 x1 x2 1 y3 10
2 x2 5 y1 , y2 , y3 unrestricted in sign
4 x1 x3 6
x1 , x2 , x3 0
Show that the given primal problem is infeasible and its dual is y1 5, y3 10, y2 any number 15
unbounded.
The primal is infeasible as 2nd constraint violates x2 0 is a feasible solution of the dual. Hence the dual is unbounded.

EE 477 Dr. Mohamed Zribi 493 EE 477 Dr. Mohamed Zribi 494

Example 91: Consider the Primal LPP x1 x2 x2


1 Primal
Maximize z x1 x2
subject to
x1 x2 1 x1 x2 1
x1 x2 1 x1
x1 , x2 0
y1 y2 1

Its dual is the LPP y2


Minimize w y1 y2 Both the problems have
infeasible solutions as we can
subject to y1 y2 1
y1 y2 1 easily show.

y1 y2 1 y1
y1 , y2 0 Dual
EE 477 Dr. Mohamed Zribi 495 EE 477 Dr. Mohamed Zribi 496
Sensitivity Analysis

Rarely are the parameters in the objective function and


constraints known with certainty.
– Usually parameters are just estimates which don’t reflect
uncertainties such as absenteeism or personal transfers in
the Stratton Company problem.
– After solving the problem using these estimated values,
the analysts can determine how much the optimal values
of the decision variables and the objective function value
z would be affected if certain parameters had different
values. This type of post solution analysis for answering
“what-if” questions is called sensitivity analysis.

EE 477 Dr. Mohamed Zribi 497 EE 477 Dr. Mohamed Zribi 498

EE 477 Dr. Mohamed Zribi 499 EE 477 Dr. Mohamed Zribi 500
Duality Theory Rules for converting Primal to Dual
Every LP problem (called the ‘Primal’) has associated with
If the Primal is to maximize, the dual is to minimize.
another problem called the ‘Dual’.
If the Primal is to minimize, the dual is to maximize.
The ‘Dual’ problem is an LP defined directly and systematically
For every constraint in the primal, there is a dual variable.
from the original (or Primal) LP model.
For every variable in the primal, there is a constraint in the dual.
The optimal solution of one problem yields the optimal solution
to the other.

Duality ease the calculations for the problems, whose number of


variables is large.

EE 477 Dr. Mohamed Zribi 501 EE 477 Dr. Mohamed Zribi 502

Dual Problem Example:


Primal LP : Associated Dual LP :
Max z = c1x1 + c2x2 + ... + cnxn Min. z = b1y1 + b2y2 + ... + bmym
Primal
Max. Z = 3x1+5x2
subject to: subject to: Subject to constraints:
The Primal has:
a11x1 + a12x2 + ... + a1nxn ≤ b1 a11y1 + a21y2 + ... + am1ym ≥ c1 x1 <4 y1 2 variables and 3 constraints.
a21x1 + a22x2 + ... + a2nxn ≤ b2 a12y1 + a22y2 + ... + am2ym ≥ c2 2x2 < 12 y2 So the Dual has:
: : 3x1+2x2 < 18 y3 3 variables and 2 constraints
am1x1 + am2x2 + ... + amnxn ≤ bm a1ny1 + a2ny2 + ... + amnym ≥ cn x1, x2 > 0
Dual
Min. Z’ = 4y1+12y2 +18y3
x1 ≥ 0, x2 ≥ 0,…….xj ≥ 0,……., xn ≥ 0. y1 ≥ 0, y2 ≥ 0,…….yj ≥ 0,…….,
Subject to constraints:
ym ≥ 0. We define one dual y1 + 3y3 > 3
variable for each primal 2y2 +2y3 > 5
constraint. y1, y2, y3 > 0
EE 477 Dr. Mohamed Zribi 503 EE 477 Dr. Mohamed Zribi 504
Example Solution

Primal Dual

Min.. Z = 10x1+15x2 Max.. Z’ = 80y1+100y2

Subject to constraints: Subject to constraints:


5x1 + 7x2 > 80 5y1 + 6y2 < 10
6x1 + 11x2 > 100 7y1 + 11y2 < 15
x1 , x 2 > 0 y1, y2 > 0

EE 477 Dr. Mohamed Zribi 505 EE 477 Dr. Mohamed Zribi 506

Example Solution

The second inequality 2x1 + 5x2 > 20 can be changed to


Primal the less-than-or-equal-to type by multiplying both sides of the
Max. Z = 12x1+ 4x2 inequality by -1 and reversing the direction of the inequality; that
is,

Subject to constraints: -2x1 - 5x2 < -20


4x1 + 7x2 < 56
The equality constraint 5x1 + 4x2 = 40 can be replaced by
2x1 + 5x2 > 20 the following two inequality constraints:
5x1 + 4x2 = 40
5x1 + 4x2 < 40
x1, x2 > 0
5x1 + 4x2 > 40 -5x1 - 4x2 < -40
EE 477 Dr. Mohamed Zribi 507 EE 477 Dr. Mohamed Zribi 508
The primal problem can now take the following standard form: The dual of this problem can now be obtained as follows:

Max. Z = 12x1+ 4x2 Min. Z’ = 56y1 -20y2 + 40y3 – 40y4


Subject to constraints:
Subject to constraints:
4x1 + 7x2 < 56
4y1 – 2y2 + 5y3 – 5y4 > 12
-2x1 - 5x2 < -20
7y1 - 5y2 + 4y3 – 4y4 > 4
5x1 + 4x2 < 40
y1 , y 2 , y 3 , y 4 > 0
-5x1 - 4x2 < -40
x1 , x 2 > 0

EE 477 Dr. Mohamed Zribi 509 EE 477 Dr. Mohamed Zribi 510

Example Solution:
Primal Primal in standard form :
Min.. Z = 2x2 + 5x3 Max.. Z = -2x2 - 5x3

Subject to constraints: Subject to constraints:


x1 + x2 >2 -x1 - x2 < -2
2x1 + x2 +6x3 < 6 2x1 + x2 +6x3 < 6
x1 - x2 +3x3 = 4 x1 - x2 +3x3 < 4
x1 , x 2 , x 3 > 0 - x1 + x2 - 3x3 < -4
x1 , x 2 , x 3 > 0

EE 477 Dr. Mohamed Zribi 511 EE 477 Dr. Mohamed Zribi 512
Dual
Min. Z’ = -2y1 + 6y2 + 4y3 – 4y4
Subject to constraints:

-y1 + 2y2 + y3 – y4 > 0


-y1 + y2 - y3 + y4 > -2
6y2 + 3y3 - 3y4 > -5
y1 , y 2 , y 3 , y 4 > 0

EE 477 Dr. Mohamed Zribi 513 EE 477 Dr. Mohamed Zribi 514

Introduction Dual Simplex Method


Suppose a “basic solution” satisfies the optimality condition but
To start the dual Simplex method, the following two
not feasible, then we apply dual simplex method. In regular conditions are to be met:
Simplex method, we start with a Basic Feasible solution (which
is not optimal) and move towards optimality always retaining 1. The objective function must satisfy the optimality conditions of
feasibility. In the dual simplex method, the exact opposite
the regular Simplex method.
occurs. We start with a “optimal” solution (which is not feasible)
and move towards feasibility always retaining optimality 2. All the constraints must be of the type .
condition. The algorithm ends once we obtain feasibility.

EE 477 Dr. Mohamed Zribi 515 EE 477 Dr. Mohamed Zribi 516
Example Solution:
Min. Z = 3x1 + 2x2 Step I: The first two inequalities are multiplied by –1 to convert
Subject to constraints:
them to < constraints and convert the objective function into
3x1 + x2 > 3 maximization function.
4x1 + 3x2 > 6 Max. Z’ = -3x1 - 2x2 where Z’= -Z
x1 + x2 < 3 Subject to constraints:
-3x1 - x2 < -3
x1 , x 2 > 0
-4x1 - 3x2 < -6
x1 + x2 < 3
x1, x2 > 0

EE 477 Dr. Mohamed Zribi 517 EE 477 Dr. Mohamed Zribi 518

Let S1, S2 , S3 be three slack variables


Basic Coefficients of: Sol.
Model can rewritten as: Variable Z x1 x2 S1 S2 S3
Z 1 3 2 0 0 0 0
Z’ + 3x1 + 2x2 = 0 S1 0 -3 -1 1 0 0 -3
-3x1 - x2 +S1 = -3 S2 0 -4 -3 0 1 0 -6
-4x1 - 3x2 +S2 = -6 S3 0 1 1 0 0 1 3
Ratio - 3/4 2/3 - - -
x1 + x2 +S3 = 3
•Initial Basic Solution is Optimal (as the optimality condition is satisfied) but
Initial BS is : x1= 0, x2= 0, S1= -3, infeasible.
S2= -6, S3= 3 and Z=0. •Choose the most negative basic variable. Therefore, S2 is the departing
variable.
•Calculate Ratio = |Z row / S2 row| (S2 < 0)
•Choose minimum ratio. Therefore, x2 is the entering variable.
EE 477 Dr. Mohamed Zribi 519 EE 477 Dr. Mohamed Zribi 520
Basic Coefficients of: Sol. Basic Coefficients of: Sol.
Variable Z x1 x2 S1 S2 S3 Variable Z x1 x2 S1 S2 S3
Z 1 1/3 0 0 2/3 0 4 Z 1 0 0 1/5 3/5 0 21/5
S1 0 -5/3 0 1 -1/3 0 -1 x1 0 1 0 -3/5 1/5 0 3/5
x2 0 4/3 1 0 -1/3 0 2 x2 0 0 1 4/5 -3/5 0 6/5
S3 0 -1/3 0 0 1/3 1 1 S3 0 0 0 -1/5 2/5 1 6/5
Ratio - 1/5 - - 2 -

Therefore, S1 is the departing variable and x1 is the Optimal Solution is : x1= 3/5, x2= 6/5, Z= 21/5
entering variable.
EE 477 Dr. Mohamed Zribi 521 EE 477 Dr. Mohamed Zribi 522

Example Solution:
Let S1, S2 , S3 be three slack variables
Max. Z = -x1 - x2
Subject to constraints:
Model can rewritten as:
Z + x 1 + x2 = 0
x1 + x2 < 8 x1 + x2 + S1 = 8
x2 > 3 -x2 + S2 = -3
-x1 + x2 < 2 -x1 + x2 + S3 = 2
x 1, x 2 > 0 x1 , x2 > 0

Initial BS is : x1= 0, x2= 0, S1= 8,


EE 477 Dr. Mohamed Zribi 523 S2= -3, S3= 2 and
EE 477 Z=0.
Dr. Mohamed Zribi 524
Basic Coefficients of: Sol. Basic Coefficients of: Sol.
Variable Z x1 x2 S1 S2 S3 Variable Z x1 x2 S1 S2 S3
Z 1 1 1 0 0 0 0 Z 1 1 0 0 1 0 -3
S1 0 1 1 1 0 0 8 S1 0 1 0 1 1 0 5
S2 0 0 -1 0 1 0 -3 x2 0 0 1 0 -1 0 3
S3 0 -1 1 0 0 1 2 S3 0 -1 0 0 1 1 -1
Ratio - - 1 - - - Ratio - 1 - - - -

Therefore, S2 is the departing variable and x2 is the Therefore, S3 is the departing variable and x1 is the
entering variable. entering variable.
EE 477 Dr. Mohamed Zribi 525 EE 477 Dr. Mohamed Zribi 526

Basic Coefficients of: Sol.


Variable Z x1 x2 S1 S2 S3
Z 1 0 0 0 2 1 -4
S1 0 0 0 1 2 0 4
x2 0 0 1 0 -1 0 3
x1 0 1 0 0 -1 -1 1

Optimal Solution is : x1= 1, x2= 3, Z= -4

EE 477 Dr. Mohamed Zribi 527 EE 477 Dr. Mohamed Zribi 528
Matrix Standard Form of an LP Model To help you distinguish Tabular Standard Form of an LP Model
between matrices, vectors,
and scalars, we use
BOLDFACE CAPITAL
letters to represent matrices,
bold lowercase letters to
represent vectors, and
italicized letters in ordinary
print to represent scalars.

EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Transforming Any LP Model into the Transforming Any LP Model into the Standard Form
Standard Form

(1) Minimizing rather than maximizing the objective (4) Deleting the nonnegativity constraints for some decision variables

Maximize Z΄ = – Z
(2) Some functional constraints with a less-than-or-equal-to inequality

Example 1
Introduce the concept of slack variables.
To illustrate, use the first functional constraint, x1 ≤ 4, in the Wyndor Glass Original Model Standard Form
Co. problem as an example. x1 ≤ 4 is equivalent to x1 + x2=4 where x2 ≥ 0.
The variable x2 is called a slack variable.
(3) Some functional constraints with a greater-than-or-equal-to inequality

Introduce the concept of surplus variables.


For example, a functional constraint x1 – 2x2 ≥ 5 is equivalent to x1 – 2x2 – x3 = 5
where x3 ≥ 0.
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
The variable, x3 , is called a surplus variable.
Example 2 (1) Set Z΄ = – Z .
Then the minimization
Original Model of Z becomes the
maximization of Z΄.

(2) Add a slack variable x6 to


10. The Essence of the
the left-hand side of the first

Simplex Method
functional constraints.

Standard Form (3) Subtract a surplus


variable x7 from the left-
hand side of the second
functional constraints.
(4) Substitute x4 – x5 for x3
where x4 and x5 are
nonnegative variables. EE 477 Dr. Mohamed Zribi
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Geometric Concepts of Simplex Method Geometric Concepts of Simplex Method

Constraint boundary : a line that


forms the boundary of the feasible
region. In this example, each corner-point
solution lies at the intersection of
Corner-point solutions: the points
of intersection. two constraint boundaries. For a
H
linear programming problem with n
decision variables, each of its
The 8 points A, B, C, D, E, F, G, B C G
and H are corner-point solutions. corner-point solutions lies at the

D intersection of n constraint
The five points A, B, C, D and E are
the corner-point feasible solutions boundaries.
(CPF solutions).
A E F Constraint boundaries and corner-point
The points F, G and H are called
solutions for the Wyndor Glass Co.
corner-point infeasible solutions.EE 477 Constraint boundaries and corner-point
Dr. Mohamed Zribi EE 477
Problem
Dr. Mohamed Zribi
solutions for the Wyndor Glass Co. Problem
Geometric Concepts of Simplex Method
Adjacent CPF Soluionts

For a two-variable problem, a constraint boundary = a line. For a


three-variable problem, a constraint boundary = a plane. For an n-
variable problem, a constraint boundary = a hyperplane Z=36 at point C (2,6)

Z=27 at point D (4, 3) B C


C
D B Z=30 at point B (0, 6)
D
C
A
D E F
EE 477 Dr. Mohamed Zribi G EE 477 Dr. Mohamed Zribi

Solving the example The Key Solution Concepts

Z=0 at point A
B C Z=30 at point B
Z=36 at point C
D Z=27 at point D
A E EE 477
Z=12 at point E
Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
The Key Solution Concepts
The Key Solution Concepts

B C

D
EE 477 Dr. Mohamed Zribi
A
EE 477
E
Dr. Mohamed Zribi

The Key Solution Concepts


(2) Setting Up the Simplex Method
Original Form of the Model

Augmented Form of the Model

B C
D
A
EE 477 E
Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Augmented Form of the Model

HH The only difference between basic solutions and corner-


point solutions is whether the values of the slack variables
are included
BB CC GG
Relationship between Corner-Point Solutions and Basic Solutions
DD In the original model, we In the augmented model, we
H(3,2
H(3,2) have have
AA EE FF
)
Corner-point solution Basic solution
Corner-point feasible (CPF) Basic Feasible (BF) solution
For example, H(3,2) is a solution for the original model, which yields the
solution
augmented solution ( x1, x2, x3, x4, x5) = (3, 2 ,1 ,8, 5)

For example, G(4,6) is a corner-point infeasible solution, which yields the


corresponding basic solutionEE(477x1, xDr.2,Mohamed
x3, x4,Zribi
x5) = (4, 5 ,0 ,0, -6) EE 477 Dr. Mohamed Zribi

The corner-point solution


(0,0) in the original model
corresponds to the basic
solution (0, 0, 4,12, 18) in
the augmented form, where
x1 =0 and x2=0 are the H
nonbasic variables, and
B C G
x3=4, x4=12, and x5=18 are
D
the basic variables
EE 477 Dr. Mohamed Zribi EE 477 A
Dr. Mohamed Zribi E F
Example:
The CPF solution (0,0) in the original model corresponds to
the BF solution (0, 0, 4,12, 18) in the augmented form, where A(0,0) and C(2,6) are two CPF
x1 =0 and x2=0 are the non-basic variables, and x3=4, x4=12, Example:
solutions The corresponding BF
A(0,0) and B(0,6) are two CPF
and x5=18 are the basic variables solutions The corresponding BF
solutions are
solutions are ( x1, x2, x3, x4, x5) = (0, 0 ,4 ,12, 18)
Choose x1 and x4 to be the nonbasic variables that are set ( x1, x2, x3, x4, x5) = (0, 0 ,4 ,12, 18) and and
equal to 0. The three equations then yield, respectively, x3=4, ( x , x , x , x , x ) = (0, 6 ,4 ,0, 6)
1 2 3 4 5
( x1, x2, x3, x4, x5) = (2, 6 ,2 ,0, 0)
x2=6 , and x5=6 as the solution for the three basic variables as H
shown below.
B C G

D
H(3,2)
EE 477 Dr. Mohamed Zribi EE 477
A
Dr. Mohamed Zribi
E F

The Algebra of the Simplex Method

Use the Wyndor Glass Co. Model to illustrate the algebraic


procedure
Initialization
Geometric interpretation Algebraic interpretation

B C
D
A E
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Optimality Test Iteration1 Step1: Determining the Direction of Movement
Geometric interpretation Algebraic interpretation Geometric interpretation Algebraic interpretation

Move up from A(0,0)


A(0,0) is not optimal. The objective function: to B(0,6)
The rate of improvement of Z
by the nonbasic variable x1 is 3
B C
The rate of improvement of Z by D
B C the nonbasic variable x2 is 5 A E
D
A E Conclusion: The initial BF solution
(0,0,4,12,18) is not optimal.
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi

Iteration1 Step2: Where to Stop


Geometric interpretation Algebraic interpretation

Stop at B. Otherwise, it Step 2 determine how far


will leave the feasible to increase the entering
region. basic variable x2.
Thus x4 is the leaving basic variable for iteration 1 of the example.

B C

D
A E
EE 477 Dr. Mohamed Zribi EE 477 Dr. Mohamed Zribi
Initial BF
Solution
Iteration1 Step3: Solving for the New BF Solution (0) Nonbasic variables: x1= 0
Geometric interpretation Algebraic interpretation (1) x 2= 0

Basic variables: x3= 4


(2)
x4 =12
(3)
The intersection of the x5= 18
new pair of constraint
boundary: B(0,6) Nonbasic variables (0) New BF Solution
Nonbasic variables: x1= 0
Basic variables (1)
x4= 0
(2) Basic variables: x3= ?

B C (3) x2 =6
Nonbasic variables
Basic variables: x3= 4 x5= ?
D
Basic variables x2 =6
A E
EE 477 Dr. Mohamed Zribi
x5= 6 EE 477 Dr. Mohamed Zribi

Iteration2
Optimality Test
Geometric interpretation Algebraic interpretation Step1: Determining the Direction of Movement
Choose x1 to be the entering basic variable
Step2: Where to Stop
B(0,6) is not optimal,
The objective function: The minimum ratio test
because moving from
indicates that x5 is the
B to C increases Z. leaving basic variable
The rate of improvement of Z by the
nonbasic variable x1 is 3

The rate of improvement of Z by the Step3: Solving for the New BF Solution
B C nonbasic variable x4 is -5/2
(0)
(1) New BF Solution
D
A E Conclusion: The BF solution (2) Nonbasic variables: x1= 0, x4= 0
EE 477
(0,6,4,0,6) is not optimal.
Dr. Mohamed Zribi (3) EE 477 Basic
Dr. Mohamed Zribivariables: x3= 2, x2 =6, x1= 2
Optimality Test
The objective function:

The coefficients of the non-basic variables x4 and x5 are negative.


Increasing either x4 or x5 will decrease Z, so (x1, x2, x3, x4, x5) =
(2, 6, 2, 0, 0) must be optimal with Z = 36.

In terms of the original form of the


B C problem (no slack variables), the
optimal solution is (x1, x2) = (2, 6) ,
D which yields Z = 3x1+5x2=36.
A E EE 477 Dr. Mohamed Zribi

You might also like