Lecture 11: Tree Search © J. Christopher Beck 2008 1

advertisement
Lecture 11: Tree Search
© J. Christopher Beck 2008
1
Outline




Generate-and-test
Partition
Relaxation
Inference
© J. Christopher Beck 2008
2
Readings


P Ch B.3, B.4
J. Hooker, Integrated
Methods for
Optimization, 2007
© J. Christopher Beck 2008
3
Beyond Heuristics



What if you want a
guarantee of finding the
optimal solution?
Or, for a satisfaction problem, that no
solution exists?
Imagine a problem with 3 variables


a, b, c є {0, 1}
Simplest thing you can think of?
© J. Christopher Beck 2008
4
Idea #1: Partitioning
Easy
problem
© J. Christopher Beck 2008
Total Search Space
5
Idea #1: Partitioning

Add constraint to the original problem
to form a partition: P1, P2, P3, …



Partitions are easier to solve
Partitions, sub-partitions, sub-subpartitions
Solution is the best one from all the
partitions
© J. Christopher Beck 2008
6
Idea #1: Partitioning

Imagine a problem with 3 variables


a, b, c є {0, 1}
minimize
Branch
a=0
b=0
c=0
100
c=1
90
© J. Christopher Beck 2008
a=1
b=1
c=0
110
b=0
c=1
115
c=0
80
c=1
90
b=1
c=0
100
c=1
110
7
So …

By now, if you are thinking
about partitioning, you
should have a question:

(Hint: how many “states” in our generateand-test example? how many in the tree
search?)
© J. Christopher Beck 2008
8
Idea #2:
Relaxation


Solve a problem
that is easier
than the real problem
Relaxation: expand the search space to
allow non-solutions to count as
solutions

Solution to relaxation is a bound on the
real problem

no real solution can be better
© J. Christopher Beck 2008
9
Idea #2: Relaxation

Imagine I have a way to calculate a
lower bound on the cost at each node
a=0
b=0
c=0
100
85
70
c=1
90
© J. Christopher Beck 2008
a=1
50
b=1
95
b=0
c=0
80
80
80
Bound
10
Branch-and-Bound


Partition + Relaxation
Use heuristics to pick a decision to try
(“branch”)


partition
Use lower bounds on solutions to
“bound” the search

solve a relaxation
© J. Christopher Beck 2008
11
Partitioning + Relaxation
Easy
problem
© J. Christopher Beck 2008
Total Search Space
12
MIP Solving (preview)

Relaxation



solve LP, ignoring integrality
gives lower bound (for a minimization
problem)
Partition


add linear constraints to force a nonintegral integer variable up or down
use relaxation in branching!
© J. Christopher Beck 2008
13
Idea #3: Inference

Imagine a problem with 3 variables


a, b, c є {0, 1}
minimize
One of the constraints: b < a
a=0
b=0
c=0
100
c=1
90
© J. Christopher Beck 2008
a=1
b=1
c=0
110
b=0
c=1
115
c=0
80
c=1
90
b=1
c=0
100
c=1
110
14
Idea #3: Inference

Imagine a problem with 3 variables


a, b, c є {0, 1}
minimize
One of the constraints: b < a
a=0
b=0
c=0
100
c=1
a=1
b=1
You can infer:
ac==0,0 b = c1= 1
90
© J. Christopher Beck 2008
110
115
b=0
c=0
80
c=1
90
b=1
c=0
100
c=1
110
15
Idea #3: Inference

Based on the constraints in the current
partition, derive new constraints that
are implied


implied = must be true!
Add new constraints to:


tighten relaxation
reduce partitioning
© J. Christopher Beck 2008
16
Constraint Propagation
(preview)



3 variables: v1, v2, v3
D1=D2= {1,3}, D3 = {1,2,3}
all-different(v1,v2,v3)


each variable must be a different value
What can you infer?
© J. Christopher Beck 2008
17
Partition + Relaxation +
Inference

Until the partition is easy to solve or has
no solution:




infer and add new constraints
calculate relaxation
form sub-partitions
(Tree) Search =
Partition + Relaxation + Inference
© J. Christopher Beck 2008
18
A Very Simple
Scheduling Problem
Jobs


0
Processing times
J0R0[15]  J0R1[5]
1
J1R0[10]  J1R1[15]
Draw complete branch-and-bound tree
to minimize makespan
Assume that the branches sequence a
pair of operations

Try J0Rx → J1Rx first
© J. Christopher Beck 2008
19
Jobs
Getting Started

Processing times
0
J0R0[15]  J0R1[5]
1
J1R0[10]  J1R1[15]
Take “left” branch first
J0R0  J1R0
??
© J. Christopher Beck 2008
…
J1R0  J0R0
…
20
Jobs
Bounding?


Processing times
0
J0R0[15]  J0R1[5]
1
J1R0[10]  J1R1[15]
Calculate a very simple lower bound at
each node
Which nodes will not be visited?
© J. Christopher Beck 2008
21
Download