Download Data Structures for Integer Branch and Bound Search Tree

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Linked list wikipedia , lookup

Quadtree wikipedia , lookup

Red–black tree wikipedia , lookup

Lattice model (finance) wikipedia , lookup

B-tree wikipedia , lookup

Interval tree wikipedia , lookup

Binary tree wikipedia , lookup

Binary search tree wikipedia , lookup

Transcript
Data Structures for Integer Branch and Bound Search Tree
(Depth-First Search)
Separation: Assume that in an LP solution to a mixed integer program x1 = 4.6. The separation
or partitioning step leading to the development of a search tree requires adding two disjunction
constraints to the problem; i.e., either
x1  4 or x1  5
To keep track of these constraints, the order in which they are added, the direction of their
inequalities, whether or not both have been explored, as well as the corresponding information
for subsequent constraints, an efficient data structure is required. This is discussed below.
P Path vector indicating the depth of the search tree (number of additional bound constraints
imposed). Each element in P corresponds to the variable being restricted. A negative sign
indicates that the other side of the inequality has not been explored.
S
Sign vector associated with P. Each element in S is either –1 or +1, the former indicating a 
inequality, the latter a  inequality.
V Value vector associated with P. Each element in V gives the right-hand-side value of the
variable bound in the inequality.
(Note that it is possible to combine S and V into a single vector.)
Example: Assume that after three iterations in the solution to a MIP the following bounds have
been imposed: x2  3, x3  4, x1  6. This gives rise to the search tree shown in Fig. 1. The
corresponding data structures are
P = (–2, –3, –1), S = (–1, –1, +1), V = (3, 4, 6)
0
x2  3
1
x3  4
2
x1 6
3
Figured 1. General branch and bound tree
-1-
Additional restrictions are added by extending the three vectors accordingly. For example, if the
next restriction was x2  2, we would have
P = (–2, –3, –1, –2), S = (–1, –1, +1, +1), V = (3, 4, 6, 2)
(Note that the same variable can appear in P more than once.)
Backtracking: When a node is fathomed it is necessary to backtrack. This means creating a new
problem by generating the complement of the inequality of the most recent node whose
complement has not yet been explored. This is accomplished by scanning the P vector to find the
rightmost element whose sign is negative. The sign is then made positive and all elements to its
right are removed. The corresponding elements in S and V are also removed. Next, the sign of
the element in S associated with the rightmost negative element in P is changed and the same
element in V updated. If the element in S went from –1 to +1 (indicating that the new inequality
is ), the corresponding element in V is increased by 1; if the element in S went from +1 to –1
(indicating that the new inequality is ), the corresponding element in V is decreased by 1. When
the P vector is empty the search is complete and the algorithm stops with the optimal solution.
Example (continued): Assume that in the example shown in Fig. 1, node 4 is fathomed. Figure 2
shows the extended tree that results from backtracking. This gives rise to the following vectors:
P = (–2, –3, +1), S = (–1, –1, –1), V = (3, 4, 5)
x2  3
1
2
x3  4
x1  5
5
3
x3  5
x1  6
4
6
Figure 2. Extension of tree with backtracking
If node 5 is also fathomed, backtracking would give
-2-
P = (–2, +3), S = (–1, +1), V = (3, 5)
This process continues until all combinations of restrictions have been (implicitly) explored.
Best-Node-First Strategy
In an attempt to minimize the total number of nodes that need to be evaluated in the tree,
the optimal strategy is to always choose the active node with the best bound (largest upper bound
for maximization problem); i.e., choose node s where z s  maxt z t and t is the index for the
active nodes. By using this rule, a node whose upper bound z t is less than the optimal value of
the problem, zIP, will never be divided.
One way to implement this strategy is to create two subproblems at each branching step,
as in depth-first search, but do not solve the corresponding LP relaxations immediately. Instead,
add the two subproblems to the list and assign them the same upper bound as their parent. The
node with the best (largest) bound is then selected and the LP solved.
In this scheme, two data structure are needed for bookkeeping purposes. The first uses a regular
binary tree (a tree where each node has no more than 2 children). This is basically the B&B tree.
The second uses what is called an AVL tree (Adelson-Velskii and Landis 1962), which keeps
track of which node is the one with the best bound. The reason for using an AVL tree is because
insertion and deletion can be done in order O(nlogn) time, and accessing the best or worst bound
can be done in O(1). An AVL tree is balanced which means that the length of any two sub-trees
(children) of a node will differs by at most one.
Every subproblem will reside in both of these data structures. We can look at the binary
tree to see the parent-child relation and look at the AVL tree when we need to select an active
node for evaluation (solving the LP).
Associated with each node in the B&B tree is a set of pointers. One points to the parent
and two others point to each of the children (left and right). In this scheme, there is no need for
backtracking because the best bound is always selected for evaluation.
-3-
Branching on Special Ordered Set (SOS) Constraints
[also called Generalized Upper Bound (GUB) Constraints]
In many sequencing problems such as the VRP constraints of the form
x
ij
 1 , i = 1,...,n
jQi
appear, where Qi is a subset of I0 = {0,1,...,n} and xij is binary. In an LP relaxed solution
suppose we have 0 < xik < 1 for some k  Qi. Conventional branching on xik is equivalent to
xik = 0
or

xij  0
jQi \{k}
since the latter inequality is equivalent to xik = 1. The difficulty arises on the branch xik = 0. The
corresponding problem has almost the same feasible region as its parent so not much if any
progress is likely to be made.
It would seem to be more desirable to try to divide the feasible region of a parent roughly
equally between its two children. To accomplish this, consider the branching rule
x
ij
jQi1
 0 or

xij  0
(1)
jQi \Qi1
1
1
The conventional rule is the special case where Q = {k}. We can use (1) for any Q such that k
i
i
1
 Q and jQ 1i xij < 1. Note that the latter inequality is necessary to rule out the case where
i
1
for k, l  Q , xik =0.3 and xil = 0.7 so xik + xil = 1.
i
1
In partitioning the set Qi, it seems reasonable to take Qi and Qi \ Q to be of equal
i
cardinality. A simple implementation of the branching rule (1) is obtained by indexing the
1
1
variables as xij1, xij2,...,xijt. The choice of Q is specified by an index r, 1  r  t – 1, and Q =
i
i
-4-
{j1,...,jr}. Data structures similar to those used for the integer branching case can be used here.
The elements of the path vector P would now be ±i indicating which of the m SOS constraints
1
was being restricted and whether or not Q or its complement had been explored. The sign
i
vector S would indicate whether the first of second constraint in (1) was being enforced. The
1
value vector V would indicate the range of indices included in Q or its complement. Thus each
i
element would be a subvector. (There is probably a more efficient way to do this with pointers.)
Note if the situation arose where jQ 1i xij = 1 it would be necessary to alter the current
partition.
Branching on Time Windows
In many vehicle routing machine scheduling problems an interval is imposed on the time a
customer may be serviced or a job may be processed. This is called a time window constraint.
The following notation is used to describe this type of constraint for the VRP.
i
ai
bi
ti
index for customers; i = 1,...,n
earliest time service can begin at customer i
latest time service can begin a customer i
decision variable indicating the time service is completed at customer i
The requirement is ti  [ai, bi] for i = 1,...,n. An inequality typically appearing in the MIP
representation of the problem has the form

  
tj = ti +  ij   i xij Lij 1xij , i  j = 1,...,n
where
xij binary decision variable equal to 1 if customer i is the immediate predecessor of j; 0
ij
i
Lij
otherwise
time to travel from customer i to customer j
time to service customer i
= bi – aj
-5-
When all the x variables are integer, this constraint will eliminate subtours. That is, if xij
= 1, then tj > ti. In fractional solutions arising from solving the LP relaxation of the MIP,
subtours may appear. For xij fractional, it may turn out that tj < ti. By compressing the time
windows, this situation becomes less and less possible. In addition, smaller time windows imply
fewer customer transitions are feasible. In the extreme were ai = bi for all i, no possibility of
subtours would even exist in the underlying (directed) graph. This simplifies the problem
considerably and motivates a branching scheme that centers on the time windows.
Such a scheme can be implemented by systematically restricting ti to be within a subset of
its time window. Using a bisection rule, at the first iteration we get the following disjunctive
constraints:
  a  bi  
ti   ai ,  i
  or ti 
  2  
  ai  bi  

 ,bi 
  2  
Note that it is probably not necessary to use the floor and ceiling values of the associated
endpoints. The same data structures for B&B with integer variables could be used to construct
the search tree. The only change would involve the vector V whose elements would now
correspond to intervals (or alternatively, a representation of then) rather than right-hand-side
values.
-6-