Вы находитесь на странице: 1из 32

ME 6973 Analytical Techniques in Engineering II

Spring 2015

Introduction to Branch &


Bound

Branch-and-Bound

Example
Consider the IP:
maximize x0 = 7 x1+ 2 x2
subject to
x1 + 2x2 4
5x1 + x2 20
2x1 + 2x2 7
x1, x2 Z+
Integer and Combinatorial Optimization, Nemhauser and Wolsey, Chapter: II.4

The optimal solution of LPR is:


x0 +(3/11) x3 + (16/11) x4 = 332/11
x1 (1/11) x3 + (2/11) x4 = 36/11
x2 + (5/11) x3 + (1/11) x4 = 40/11
x5 + (8/11) x3 + (6/11) x4 = 75/11
Neither x1, x2 nor x5 satisfies integrality

Objective
function

Between
3 and 4

So we consider the two IPs, IP1 and IP2:


x0 +(3/11) x3 + (16/11) x4 = 332/11
x1 (1/11) x3 + (2/11) x4 = 36/11
x2 + (5/11) x3 + (1/11) x4 = 40/11
x5 + (8/11) x3 + (6/11) x4 = 75/11,
x1, , x5 Z, plus x2 3 for IP1; plus x2 4
for IP2

Solving the LPR of IP1, we obtain:


x0 + (7/5) x4 + (3/5) x6 = 149/5
x1 + (1/5) x4 (1/5) x6 = 17/5
x2
+
x6 = 3
x5 + (2/5) x4 + (8/5)x6 = 29/5
x3 + (1/5) x4 (11/5)x6 = 7/5.
Neither x1, x3 nor x5 satisfies integrality

The first dictionary for the LPR of IP2 is:


x0 +(3/11) x3 + (16/11) x4 = 332/11
x1 (1/11) x3 + (2/11) x4 = 36/11
x2 + (5/11) x3 + (1/11) x4 = 40/11
x5 + (8/11) x3 + (6/11) x4 = 75/11
dual simplex algorithm shows
x6 + (5/11) x3 + (1/11) x4 = 4/11,
immediately that this problem
is primal infeasible.
and therefore, IP2 is infeasible

From IP1, we consider IP3 and IP4:


x0 + (7/5) x4 + (3/5) x6 = 149/5
x1 + (1/5) x4 (1/5) x6 = 17/5
x2
+
x6 = 3
x5 + (2/5) x4 + (8/5)x6 = 29/5
x3 + (1/5) x4 (11/5)x6 = 7/5
x1, , x6 Z, plus x1 3 for IP3; plus x1 4
for IP4

Solving the LPR of IP3, we obtain:


x0 + 2 x6 + 7 x7 = 27
x1
+ x7 = 3
x2 + x6
=3
x5 + 2 x6 + 2 x7 = 5
x3 2 x6 + x 7 = 1
x4 x6
5 x7 = 2

Solving the LPR of IP4, we obtain:


x0 + 2 x4 + 3 x7 = 28
x1
x7 = 4
x2 + x4 + 5 x7 = 0
x5 + 2 x4 + 8 x7 = 1
x3 2 x4 11 x7 = 8
x6 x4 + 5 x7 = 3

Example
Graphically:
IP
x2 3
x1 3 IP1

IP3

x1 4

IP4

x2 4
IP2
Fathomed by
infeasibility

The optimal solution is x1 = 4, x2 = 0, with x0 =


28

AMPL Example

var x1 integer >= 0, <= 10;


var x2 integer >= 0, <= 10;
var x3 integer >= 0, <= 10;
var x4 integer >= 0, <= 10;
var x5 integer >= 0, <= 10;
var x6 integer >= 0, <= 10;
maximize obj: -x1 - 2* x2 -0.5 * x3 - 0.2* x4 - x5 +0.5* x6;
c1: x1 + 2 * x2 >= 1;
c2: x1 + x2 + 3* x6 >= 1;
c3: x1 + x2 + x6 >= 1;
c4: x3 - 3* x4 >= 1;
c5: x3 - 2* x4 -5* x5 >= 1;
c6: x4 + 3* x5 -4 *x6 >= 1;
c7: x2 + x5 + x6 >= 1;
solve;
display x1, x2,x3, x4, x5, x6;
end;

IP

var x1
var x2
var x3
var x4
var x5
var x6

maximize obj: -x1 - 2* x2 -0.5 * x3 - 0.2* x4 - x5 +0.5* x6;

c1: x1 + 2 * x2 >= 1; # Alternatively: x1 + x2 >= 1


c2: x1 + x2 + 3* x6 >= 1;
c3: x1 + x2 + x6 >= 1;
c4: x3 - 3* x4 >= 1;
c5: x3 - 2* x4 -5* x5 >= 1;
c6: x4 + 3* x5 -4 *x6 >= 1;
c7: x2 + x5 + x6 >= 1;

solve;

display x1, x2,x3, x4, x5, x6;


printf 'Optimal Value: %f\n', -(x1 + 2* x2 +0.5 * x3+ 0.2* x4 + x5 -0.5* x6);

end;

>= 0, <= 10;


>= 0, <= 10;
>= 0, <= 10;
>= 0, <= 10;
>= 0, <= 10;
>= 0, <= 10;

LPR

Integer solution

LP relaxation

x1.val = 0
x2.val = 1
x3.val = 4
x4.val = 1
x5.val = 0
x6.val = 0
Optimal Value: -4.200000

x1.val = 0.333333333333333
x2.val = 0.666666666666667
x3.val = 2.66666666666667
x4.val = 0
x5.val = 0.333333333333333
x6.val = 0
Optimal Value: -3.333333

ampl: model p0.ampl


MINOS 5.51: optimal solution found.
2 iterations, objective -3.333333333
x1 = 0.333333
x2 = 0.666667
x3 = 2.66667
x4 = 0
x5 = 0.333333
x6 = 0

Optimal Value: -3.333333


ampl:

p1.ampl
Infeasible!

ampl: model p2.ampl


MINOS 5.51: optimal solution found.
3 iterations, objective -3.375
x1 = 0.4
x2 = 0.55
x3 = 3
x4 = 0
x5 = 0.4
x6 = 0.05

Optimal Value: -3.375000

ampl: model p3.ampl


MINOS 5.51: optimal solution found.
2 iterations, objective -3.857142857
x1 = 1
x2 = 0
x3 = 4.57143
x4 = 0
x5 = 0.714286
x6 = 0.285714

Optimal Value: -3.857143

ampl: model p4.ampl


MINOS 5.51: optimal solution found.
1 iterations, objective -3.744444444
x1 = 0
x2 = 1
x3 = 3
x4 = 0.666667
x5 = 0.111111
x6 = 0

Optimal Value: -3.744444

ampl: model p5.ampl


presolve: constraint c5 cannot hold:
body >= 1 cannot be <= -0.35; difference =
1.35
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
Optimal Value: 0.000000
Infeasible!

ampl: model p6.ampl


MINOS 5.51: optimal solution found.
2 iterations, objective -4.066666667
x1 = 1
x2 = 0
x3 = 5
x4 = 0.333333
x5 = 0.666667
x6 = 0.333333

Optimal Value: -4.066667

ampl: model p7.ampl


presolve: constraint c5 cannot hold:
body >= 1 cannot be <= 0; difference = 1
presolve: constraint c4 cannot hold:
body >= 1 cannot be <= -5; difference = 6
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0

Optimal Value: 0.000000

ampl: model p8.ampl


MINOS 5.51: optimal solution found.
1 iterations, objective -4.75
x1 = 1
x2 = 0
x3 = 6
x4 = 0
x5 = 1
x6 = 0.5

Optimal Value: -4.750000

ampl: model p9.ampl


MINOS 5.51: optimal solution found.
1 iterations, objective -4.2
x1 = 0
x2 = 1
x3 = 4
x4 = 1
x5 = 0
x6 = 0

Optimal Value: -4.200000

ampl: model p10.ampl


MINOS 5.51: optimal solution found.
0 iterations, objective -3.833333333
x1 = 0
x2 = 1
x3 = 3
x4 = 0
x5 = 0.333333
x6 = 0

Optimal Value: -3.833333

ampl: model p12.ampl


MINOS 5.51: optimal solution found.
1 iterations, objective -5.75
x1 = 0
x2 = 1
x3 = 6
x4 = 0
x5 = 1
x6 = 0.5

Optimal Value: -5.750000

View from the dictionary


Claim: Dictionary D
is always infeasible.

Final dictionary
Branching

Note: this section are taken from


Dr. Sankaranarayanans slides.

Example (ILP)
var x1 >= 0, <= 10;
var x2 >= 0, <= 10;
var x3 >= 0, <= 10;
maximize obj: x1 + x2 -5* x3 ;
c1: -2* x1 + 7 *x2 <= 1;
c2: x1 - 2 *x2 + 5* x3 <= 3;
c3: x1 + x2 - 3 * x3 <= 7;
solve;
display x1, x2, x3;
end;

Note: Slack variables are also integers.

Final Dictionary

Dictionary After Branch

Dictionary becomes primal infeasible.

Second alternative (better one) is to use


dual dictionaries.

Diagram
Parent Node
(Final Dictionary)
Branching

Child Node:
-Add new row.
-Primal Infeasible but Dual
Feasible

Consider dual
complement dictionary.
(Feasible + but non-final)
Opt. Phase on
dual
dictionaries
Final dual dictionary
(also final primal)

B&B General Form Dictionary


Give special treatment to bounds on variables.

Modify the Simplex algorithm in two ways:


Dictionaries now have special ways to track
bounds.
Pivoting is modified.

Вам также может понравиться