The Algebraic Technique for
Solving LP’s
Example Problem
Maximize Z = 5x 1 + 2x 2 + x 3
subject to
x 1 + 3x 2 - x 3 ≤ 6,
x 2 + x 3 ≤ 4,
3x 1 + x 2 ≤ 7,
x 1 , x 2 , x 3 ≥ 0.
Simplex and
Example Problem
Step 1. Convert to Standard Form a 11 x 1 + a 12 x 2 + ••• + a 1n x n ≤ b 1 ,
a 21 x 1 + a 22 x 2 + ••• + a 2n x n ≥ b 2 ,
a m1 x 1 + a m2 x 2 + ••• + a mn x n ≤ b m ,
#
a 11 x 1 + a 12 x 2 + ••• + a 1n x n + x x n+1 n+1 = b 1 , a 21 x 1 + a 22 x 2 + ••• + a 2n x n - x x n+2 n+2 = b 2 ,
a m1 x 1 + a m2 x 2 + ••• + a mn x n + x x n+k n+k = b m , In our example problem:
x 1 + 3x 2 - x 3 ≤ 6, x 2 + x 3 ≤ 4, 3x 1 + x 2 ≤ 7, x 1 , x 2 , x 3 ≥ 0.
x 1 + 3x 2 - x 3 + x 4 = 6,
x 2 + x 3 + x 5 = 4,
3x 1 + x 2 + x 6 = 7,
x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0.
Simplex: Step 2
Step 2. Start with an initial basic feasible solution (b.f.s.) and set up the initial tableau.
In our example
Maximize Z = 5x 1 + 2x 2 + x 3 x 1 + 3x 2 - x 3 + x 4 = 6,
x 2 + x 3 + x 5 = 4, 3x 1 + x 2 + x 6 = 7,
x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0. c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
41 3 -1 1 0 0 6
0 x
50 1 1 0 1 0 4
Step 2: Explanation
Adjacent Basic Feasible Solution
If we bring a nonbasic variable x s into the basis, our system changes from the basis, x b , to the following:
x 1 + ā 1s x s = x r + ā rs x r =
x m + ā ms x s =
b 1
b r
b s
#
#
x i = b i − a is for i =1, …, m x s = 1
x j = 0 for j=m+1, ..., n and j≠s The new value of the objective function becomes:
∑ =
+
−
= m
1 i
s is
i
i ( b a ) c
c Z
Thus the change in the value of Z per unit increase in x s is
c s = new value of Z - old value of Z
= ∑ ∑
=
=
− +
− m
1 i
i i m
1 i
s is
i
i ( b a ) c c b
c
∑ =
−
m
1 i
is i
s c a
c
This is the Inner Product rule
=
Simplex:
Step 3
Use the inner product rule to find the relative profit coefficients
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
41 3 -1 1 0 0 6
0 x
50 1 1 0 1 0 4
0 x
63 1 0 0 0 1 7
c row 5 2 1 0 0 0 Z=0
j B j
j c c P
c = −
c 1 = 5 - 0(1) - 0(0) - 0(3) = 5 -> largest positive c 2 = …. 2
c 3 = …. 1
Simplex: Step 5
Apply the minimum ratio rule to determine the basic variable to leave the basis.
The new values of the basis variables:
x i = b i − a is x s for i = 1, ..., m
⎥ ⎦
⎢ ⎤
⎣
= ⎡
> is i 0 s a
a min b x
max
is
In our example:
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
41 3 -1 1 0 0 6
0 x
50 1 1 0 1 0 4
0 x
63 1 0 0 0 1 7
c row 5 2 1 0 0 0 Z=0
Row Basic Variable Ratio
1 x 4 6
2 x 5 -
3 x 6 7/3
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
40 8/3 -1 1 0 0 11/3
0 x
50 1 1 0 1 0 4
5 x 1 1/3 0 0 0 1/3 7/3
Simplex:
Step 6
Perform the pivot operation to get the new tableau and the b.f.s.
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
41 3 -1 1 0 0 6
0 x
50 1 1 0 1 0 4
0 x
63 1 0 0 0 1 7
c row 5 2 1 0 0 0 Z=0
j B j
j c c P
c = −
c B = (0 0 5) New iteration:
find entering
variable:
Final Tableau
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
40 8/3 -1 1 0 0 11/3
0 x
50 1 1 0 1 0 4
5 x
11 1/3 0 0 0 1/3 7/3
c row 0 1/3 1 0 0 -5/3 Z=35/3
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
40 4 0 1 1 0 23/3
1 x
30 1 1 0 1 0 4
5 x
11 1/3 0 0 0 1/3 7/3
c row 0 -2/3 0 0 -1 -5/3 Z=47/3 x 3 enters basis, x 5 leaves basis
Wrong value!
4 should be 11/3
Final Tableau
c
j5 2 1 0 0 0
c
BBasis
x
1x
2x
3x
4x
5x
6Constants
0 x
40 4 0 1 1 0 23/3
1 x
30 1 1 0 1 0 4
5 x
11 1/3 0 0 0 1/3 7/3
c row 0 -2/3 0 0 -1 -5/3 Z=47/3
X1= 7/3
X2 = 0
X3 = 4
X4 = 23/3
X5 = 0
Métodos Cuantitativos M. En C. Eduardo Bustos Farías 11
Exercise: Solving an LP-problem:
A California vintner has available 660 lbs of
Cabernet Sauvignon (CS) grapes, 1860 lbs of Pinot Noir (PN) grapes, and 2100 lbs of Barbera (B)
grapes. The vintner makes a Pinot Noir (PN) wine, which contains 20% CS, 60% PN, and 20% B grapes and sells $3 a bottle, and a Barbera (B) wine, which contains 10% CS, 20% PN, and 70% B grapes and sells for $2 a bottle. Assuming each bottle of wine requires 3 lbs of grapes, determine how many bottles of each type of wine should be produced to
maximize income.
Solving an LP-problem continued :
• Algebraic Technique
¾ The graphical method solving linear programming problems can be used for problems with two
variables (with some difficulty three)
¾ However, for problems were the number of
variables might run into hundreds or thousands, algebraic techniques must be used
¾ The simplex method, with the aid of the computer,
can solve these problems
As with the graphical procedure, the
simplex method finds the optimal corner- point solution of the set of feasible
solutions.
Regardless of the number of decision
variables and regardless of the number of constraints, the simplex method uses the key property of a linear programming
problem, which is:
• A linear programming problem always has an optimal solution occurring at a corner-point solution
Simplex method begins with a feasible
solution and tests whether or not it is
optimum.
Solution of a maximum-type linear programming problem by the
simplex algorithm involves the following steps:
1. Adding slack variables to convert the inequalities into equations
In the case of less-than-or-equal-to
constraints, slack variables are used to
increase the left-hand side to equal the right-
hand side limits of the constraint conditions.
Example: max Z = 3x 1 + x 2 st. 2x 1 + x 2 ≤ 8
2x 1 + 3x 2 ≤ 12
adding slacks and rewriting the object row:
2x 1 + x 2 + s 1 = 8 2x 1 + 3x 2 + s 2 = 12
-3x – x + Z = 0
2x 1 + x 2 + s 1 = 8 2x 1 + 3x 2 + s 2 = 12 -3x 1 – x 2 + Z = 0
2. Setting up the initial simplex tableau Form an augmented coefficient matrix:
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
− 3 1 0 0 1 0 12 0
1 0
3 2
8 0
0 1
1 2
2 1
2 1
2 1
Z s
s
Z s
s x
x
3. Finding an initial feasible solution
Simplex algorithm starts always from origin. In our case it means that the initial feasible solution is:
x 1 = 0, x 2 = 0, s 1 = 8, s 2 = 12.
Simplex method proceeds from this
corner point to an adjacent corner
point. Such corner points are called
4. Introducing basic and nonbasic
variables as the natural way to express basic feasible solutions
For any basic feasible solution (B.F.S.), the
variables held zero are called nonbasic variables and the other are called basic variables.
Moving form one B.F.S. to another means that one basic variable (we call it a departing or
exiting variable) becomes nonbasic and a
nonbasic variable (entering variable) becomes a
basic variable.
5. Choosing the proper pivot element to advance the solution and maintain the non-negativity of all variables
How to decide which variable to make
basic and which nonbasic (in other words in which direction to move from the current
B.F.S.)?
The natural direction is the one in which the value of the objective function
increases the most:
If in Z = 3x 1 + x 2 , x 1 is allowed to become basic, x 2 remains at 0 and Z = 3x 1 ; thus for each one- unit increase in x 1 , Z increases by 3 units. On the other hand, if x 2 is allowed to become basic, Z will increase only by one unit if x 2 is
increased by one unit. This is one way to
determine the pivot column.
Métodos Cuantitativos M. En C. Eduardo Bustos Farías 23
Choosing the proper pivot element continued
Another way to determine the pivot column is to examine the bottom row of the simplex
tableau:
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
− 3 1 0 0 1 0
12 0
1 0
3 2
8 0
0 1
1 2
2 1
2 1
2 1
Z s
s
Z s
s x
x
indicators entering
variable
The bottom row entries to the left of the vertical line are called indicators.
We choose the column with the most negative indicator as the pivot column.
Having chosen the pivot column, we must now determine the pivot row in order to know which element in our
simplex tableau is the pivoting element.
For that purpose we divide the right hand side entries of the simplex tableau by
corresponding entries of the pivot column.
Of the resulting quotients we choose the smallest (minimum quotient). So the pivot element is the intersection of the pivot
column and pivot row.
The pivot element is the intersection of the pivot column and pivot row:
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
− 3 1 0 0 1 0
12 0
1 0
3 2
8 0
0 1
1 2
2 1
2 1
2 1
Z s
s
Z s
s x
x Quotients
8 ÷ 2 = 4 (smaller) 12 ÷ 2 = 6
departing variable
entering variable (most negative
indicator)
Since x 1 and s 2 will be the basic
variables in our new B.F.S, it would be convenient to change our previous
tableau by elementary row operations into a form where the values of x 1 , s 2 ,
and Z can be read off with ease just as in
the initial basic solution.
To do this we want to find a matrix
which is equivalent to the tableau above but which has the form:
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
? 1
0
?
? 0
? 0
1
?
? 0
? 0
0
?
? 1
2 1
2
1 x s s Z
x
where the question marks represent
6. Pivoting, which is done column wise.
We must transform the tableau to an equivalent matrix that has a 1 at the place of the pivot
element (pivot entry) and 0’s elsewhere in the column x 1 .
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
− 3 1 0 0 1 0
12 0
1 0
3 2
8 0
0 1
1 2
Z s s
Z s
s x
x
2 1
2 1
2 1
departing *
variable
entering variable
By elementary row operations, we have:
⎤
⎡
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
−
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
−
4 0
0 1
Z s
s x
x
0 1
0 0
1 3
12 0
1 0
3 2
4 0
0 1
0 1
0 0
1 3
12 0
1 0
3 2
8 0
0 1
1 2
Z s
s x
x
1 1
2 1
2 1
2 1 2
1
2 1
2 1
½ R 1
7. Continuing and recognizing when the algorithm terminates.
General termination rule: all values in the
indicator row are non-negative.
We have a new simplex tableau:
⎥ ⎥
⎥
⎦
⎤
⎢ ⎢
⎢
⎣
⎡
−
12 1
0 0
4 0
1 1
2 0
4 0
0 1
Z s x
Z s
s x
x
2 3 2
1
2 1 2
1
2 1
2 1
2 1
indicators
All values in the indicator row are non-
negative. Hence, we have found the optimal
solution for the problem.
Alternate Optimal solutions
For some LPs, more than one extreme point is optimal.
If an LP has more than one optimal solution, it has multiple optimal solutions.
If there is no nonbasic variable (NBV) with a zero
coefficient in row 0 of the optimal tableau, the LP has a unique optimal solution. Even if there is a nonbasic variable with a zero coefficient in row 0 of the optimal tableau, it is possible that the LP may not have
alternative optimal solutions.
Unbounded LPs
For some LPs, there exist points in the feasible region for which z assumes arbitrarily large (in max
problems) or arbitrarily small (in min problems) values. When this occurs, we say the LP is
unbounded.
An unbounded LP occurs in a max problem if there is a nonbasic variable with a negative coefficient in row 0 and there is no constraint that limits how large we can make this NBV.
Specifically, an unbounded LP for a max problem occurs
when a variable with a negative coefficient in row 0 has a
The LINDO Computer Package
LINDO (Linear Interactive and Discrete Optimizer) is a user friendly computer package that can be used to solve linear, integer, and quadratic programming problems.
The Dakota Furniture LP will solved using LINDO as an example.
LINDO permits the user to name the variables so they are defined:
DESKS = number of desk produced TABLES = number of tables produced CHAIRS = number of chairs produced
LINDO assumes all variables are nonnegative, so nonnegative constraints are not necessary. To be consistent with LINDO, the objective function row is labeled row 1 and constraints rows 2-5.
View the LINDO Help file for syntax questions
The LINDO Computer Package
To enter this problem into LINDO make sure the screen contains a blank window (work area) with the word “untitled” at the top of the work area. If necessary, a new window can be opened by selecting New from the file menu or by clicking on the File button.
The first statement in a LINDO model is always the objective function. MAX or MIN directs LINDO to solve a maximization or minimization problem.
Enter the constraints by typing SUBJECT TO (or st) on the next
line. Then enter the constraints. LINDO assumes the < symbol
means ≤ and the > symbol means ≥. There is no need to insert
the asterisk symbol between coefficients and variables to indicate
multiplication. The Dakota input is shown on the next slide
The LINDO Computer Package
The LINDO Computer Package
To save the file (LP formulation) for future use, select SAVE from the File menu and when asked, replace the * symbol with the name of your choice. The file will be saved with the name you select with the suffix .LTX. DO NOT type over the .LTX suffix. Save using any path available.
To solve the model, from the Solve menu select the SOLVE command or click the red bulls eye button.
When asked if you want to do a range (sensitivity) analysis, choose no. Range or sensitivity analysis will be discussed AFTER. when the solution is complete, a display showing the status of the Solve command will be present. View the displayed information and select CLOSE.
The data input window will now be overlaying the Reports Window.
Click anywhere in the Reports Window to bring it to the foreground.
4.6 – The LINDO Computer Package
The LINDO Computer Package
The LINDO output shows:
• LINDO found the optimum solution after 2 iterations (pivots)
• The optimal z-value = 280
• VALUE gives the value of the variable in the optimal LP solution.
Thus the optimal solution calls for production of 2 desks, 0 tables, and 8 chairs.
• SLACK OR SURPLUS gives (by constraint row) the value of slack or excess in the optimal solution.
• REDUCED COST gives the coefficient in row 0 of the optimal tableau (in a max problem). The reduced cost of each basic variables must be 0. For NBVs, the reduced cost is the amount by which the optimal z-value will be reduced if the NBV is
increased by 1 unit (and all other NBVs remain 0).
Ejemplo 1. Tecnología Agrícola, S.A.
Maximización
Tecnología Agrícola, S.A. es una compañía fabricante de fertilizantes. El
gerente desea planear la combinación de sus dos mezclas a fin de obtener
las mayores utilidades. Las mezclas son
El modelo de programación lineal para este problema es:
Maximizar Z=18.5 X 1 + 20 X 2 Sujeto a
0.05 X 1 + 0.05 X 2 <= 1100
0.05 X 1 + 0.10 X 2 <= 1800
0.10 X 1 + 0.05 X 2 <= 2000
X 1 , X 2 >= 0
Conversión a la forma estándar (inecuación a ecuación):
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 =0
Métodos Cuantitativos M. En C. Eduardo Bustos Farías 45
La tabla del simplex algebraico
Variables no básicas
Variables
básicas X1 X2 S1 S2 S3 solución Valor
S1 aij aij 1 0 0 b1
S2 aij aij 0 1 0 b2
S3 aij aij 0 0 1 b3
Zj 0 0 0 0 0 0
Cj-Zj C1 C2 0 0 0
Variables básicas
Zj= contribución que se pierde por unidad fabricada Cj-Zj= costo de oportunidad
Si= variables de holgura
Xi= variables de decisión
Elaborar la tabla simplex que permita obtener la primera solución básica
factible
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2
S3
Zj
Cj-Zj
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 >=0
Llenado de la tabla:
Renglón S1
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3
Zj
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 >=0
Llenado de la tabla:
Renglón S2
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj
Cj-Zj
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 >=0
Llenado de la tabla:
Renglón S3
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 >=0
Llenado del
Renglón Zj
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Z = 18.5X1+20X2+0S1+0S2+0S3 Sujeto a
0.05 X1 +0.05 X2+S1+0S2+0S3 =1100 0.05 X1 +0.10 X2+0S1+S2+0S3 = 1800 0.10 X1 +0.05 X2+0S1+0S2+S3 = 2000
X1, X2, S1, S2, S3 >=0
Llenado de la tabla:
Renglón
Cj-Zj
Determinar la variable que
ingresa y la que la sale.
Regla de entrada (criterio de optimalidad):
Entra aquella variable no básica con la mayor ganancia unitaria (en el caso de MAX) o el menor costo unitario (en el caso de MIN).
En nuestro ejemplo: comparo los valores
de la fila Cj-Zj, determino la columna
pivote, entra X2 por que 20 es mayor
que 18.5
PASO 1. Columna pivote Entra X2 = 20 > x1 = 18.5
Entra X2 a la base
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Métodos Cuantitativos M. En C. Eduardo Bustos Farías 55
Regla de salida (criterio de factibilidad):
Sale aquella variable cuyo resultado de dividir el valor solución entre el coeficiente de la columna pivote sea menor.
En nuestro ejemplo sale S2, ya que al
dividir es el que tiene menor valor
positivo (ceros y negativos e infintos
no cuentan)
Sale S2 de la base: Divido la
columna de valor solución entre X2 (la variable que entra a la base)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
S2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
1100/0.05=22000
1800/0.1=18000
2000/0.05=40000
Métodos Cuantitativos M. En C. Eduardo Bustos Farías 57
Se identifica el elemento pivote:
intersección entre x2 y s2 (la variable que sale y la que entra a la base)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
X2 0.05 0.1 0 1 0 1800
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Sustituyo S2 por X2
Se reestructuran los valores de la
tabla 1
Transformo el renglón X2, que contiene el elemento pivote en uno: lo multiplico por su
inverso multiplicativo (10)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
X2 10(0.05) 10(0.1) 10(0) 10(1) 10(0) 10(1800)
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Quedando la tabla como sigue:
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Los valores de las celdas de las variables básicas de la columna pivote (X2) deben valer cero y
también la Cj-Zj:
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Uso el renglón pivote
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05 0.05 1 0 0 1100
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Empezamos con el renglón S1, quiero convertir el 0.05 en cero. Busco que número multiplicado por uno y sumado con 0.05 da cero.
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.05
0.05 1 0 0 1100
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Multiplico por -0.05 el renglón pivote y lo sumo al renglón S1
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 (0.5)(-0.05) + 0.05
(1)(-0.05) + 0.05
(0)(-0.05) + 1
(10)(-0.05) + 0
(0)(-0.05) +
0
(18000)(-0.05) +
1100
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Resultado los nuevos valores del renglón S1 en la Tabla 2 del simplex
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.1 0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Ahora el renglón S3: quiero convertir en cero 0.05, busco qué número multiplicado por uno y
sumado a 0.05 da cero.
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.1
0.05 0 0 1 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Multiplico por el inverso aditivo de 0.05.
Multiplico el renglón pivote por -0.05 y lo sumo al renglón S3
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 (0.5)(-0.05) +
0.1
(1)(-0.05) + 0.05
(0)(-0.05) + 0
(10)(-0.05) + 0
(0)(-0.05) + 1
(18000)(-0.05)
+ 2000
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Resultado
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 0 0 0 0 0 0
Cj-Zj 18.5 20 0 0 0
Ahora vamos a transformar el renglón Zj.
Multiplico el renglón pivote por 20 y lo sumo a Zj.
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 0 0 0 0 0 0
Cj-Zj 18.5
20 0 0 0
Las operaciones son:
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj (0.5)(20) + 0
(1)(20) + 0
(0)(20) + 0
(10)(20) + 0
(0)(20) + 0
(18000)(20) +
0
El resultado es:
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 18.5 20 0 0 0
Ahora seguimos con Cj-Zj, quiero convertir el 20 en cero.
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 18.5 0 0 0
Multiplico el renglón pivote por -20 y lo sumo a Cj-Zj
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj (0.5)(-20) + 18.5
(1)(-20) + 20
(0)(-20) + 0
(10)(-20) + 0
(0)(-20)
+
0
Resultado
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj
Tabla 2 (Resumen)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
La solución se puede mejorar ya que aún hay valores positivos en el renglón Cj-Zj de las variables no básicas.
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Determinar la variable que
ingresa y la que la sale.
Regla de entrada (criterio de optimalidad):
Entra aquella variable no básica con la mayor ganancia unitaria (en el caso de MAX) o el menor costo unitario (en el caso de MIN).
En nuestro ejemplo: comparo los valores
de la fila Cj-Zj, determino la columna
Variable que entra a la base: X1
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Regla de salida (criterio de factibilidad):
Sale aquella variable cuyo resultado de dividir el valor solución entre el coeficiente de la columna pivote sea menor.
En nuestro ejemplo sale S1, ya que al
dividir es el que tiene menor valor
Variable que sale de la base S1:
divido la columna de valor solución entre X1
Variables
básicas X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
200/0.025=8000 18000/0.5=36000
1100/0.075=14666.6
Identifico el elemento pivote: la intersección de variable que entra (X1) y la variable que
sale de la base (S1)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 0.025 0 1 -0.5 0 200
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Convierto el elemento pivote en uno:
multiplico por su inverso multiplicativo (1/.025=40) el renglón S1
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
S1 (40)(0.025) (40)(0) (40)(1) (40)(-0.5) (40)(0) (40)(200)
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Resultando
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
X1 1 0 40 -20 0 8000
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Transformo los valores de la tabla para los renglones X2, S3, Zj y Cj-Zj
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
X1 1 0 40 -20 0 8000
X2 0.5 1 0 10 0 18000
S3 0.075 0 0 -0.5 1 1100
Zj 10 20 0 200 0 360000
Cj-Zj 8.5 0 0 -200 0
Operaciones
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
X1 1 0 40 -20 0 8000
X2 (1)(-0.5)+0.5 (0)(-0.5)+1 (40)(-0.5)+0 (-20)(-0.5)+10 (0)(-0.5)+0
(8000)(-0.5)+18000S3
(1)(-0.075)+0.075(0) (-0.075)+0 (40) (-0.075)+0
(-20) (-0.075)+(-0.5)(0) (-0.075)+1
(8000) (-0.075)+1100Zj (1)(8.5)+10 (0)(8.5)+20 (40)(8.5)+0 (-20)(8.5)+200 (0)(8.5)+0
(8000)(8.5)+360000Cj-Zj (1)(-8.5)+ 8.5 (0)(-8.5)+ 0 (40)(-8.5)+ 0 (-20)(-8.5) (0)(-8.5)+ 0
Tabla 3 (final)
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
X1 1 0 40 -20 0 8000
X2 0 1 -20 20 0 14000
S3 0 0 -3 1 1 500
Zj 18.5 20 340 30 0 428000
Cj-Zj 0 0 -340 -30 0
La solución no puede mejorar, ya que no hay valores positivos en el renglón Cj-Zj de las variables no
básicas, por lo que se ha alcanzado una solución factible óptima.
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución
X1 1 0 40 -20 0 8000
X2 0 1 -20 20 0 14000
S3 0 0 -3 1 1 500
Zj 18.5 20 340 30 0 428000
Cj-Zj 0 0 -340 -30 0
Resultados finales
Variables
básicas
X1 X2 S1 S2 S3 Valor
solución