Linear Programming Using Simplex Method: Acosta, Barro, Carlos, Delgado, Dela Cruz, Dome, Estidola
Linear Programming Using Simplex Method: Acosta, Barro, Carlos, Delgado, Dela Cruz, Dome, Estidola
Simplex Method
Acosta, Barro, Carlos, Delgado, Dela Cruz,
Dome, Estidola
What is Simplex Method?
Let
x1x1 = The number of hours per week Niki will
work at Job I and
x2x2 = The number of hours per week Niki will
work at Job II. It is customary to choose the
variable that is to be maximized as ZZ . The
problem is formulated the same way as we did in
the last chapter.
eps
• x1+x2+y1=12
• x1+x2+y1=12
Here the variable y1y1 picks up the slack, and it represents
the amount by which x1+x2x1+x2 falls short of 12. In this
problem, if Niki works fewer than 12 hours, say 10, then
y1y1 is 2. Later when we read off the final solution from the
identify the unused
simplex table, the values of the slack variables will identify
the unused amounts.
amounts
We rewrite the objective function
Z=40x1+30x2Z=40x1+30x2 as
−40x1−30x2+Z=0−40x1−30x2+Z=0 .
After adding the slack variables, our problem reads
STEP 3. Construct the initial simplex tableau. Each
inequality constraint appears in its own row. (The non-
negativity constraints do not appear as rows in the simplex
tableau.) Write the objective function as the bottom row.
Here the vertical line separates the left hand side of the
equations from the right side. The horizontal line separates
the constraints from the objective function. The right side of
the equation is represented by the column C.
The reader needs to observe that the last four columns of this
matrix look like the final matrix for the solution of a system of
equations. If we arbitrarily choose x1=0x1=0 and x2=0x2=0 , we
get
The simplex method begins at a corner point where all the main
variables, the variables that have symbols such as x1x1 , x2x2 , x3x3
etc., are zero. It then moves from a corner point to the adjacent
corner point always increasing the value of the objective function. In
the case of the objective function Z=40x1+30x2Z=40x1+30x2 , it will
make more sense to increase the value of x1x1 rather than x2x2 .
The variable x1x1 represents the number of hours per week Niki
works at Job I. Since Job I pays $40 per hour as opposed to Job II
which pays only $30, the variable x1x1 will increase the objective
function by $40 for a unit of increase in the variable x1x1 .
STEP 5. Calculate the quotients. The smallest quotient
identifies a row. The element in the intersection of the
column identified in step 4 and the row identified in this step
is identified as the pivot element.
Answer:
When we choose the most negative entry in the bottom row, we are
trying to increase the value of the objective function by bringing in the
variable x1x1 . But we cannot choose any value for x1x1 . Can we let
x1=100x1=100 ? Definitely not! That is because Niki never wants to
work for more than 12 hours at both jobs combined:
x1+x2≤12x1+x2≤12 . Can we let x1=12x1=12 ? Again, the answer is
no because the preparation time for Job I is two times the time spent
on the job. Since Niki never wants to spend more than 16 hours for
preparation, the maximum time she can work is 16 ÷ 2 = 8.
Question: Why do we identify the pivot element?
Answer:
As we have mentioned earlier, the simplex method begins with a corner point
and then moves to the next corner point always improving the value of the
objective function. The value of the objective function is improved by
changing the number of units of the variables. We may add the number of
units of one variable, while throwing away the units of another. Pivoting
allows us to do just that.
The variable whose units are being added is called the entering variable, and
the variable whose units are being replaced is called the departing variable.
The entering variable in the above table is x1x1 , and it was identified by the
most negative entry in the bottom row. The departing variable y2y2 was
identified by the lowest of all quotients.
STEP 6. Perform pivoting to make all other entries
in this column zero.
Since there is still a negative entry, -10, in the bottom row, we need to
begin, again, from step 4. This time we will not repeat the details of every
step, instead, we will identify the column and row that give us the pivot
element, and highlight the pivot element. The result is as follows .
Now to make all other entries as zeros in this column, we first multiply row
1 by -1/2 and add it to row 2, and then multiply row 1 by 10 and add it to
the bottom row.
Answer: The answer lies in the bottom row. The bottom row
corresponds to the equation:
0x1+0x2+20y1+10y2+Z=400 or z=400−20y1−10y2
0x1+0x2+20y1+10y2+Z=400 or z=400−20y1−10y2
Since all variables are non-negative, the highest value ZZ can ever
achieve is 400, and that will happen only when y1y1 and y2y2 are zero.
STEP 8. Read off your answers.
We now read off our answers, that is, we determine the basic
solution associated with the final simplex tableau. Again, we look
at the columns that have a 1 and all other entries zeros. Since the
columns labeled y1y1 and y2y2 are not such columns, we
arbitrarily choose y1=0y1=0 , and y2=0y2=0 , and we get
The final solution says that if Niki works 4 hours at Job I and 8
hours at Job II, she will maximize her income to $400. Since both
slack variables are zero, it means that she would have used up all
the working time, as well as the preparation time, and none will be
left.
MINIMIZATION
1) Set up the problem.
2) Write a matrix whose rows represent each constraint
with the objective function as its bottom row.
3) Write the transpose of the matrix by interchanging
the rows and the columns.
4) Write the dual problem associated with the transpose.
5) Solve the dual problem by the simplex method.
6) The optimal solution is found in the bottom row of
the final matrix in the columns corresponding to the
slack variables, and the minimum value of the objective
function is the same as the maximum value of the dual.
Convert the following minimization problem into its dual .
Observe that this table looks like an initial simplex tableau without
the slack variables. Next, we write a matrix whose columns are the
rows of this matrix, and the rows are the columns. Such a matrix is
called a transpose of the original matrix. We get:
The following maximization problem associated with the
above matrix is called its dual.
Observe an important
change. Here our main
variables are y1 and y2. and
the slack variables are x1 and
x2.
Step 1: First pick up the rows for which the min, non-
negative ratio is same (tie). To be definite, suppose such
rows are first, third etc. for example
and Max z = 18
Unbounded Solution
• An unbounded solution of a linear programming
problem is a situation where objective function is
infinite.
• A linear programming problem is said to have
unbounded solution if its solution can be made
infinitely large without violating any of its constraints
in the problem.
• Under the Simplex Method, an unbounded solution
is indicated when there are no positive values of
Replacement Ratio.
• Replacement ratio values are either infinite or
negative.
MULTIPLE OPTIMAL SOLUTIONS
Maximize: Z = x1 + 2x2 + x3
CB Basis X1 X2 X3 S1 S2 A1 B
1 1/2 1 /2 1 0 0
3/2 2 1 0 -1 1
0 S1 1 1/2 1 /2 1 0 0 1 2
-M A1 3/2 2 1 0 -1 1 8 4
ZJ -3/2M -2M -M 0 M -M -8M
CJ-ZJ 1+3/2M 2+2M 1+M 0 -M 0
solution values X x2
S1 is our Key Row because it is the minimum non negative value and S1
will be the departing variable.
X2 is our Key Column because it is the maximum positive value and will be
incoming variable.
1/2 is our key element
To get new variables:
For 1st Row (S1): key element of ½ will be divided into the existing variable
For 2nd Row (A1): below of our key element are 2 which will be our new key
element. Existing variable will be less above variable and X2.
Step 7: New Variables/Values
CJ 1 2 1 0 0 -M
CB Basis X1 X2 X3 S1 S2 A1 B
0 X2 2 1 1 2 0 0 2
-M A1 -5/2 0 -1 -4 -1 1 4
ZJ 4+5/2M 2 2+M 4+4M M -M 4-4M
CJ-ZJ 3-5/2 0 -1-M -4-4M -M 0