Descargar como docx, pdf o txt
Descargar como docx, pdf o txt
Está en la página 1de 7

PROGRAMACIÓN LINEAL

CASOS ESPECIALES

1. Degeneración

Se presenta cuando al aplicar la condición de factibilidad en el algoritmo simplex, existe un


empate en la relación mínima. De esta forma, al menos una de las variables básicas será cero
en la siguiente iteración y se dice que la solución está degenerada. Esta situación generalmente
es un indicativo de que el modelo tiene una restricción redundante

Ejemplo

Maximizar u=3 x 1 +9 x 2
Sujeta a las restricciones

x 1+ 4 x 2 ≤ 8 (1)

x 1+ 2 x 2 ≤ 4 (2)

x 1 , x 2 ≥ 0 (Condición de no negatividad)
Solución gráfica

Solución con R
> coef<-c(3,9)
> A<-matrix(c(1,1,4,2),ncol=2)
> b<-c(8,4)
> dir<-rep("<=",2)
> solucion <- solveLP(coef, b, A, maximum=TRUE, dir)
> summary(solucion)

Results of Linear Programming / Linear Optimization

Objective function (Maximum): 18

Solution
opt
1 0
2 2
> solucion <- solveLP(coef, b, A, maximum=TRUE, dir,verbose=4)
[1] "initial Tableau"
1 2 S 1 S 2 P0
1 1 4 1 0 8
2 1 2 0 1 4
Z-C -3 -9 0 0 0

BÁSICA U x1 x2 S1 S2 SOLUCIÓN
U 1 -3 -9 0 0 0
S1 0 1 4 1 0 8
S2 0 1 2 0 1 4

BÁSICA x2 SOLUCIÓN COCIENTE


S1 4 8 8/4 =2
S2 2 4 4/2= 2

Pivot Column: 2 ( 2 )
Pivot Row: 1 ( 1 )

1 2 S 1 S 2 P0
2 0.25 1 0.25 0 2
2 0.50 0 -0.50 1 0
Z-C -0.75 0 2.25 0 18

Pivot Column: 1 ( 1 )
Pivot Row: 2 ( 2 )

1 2 S 1 S 2 P0
2 0 1 0.5 -0.5 2
1 1 0 -1.0 2.0 0
Z-C 0 0 1.5 1.5 18

En la primera tabla del algoritmo Simplex, observamos que en la primera iteración debe
ingresar la variable x 2 porque tiene el coeficiente más negativo. Sin embargo, al calcular la
relación mínima se presenta un empate. En la siguiente iteración una de las variables básicas
es cero. De esta forma, se obtiene una solución degenerada.

2. Óptimos alternativos

Esta situación se presenta cuando la función objetivo es paralela a una de las restricciones

Ejemplo

Maximizar u=2 x 1 +4 x 2
Sujeta a las restricciones

x 1+ 2 x 2 ≤ 5 (1)

x 1+ x2 ≤ 4 (2)

x 1 , x 2 ≥ 0 (Condición de no negatividad)
Solución gráfica

Solución con R

> coef<-c(2,4)
> A<-matrix(c(1,1,2,1),ncol=2)
> b<-c(5,4)
> dir<-rep("<=",2)
> solucion <- solveLP(coef, b, A, maximum=TRUE, dir)
> summary(solucion)

Results of Linear Programming / Linear Optimization

Objective function (Maximum): 10

Solution
opt
1 0.0
2 2.5

> solucion <- solveLP(coef, b, A, maximum=TRUE, dir,verbose=4)


[1] "initial Tableau"
1 2 S 1 S 2 P0
1 1 2 1 0 5
2 1 1 0 1 4
Z-C -2 -4 0 0 0

Pivot Column: 2 ( 2 )
Pivot Row: 1 ( 1 )

1 2 S 1 S 2 P0
2 0.5 1 0.5 0 2.5
2 0.5 0 -0.5 1 1.5
Z-C 0.0 0 2.0 0 10.0

La existencia del óptimo alternativo se descubre en la tabla óptima por el coeficiente cero de la
variable no básica x 1
¿Cómo encontrar otras soluciones óptimas alternativas?

Se modifica el valor de las variables de decisión en la función objetivo sin modificar el valor
óptimo encontrado

Maximizar u=2 x 1 +4 x 2

2 x1 + 4 x 2=10(÷ 2)

x 1+ 2 x 2=5

Se puede elegir una variable libre porque existen dos variables y una sola ecuación (recordar
del Álgebra Lineal)
5−x 1
x 2=
2

Se asume x 1=t como variable libre

t x1 x2
0 0 2.5
1 1 2
2 2 1.5
3 3 1
4 4 0.5
5 5 0
6 6 -0.5???

Los valores se asumen de acuerdo al contexto del problema

3. Solución no acotada

Se presenta cuando la región factible no está limitada y por lo tanto, la función objetivo puede
tomar valores sin límite. Una solución no acotada es un indicativo de que el modelo ha sido mal
formulado y se han dejado de tener en cuenta restricciones de importancia.

Ejemplo

Maximizar u=2 x 1 + x 2 (en miles)


Sujeta a las restricciones

x 1−x 2 ≤ 10 (1)

2 x1 ≤ 40 (2)

x 1 , x 2 ≥ 0 (Condición de no negatividad)
Solución gráfica
Solución con R

> coef<-c(2,1)
> A<-matrix(c(1,2,-1,0),ncol=2)
> b<-c(10,40)
> dir<-rep("<=",2)
> solucion <- solveLP(coef, b, A, maximum=TRUE, dir)
Error in while (min(Tab[nCon + 1, 1:(nVar + nCon)]) < -zero & iter2 < :
valor ausente donde TRUE/FALSE es necesario
Además: Warning message:
In min(decval, na.rm = TRUE) :
ningún argumento finito para min; retornando Inf

> solucion <- solveLP(coef, b, A, maximum=TRUE, dir,verbose=4)


[1] "initial Tableau"
1 2 S 1 S 2 P0
1 1 -1 1 0 10
2 2 0 0 1 40
Z-C -2 -1 0 0 0

Pivot Column: 1 ( 1 )
Pivot Row: 1 ( 1 )

1 2 S 1 S 2 P0
1 1 -1 1 0 10
2 0 2 -2 1 20
Z-C 0 -3 2 0 20

Pivot Column: 2 ( 2 )
Pivot Row: 2 ( 2 )

1 2 S 1 S 2 P0
1 1 0 0 0.5 20
2 0 1 -1 0.5 10
Z-C 0 0 -1 1.5 50

Pivot Column: 3 ( S 1 )
Pivot Row: 1 ( 1 )

1 2 S 1 S 2 P0
S 1 Inf NaN NaN Inf Inf
2 Inf NaN NaN Inf Inf
Z-C Inf NaN NaN Inf Inf
Error in while (min(Tab[nCon + 1, 1:(nVar + nCon)]) < -zero & iter2 < :
valor ausente donde TRUE/FALSE es necesario
Además: Warning message:
In min(decval, na.rm = TRUE) :
ningún argumento finito para min; retornando Inf

En el caso de existir una región no acotada, el programa R envía un mensaje de error

4. Solución no factible

Se presenta cuando el modelo matemático ha sido formulado de manera incorrecta y por lo


tanto es imposible encontrar una solución óptima del problema.

Ejemplo

Maximizar u=3 x 1 +2 x2 (en miles)


Sujeta a las restricciones

2 x1 + x 2 ≤ 2 (1)

3 x 1+ 4 x 2 ≥ 12 (2)

x 1 , x 2 ≥ 0 (Condición de no negatividad)
Solución gráfica

Solución con R

> coef<-c(3,2)
> A<-matrix(c(2,3,1,4),ncol=2)
> b<-c(2,12)
> dir<-c("<=",">=")
> solucion <- solveLP(coef, b, A, maximum=TRUE, dir)
> summary(solucion)

Results of Linear Programming / Linear Optimization

Objective function (Maximum): 4


Solution
opt
1 0
2 2

> solucion <- solveLP(coef, b, A, maximum=TRUE, dir,verbose=4)


[1] "initial Tableau"
1 2 S 1 S 2 P0
1 2 1 1 0 2
2 -3 -4 0 1 -12
Z-C -3 -2 0 0 0
[1] "initial Tableau for Phase 1"
1 2 S 1 S 2 M 2 P0
1 2 1 1 0 0 2
M 2 3 4 0 -1 1 12
Z-C -3 -2 0 0 0 0
M Z-C -3 -4 0 1 0 -12

Pivot Column: 2 ( 2 )
Pivot Row: 1 ( 1 )

1 2 S 1 S 2 M 2 P0
2 2 1 1 0 0 2
M 2 -5 0 -4 -1 1 4
Z-C 1 0 2 0 0 4
M Z-C 5 0 4 1 0 -4
[1] "New starting Tableau for Phase II"
1 2 S 1 S 2
2 2 1 1 0 2
M 2 -5 0 -4 -1 4
Z-C 1 0 2 0 4

Aunque R entrega una solución óptima, en el desarrollo del algoritmo crea una variable
artificial (M2). Si en la tabla óptima aparece la variable artificial con signo positivo, es un
indicativo de que no existe solución factible. La solución encontrada se conoce como pseudo
óptima

También podría gustarte