Lecture3
Lecture3
Simple Linear Programming problems (LPP’s) involving only two variables can easily be solved
by a graphical method. The geometrical interpretation of LPP’s with two variables is quite
important and provides a great deal of insight into the structure of problems with more variables.
In particular, the concepts and terminology of linear programming can be explained using this
graphical approach. These are summarized at the end of the section.
The feasible region (i.e. the set of points in the plane satisfying the constraints and the
non-negativity restrictions) is the un-shaded region below:
Now for each value of z, the line is a straight line. Allowing z to vary generates a
set of parallel straight lines (z increases when these lines are shifted to the upper right as
indicated by the broken lines)
It is now immediately obvious that the optimal solution to the problem is given by the upper right
corner of the feasible region. This is the point where the two lines
and intersect. This point has the coordinates
.The associated value of z is 12.37.
AHA – Lecture 3 1
3.1.2 The same problem as 3.1.1 but with the objective function changed to
gives the following:
The lines are now parallel to the edge of the feasible region. This means
that there is no longer a unique solution, but that the entire line-segment from A to B
gives optimal solutions. Note however as in 3.1.1 at least one corner of the feasible
region is optimal.
The above two examples illustrated normal (well-behaved) LPP’s. The next two will
illustrate the two possible exceptional cases:
AHA – Lecture 3 2
In this case the feasible region is unbounded i.e. there are many feasible solutions. This is
indicated by the un-shaded area.
There is no point satisfying the constraints and therefore we say the problem is infeasible (This is
indicated by the fact that the shaded areas do not overlap on the graph).
AHA – Lecture 3 3
NOTE: Unbounded and infeasible solutions are in practice usually due to incorrect formulation of
the problem.
The above examples also illustrate important facts concerning linear programming problems
which can be summarized as follows:
(i) A linear programming (LP) problem is the problem of maximizing or minimizing a linear
function subject to a finite number of linear constraints.
(ii) The linear function that is to be maximized or minimized in a LP problem is called the
objective function.
(iii) Numbers that satisfy all the constraints of a LP problem constitute a feasible solution of
that problem.
(iv) A feasible solution that maximizes or minimizes the objective function is called an
optimal solution. The corresponding value of the objective function is called the optimal
value of the problem.
(v) Not every LP problem has a unique optimal solution. Some problems have many different
solutions and others have no optimal solution at all.
(vi) Problems which have no feasible solutions are called infeasible.
(vii) Problems that have many feasible solutions are called unbounded.
(viii) A LP problem is said to be in standard form when all the constraints are linear
inequalities and all variables are non-negative.
(i) Always choose the variables of the objective function first (i.e. first find what must be
maximized or minimized and then assign variables to these). All the constraints must
then be written in terms of these variables.
(ii) Like constraints must be grouped (i.e. money with money, masses with masses, etc) to
assign the variables.
(iii) The gradient of the objective function is used to draw the search line. The search line is
the line used to find the maximum or minimum of the objective function when it is written
in standard form, i.e, y is the subject of the formula. Note that for grade 11 the maximum
or minimum is found by a numerical search along the boundary of the feasible region.
(iv) The minimum or maximum always occur at a vertex of the feasible region or on a
boundary line if there is no unique solution to the problem. So when you want to
maximize you are looking for a vertex as far as possible from the origin. If you want to
minimize you are looking for a vertex as close as possible to the origin.
(v) The search line must not go through the feasible region but must still touch it (this will
happen at one of the vertices).
Example
AHA – Lecture 3 4
The N. Dustrious Company produces two products: I and II. The raw material requirements,
space needed for storage, production rates, and selling prices for these products are given in
Table 1.
The total amount of raw material available per day for both products is 15751b. The total storage
space for all products is 1500 ft2, and a maximum of 7 hours per day can be used for production.
All products manufactured are shipped out of the storage area at the end of the day. Therefore,
the two products must share the total raw material, storage space, and production time. The
company wants to determine how many units of each product to produce per day to
maximize its total income.
AHA – Lecture 3 5
3.3.1 Slacks and Surplus Variables
Slack Variable
The smaller-than-equal-to constraint has a slack variable.
The slack variable is either positive or zero.
If the slack variable is zero, the resource from that constraint is fully utilized and that
constraint is called a binding constraint and passes through the optimal point.
2x1 + x2 ≤ 15
2x1 + x2 + s1 = 15
Surplus Variable
The larger-than-or-equal-to constraint has a surplus variable.
The surplus variable is either positive or zero.
2x1 + x2 ≥ 15
2x1 + x2 − s2 = 15
If the surplus variable is zero, the utilization of that resource just meets the minimum
requirement and the line of that constraint passes through the optimal point.
Every equality constraint has neither slack nor surplus.
AHA – Lecture 3 6
3.3.3 Simplex Process
Step1. Standardize the problem
Only corner points of feasible solution space are to be checked.
Because these corner points are defined by the intersection of equations, convert the
inequalities (constraints) in the problem statement into equations in order to find the
coordinates of the point.
For less-than-or-equal-to constraints ( ≤)
Add a slack variable (S)
2x1 + x2 ≤ 40
2x1 + x2 + s1 = 40
At the origin (x1 0, x2 0), s1 becomes 40 (OK).
Standard Form
All slack, surplus and artificial variables must be written in the objective function.
The coefficient of the slack and surplus variables is zero in the objective function because
they do not generate any profit or have any costs.
To ensure that the artificial variable is kept out of the final solution, a very large penalty (M or
-M) is assigned as a coefficient of the artificial variable in the objective function.
For a maximization problem, the coefficient of the artificial variable is -M.
For a minimization problem, the coefficient of the artificial variable is M.
AHA – Lecture 3 7
Example 1:
Normal Form Standard Form
Min Z = 45x1 + 12x2 Min Z = 45x1 + 12x2 + 0s1 + Ma1 + 0s2 + Ma2
St: x1 + x2 300 x1 + x2 - s1 + a1 = 300
3x1 250 3x1 – s2 + a2 = 250
x1, x2 ≥ 0 x1, x2 , s1, a1, s1, a1 ≥ 0
AHA – Lecture 3 8
Basis Column
Identify the initial solution variable or basic variables.
Quantity Column
Indicate values of basic variables in the solution.
For the proposed initial solution, this column displays the right hand side quantities of the
constraints.
Ratio Column
This column is used to identify the basic variable that should be removed from the solution (to
become a non-basic variable) without violating any constraint.
Each value under this column in each row is the ratio of the Quantity to the coefficient of the
variable considered in the same row.
Cj Row: Show the coefficients of all variables in the objective function.
Zj Row: Show the amount of profit/cost the objective function will be reduced by when one
unit of the variable, in each column, is brought into the basis.
Cj-Zj Row: Display the net impact on the value of the objective function of bringing one unit of
each of the column variable into the basis.
Cj indicates how much will be gained while Zj shows how much will be simultaneously be lost
If the value of Cj-Zj is positive, the value of the objective function can be increased by
introducing the variable in that column into the solution.
In the minimization problems, if one or more of the Cj-Zj values is negative, then the solution
is not optimal and it can be improved.
Similarly, in the maximization problems, if one or more of the Zj–Cj values is negative, then
the solution is not optimal and it can be improved.
AHA – Lecture 3 9
The Value of the Objective Function
Computed by multiplying each unit profit by its corresponding quantity and then totaling the
results. Z = 0(40)+0(45)+0(12) = 0
Outgoing Variable
An outgoing variable is currently a basic variable that is first reduced to zero when increasing
the value of the incoming variable and will be changed to a non-basic variable (removed from
the solution).
To determine the outgoing variable, compute the ratio of the Quantity to the coefficient of the
incoming variable for each basis row.
For both the maximization and minimization problems, the outgoing variable is the basic
variable with the smallest ratio.
The coefficient of the incoming variable in the outgoing row is called the pivot element.
AHA – Lecture 3 10
Transforming of other rows
Use an elementary row operation (ZERO) to make other elements in the column of the
incoming variable becomes zero.
Transforming of the Zj row
For the new Zj of each column, multiply the Unit Profits / Costs in each row by the column
coefficients and sum the results.
Transforming of the Cj-Zj (or Zj–Cj) row
Subtract Zj from Cj (or Cj from Zj).
More Examples
AHA – Lecture 3 11
3.3.4 Types of Simplex Method
1. The Double Phase Method (with Big M); also known as the regular method.
2. The Dual Simplex Method
The (regular) simplex method moves the initial feasible but non-optimal solution to an optimal
solution while maintaining feasibility through an iterative procedure. On the other hand, the dual
simplex method moves the initial optimal but feasible solution while maintaining optimality through
an iterative procedure.
In other words, the double phase may contain an M value in the objective (and an additional Cj-Zj
(or Zj–Cj) row but the dual simplex does not. The algorithm for both is identical; however, the
Dual Simplex Method has the following iterative procedure:
Step 1: Rewrite the LP problem by expressing all the constraints in ≤ form and transforming
them into equations through slack variables.
Step 2: Exhibit the above problem in the form of simplex tableau. If the optimality condition is
satisfied and one or more basic variables have negative values, the dual simplex method is
applicable.
Step 3: Optimality Condition – The basic variable with the most negative value becomes the
departing variable (D.V). Call the row in which this value appears the work row. If more than
one candidate for D.V. exists, choose one.
Step 4: Optimality Condition – Form ratios by dividing all but the last element of the last row
of Cj-Zj (or Zj–Cj) values by the corresponding negative coefficient of the work row. The non-
basic variable with the smallest absolute ratio becomes the entering variable (E.V). Designate
this element in the work row as the pivot element and the corresponding column the work
column. If more than one candidate for E.V exists, choose one. If no element in the work row
is negative, the problem has no feasible solution.
Step 5: Use elementary row operation to convert the pivot element to 1 and then to reduce all
the other elements in the work column to zero.
Step 6: Repeat steps 3 through 5 until there are no negative values for the basic variables.
AHA – Lecture 3 12
Example – The Dual Simplex
Solution
Expressing all constraints in the ≤ form and adding the slack variables, the problem becomes:
AHA – Lecture 3 13
Since all the (Cj-Zj) values are non-negative, the above solution is optimal. However, it is
infeasible because it has a non-positive value for the basic variable s1. Since s1 is the only
positive variable, it becomes the departing variable
Since x1 has the smallest absolute ratio, it becomes the entering variable. Thus the element -1,
becomes the pivot element. Using elementary row operations, we obtain Tableau 2.
AHA – Lecture 3 14
x1
x1
Feasible area
Optimal
Degenerate
Solution
x2 x2
AHA – Lecture 3 15
3.4.6 No feasible solution
Graphically, there is no solution space that simultaneously satisfies all constraints.
X1
X2
In the Simplex Method, there is no feasible solution if the optimal solution still contains an
artificial variable.
X1
2
3
X2
AHA – Lecture 3 16