Complemento Branch and Bound

También podría gustarte

Está en la página 1de 29

Branch andBound - 22

ESCUELA TCNICA SUPERIOR DE INGENIERA


DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
El mtodo Ramifica y acota (Branch and Bound) (V)
La herramienta es muy flexible y permite una gran capacidad de
maniobra. Pero esto mismo hace que slo la prctica sea la que permita un uso
eficaz de la misma.
As pues, la estructura general de esta tcnica consiste en:
Un criterio para dividir los subconjuntos candidatos a
contener la solucin ptima encontrados en cada fase.
El clculo de una cota (inferior o superior) para los valores
de la funcin en cada subconjunto candidato.
Un criterio para seleccionar un subconjunto para una
particin posterior.
Branch andBound - 23
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Aplicacin del mtodo Ramifica y acota a un
problema de programacin lineal entera
5 25
9 6 49
1
0
2
5
0
x y
x y
x y
x y ente
Max Z x y
ros
sujeto a
+
+

= +
.
,
,
:
.
Branch andBound - 24
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
(2.5, 4.5)
y
x
P0
Los puntos rojos
configuran el espacio de
soluciones enteras.
Branch andBound - 25
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
De este problema tenemos una cota inferior inicial
inmediata, Z = 0 , con x = y = 0.
En la etapa k tendremos disponibles una cota inferior
z* y una lista de programas linales que difieren entre s en
las cotas entre las que se encuentran las variables de
decisin de cada uno de ellos.
En la etapa inicial la lista de programas contiene tan
slo el programa propuesto, relajando (es decir,
prescindiendo de ) la condicin de que las variables sean
enteras. En cada iteracin, la tcnica se desarrollar segn
el procedimiento que se describe en la siguiente diapositiva.
Branch andBound - 26
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
PROCEDIMIENTO
1: Si la lista de programas est vaca el proceso ha finalizado. En caso
contrario seleccionar y estudiar uno de los programas contenidos en ella.
2: Resolver el programa seleccionado. Si no tiene solucin o si el valor
ptimo de la funcin objetivo no es mayor que z* , z* es la cota inferior de la
etapa siguiente y volvemos al paso 1. En otro caso, pasamos al paso 3.
3: Si la solucin obtenida satisface el carcter entero de las variables,
se retienen dichos valores, el valor de la funcin objetivo es la nueva cota
inferior y volvemos al paso 1. Si no es este el caso, se ejecuta paso 4.
4: Seleccionar una de las variables que, debiendo ser entera, no lo sea
en la solucin encontrada en el paso 3. Supongamos que dicha variable es x
y que su valor no entero es a. Entonces aadimos dos nuevos programas a la
lista que son idnticos al programa que nos proporcion esa solucin, excepto
que en uno de ellos hay una nueva restriccin que establece que la cota
inferior de x es E(a) + 1 y en el otro la nueva restriccin establece que la cota
superior de x es E(a). La cota inferior de Z se mantiene como referencia para
estos dos nuevos programas.
Branch andBound - 27
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1) Resolvemos el problema P0 relajando la condicin que
exige que x e y sean enteros
12
5 25
9 6 495
0 0
Max Z x y
x y
x y
x y
sujeto a
= +
+
+

.
,
:
.
P0:
Aplicacin del mtodo siguiendo el procedimiento descrito
Branch andBound - 28
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
(2.5, 4.5)
y
x
Con fondo amarillo
el conjunto de
restricciones
relajado, eliminando
la condicin de que
x e y sean enteros.
79
25 45
Solucin ptima
Z
x y
=
= =
*
.
. , .
Branch andBound - 29
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P2
P0
12
5 25
9 6 495
0 0
79
25 45
Max Z x y
x y
x y
Solucin ptim
suj
x
Z
x
y
e
a
t
y
o a
= +
+
+

=
=

=
*
.
.
,
.
,
:
. .
P1
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
4 y
5 y
2) Se ramifica el problema P0 en dos direcciones segn
que o , ya que no puede haber ninguna solucin
entera con .
4 5 y < <
4 y 5 y
Branch andBound - 30
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
y
1 2 3 4 5 6
2
1
4
3
(2.5, 4.5)
x
(0, 5)
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P1
Branch andBound - 31
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
6
0 5
Solucin ptima
Z
x y
=
= =
*
:
,
P0
P2
P1
12
5 25
9 6 495
0 0
79
25 45
Max Z x y
x y
x y
Solucin ptim
suj
x
Z
x
y
e
a
t
y
o a
= +
+
+

=
=

=
*
.
.
,
.
,
:
. .
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
1 Cota
entera
4 y 5 y
Branch andBound - 32
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
y
P2
x
(2.833, 4)
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
1 2 3 4 5 6
2
1
5
4
3
Branch andBound - 33
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
7633
2833 4
Solucin ptima
Z
x y
=
= =
*
.
. ,
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
6
0 5
Solucin ptima
Z
x y
=
= =
*
,
P0
P2
P1
12
5 25
9 6 495
0 0
79
25 45
Max Z x y
x y
x y
Solucin ptim
suj
x
Z
x
y
e
a
t
y
o a
= +
+
+

=
=

=
*
.
.
,
.
,
:
. .
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
1 Cota
entera
Solucin no entera, pero
superior a la cota entera
encontrada. Hay que
seguir ramificando.
4 y 5 y
Branch andBound - 34
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Branch andBound - 35
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Branch andBound - 36
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
6
0 5
Solucin ptima
Z
x y
=
= =
*
,
P0
P2
P1
12
5 25
9 6 495
0 0
79
25 45
Max Z x y
x y
x y
Solucin ptim
suj
x
Z
x
y
e
a
t
y
o a
= +
+
+

=
=

=
*
.
.
,
.
,
:
. .
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
1 Cota
entera
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
2 Cota entera. Mejora la
1. Nueva referencia
4 y 5 y
Branch andBound - 37
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
y
1 2 3 4 5 6
2
1
5
4
3
x
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
Branch andBound - 38
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
6
0 5
Solucin ptima
Z
x y
=
= =
*
,
P0
P2
P1
12
5 25
9 6 495
0 0
79
25 45
Max Z x y
x y
x y
Solucin ptim
suj
x
Z
x
y
e
a
t
y
o a
= +
+
+

=
=

=
*
.
.
,
.
,
:
. .
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
1 Cota
entera
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
75
3 375
Solucin ptima
Z
x y
*
.
, .
=
= =
Solucin no entera mejor que la 2
cota entera obtenida. Hay que
seguir ramificando
4 y
5 y
Branch andBound - 39
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
P2
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
P6
Branch andBound - 40
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
y
x
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
P5
No hay ningn
punto de
ordenada 4 en
este dominio
Branch andBound - 41
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
P2
P3
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
Infactible
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
P6
Branch andBound - 42
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
y
x
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P6
(3.5, 3)
Branch andBound - 43
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
P2
Infactible
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
P6
71
35 3
Solucin ptima
Z
x y
*
.
. ,
=
= =
Solucin no entera mejor que la 2
cota entera obtenida. Hay que
seguir ramificando
Branch andBound - 44
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Infactible
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P2
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
P6
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
3 3 3
Max Z x y
x y
x y
x y x
= +
+
+

.
.
, ,
12
5 25
9 6 495
4 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
4 x 3 x
P8
P7
Branch andBound - 45
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
y
x
(3, 3)
12
5 25
9 6 495
3 3 3
Max Z x y
x y
x y
x y x
= +
+
+

.
.
, ,
P7
Branch andBound - 46
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Infactible
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P2
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
P6
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
3 3 3
Max Z x y
x y
x y
x y x
= +
+
+

.
.
, ,
12
5 25
9 6 495
4 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
4 x 3 x
P8
P7
66
3 3
Solucin ptima
Z
x y
*
.
,
=
= =
Solucin
entera peor
que P3
Branch andBound - 47
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
1 2 3 4 5 6
2
1
5
4
3
y
x
12
5 25
9 6 495
4 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P8
(4, 2.25)
Branch andBound - 48
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Infactible
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P2
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
4 y 3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P5
P6
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
3 3 3
Max Z x y
x y
x y
x y x
= +
+
+

.
.
, ,
12
5 25
9 6 495
4 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
4 x 3 x
P8
P7
Solucin
entera peor
que P3
67
4 225
Solucin ptima
Z
x y
*
.
, .
=
= =
No entera y peor que P3: Se poda la rama
Branch andBound - 49
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Finalizado el proceso de ramificacin y poda, la
solucin ptima entera corresponde al subprograma P3:
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
68
2 4
La solucin ptima
Z
x
s
y
e
*
.
,
=
= =
Branch andBound - 50
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
6
0 5
Z
x y
=
= =
*
,
P0
12
5 25
9 6 495
0 0
Max Z x y
x y
x y
x y
sujeto a
= +
+
+

.
,
:
.
P1
12
5 25
9 6 495
0 5
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
0 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P2
1 Cota entera
3 x
2 x
12
5 25
9 6 495
2 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P3
12
5 25
9 6 495
3 4
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
P4
68
2 4
Solucin ptima
Z
x y
*
.
,
=
= =
2 Cota entera.
Mejora la 1. Nueva
referencia
4 y
3 y
12
5 25
9 6 495
3 4 4
Max Z x y
x y
x y
x y y
= +
+
+

.
.
, ,
P6
12
5 25
9 6 495
3 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
12
5 25
9 6 495
3 3 3
Max Z x y
x y
x y
x y x
= +
+
+

.
.
, ,
12
5 25
9 6 495
4 3
Max Z x y
x y
x y
x y
= +
+
+

.
.
,
4 x 3 x
P8
P7
P5
4 y 5 y
Infactible
79
25 45
Z
x y
=
= =
*
.
. , .
7633
2833 4
Z
x y
=
= =
*
.
. ,
75
3 375
Z
x y
*
.
, .
=
= =
71
35 3
Z
x y
*
.
. ,
=
= =
66
3 3
Z
x y
*
.
,
=
= =
67
4 225
Z
x y
*
.
, .
=
= =
Resumen

También podría gustarte