Branch and Bound Ipp
Branch and Bound Ipp
Joshua Knowles
School of Computer Science
The University of Manchester
Informally,
An upper bound is a value larger than or equal to the largest value in a set.
A lower bound is a value smaller than or equal to the smallest value in a set.
I am certain that you won’t have rolled any number greater than 6 or less than 1
(even though I don’t know what you have rolled).
The set of interest may be of cardinality 1 (i.e., may have only one member).
E.g. you roll a die 5 times, and your score is the sum of your rolls. An upper bound
on the score (a set of cardinality 1) is 30. A lower bound is 5.
For you to do: What is an upper bound and a lower bound on the
annual salary of the highest-paid professional footballer?
Give reasons.
Give the least upper bound of this set S = {−1.0, 45.2, 17.5},
when P is the set of real numbers.
PARTITION: Given a set X of positive integers, divide the set into two
subsets such that the difference between the sums of their elements
is minimized.
Leaves in the tree are solutions. Internal nodes are partial solutions
The partial solutions allow reasoning about large subspaces of the search space.
It expands a node if and only if that node has the potential to yield a
better solution. This potential can be determined by calculating a
bound on the value of solutions in the subtree rooted at the node.
(1) recognising when to stop, i.e. when an optimum has been found
(2) recognising that large parts of the space cannot contain an optimum
(3) recognising that large parts of the space are not even feasible
(4) searching in promising regions of the search space before searching less
promising regions.
NB: For a particular problem, one or more of these features may not apply and/or one
may be much more important than the other.
Bounding refers to estimating a bound on the solutions in the subtree rooted at the
active node.
begin
activeset :={∅};
bestval:=NULL;
currentbest:=NULL;
while activeset is not empty do
choose a branching node, node k ∈ activeset;
remove node k from activeset;
generate the children of node k, child i, i=1,. . . ,nk ,
and corresponding optimistic bounds obi ;
for i=1 to nk do
if obi worse than bestval then kill child i;
else if child is a complete solution then
bestval:=obi , currentbest:=child i;
else add child i to activeset
end for
end while
end
Here, currentbest stores the best complete solution found so far, also known as the
incumbent.
The value of currentbest is the bestval. This value is used to see if it is worth
expanding (creating children of) nodes.
The bound b is the optimistic estimate of how good a partial solution (or node) may
be once completed; if it is not better than currentbest, there is no need to evaluate
the children of that node (so we don’t add it to activeset).
The (current) tightest lower bound is provided by the value of the best solution we
have found. This is also referred to as the incumbent.
An upper bound ob on the value (or profit) obtainable within a given set of solutions
X 0 ⊆ X can sometimes be calculated. If this upper bound is lower (less good) than
the lower bound we already have, then it is not worth enumerating these solutions.
This upper bound is the optimistic bound.
The (current) tightest upper bound is provided by the cost of the best solution we
have found. This is also referred to as the incumbent.
Solutions generated
Cost
Upper bound = best solution cost so far
of
solutions
Any complete solutions we have found serve as upper bounds on the best cost.
Solutions generated
Cost
Upper bound = best solution cost so far
of
solutions Lower bounds are generated for nodes in the
search tree (subsets of the problem) to
gauge if they are worth expanding
Lower bounds are computed using relaxations or heuristics. They must generate an
underestimate or exact estimate of the best cost that some candidate set can
possibly achieve.
Solutions generated
Cost
of Lower bounds of all unexplored sets > u.b.
Upper bound = best solution cost so far
solutions
When the lower bounds of all unexplored subsets of the problem are greater than the
upper bound (the best solution found so far) the algorithm can terminate. The best
solution found is optimal.
You must find the shortest route from S to D that also has at least 10
as the sum of node values.
You must find the shortest route from S to D that also has at least 10
as the sum of node values.
Why?
• Assume cost is calculated as some simple sum over the defined elements in xp
• A tighter bound is this cost plus some extra costs from adding minimal elements
in each position without worrying about constraints.
• Tighter bounds take more computation time to obtain, but may prune the search
tree much more effectively. There is a trade-off.
• Other heuristics.
NB: the most suitable/efficient one may depend on problem, bounding function, or
problem instance.
Now let’s see how that is used in solving knapsack with branch and
bound.
Branch and Bound 31 2.15, March 20th 2015
0/1 Knapsack — Today’s Lab
To compute bounds, we relax the constraint about taking 0 or 1 of an
item. We allow taking a fraction.
Here’s how we do that.
Now let’s see how that is used in solving knapsack with branch and
bound.
Now let’s see how that is used in solving knapsack with branch and
bound.
Since it is also an optimistic bound (by definition), this complete solution must be the
best possible feasible expansion of the current node.
This means we have ‘fathomed’ the node. Really, there is no need to continue
expanding the node’s children one at a time. We already have the best possible
feasible solution from this node’s children, and can move on.
If we can show at any point that the best descendant of a node y is at least
as good as the best descendant of node x, then we say y dominates x and
y can kill x
May allow earlier computation of a good pessimistic bound and so more of the
search tree can be pruned before it is explored.
Heuristic rules may improve performance and they may not, depending on
characteristics of the problem instances. One has to try them out.
Branch and bound is an enumeration algorithm, and hence an exact technique (i.e.,
gives guaranteed exact optima).
However, the search tree can become very large and can take a long time to search,
even when pruning is working correctly.
In this case, branch and bound could be stopped early, in which case it becomes
only a heuristic.
One way to terminate the search early, but to get at least a guaranteed level of
approximation, is to stop it iff the incumbent solution has
value ≤ (1 + α).current lower bound (for a minimization problem), where α sets the
desired level of approximation.
• It prunes infeasible and unpromising regions of the search space. Bounds are
used to prove certain regions need not be explored
• The best solution found so far — the incumbent — acts as one type of bound
• The other type of bound, the optimistic bound, provides an estimate of whether
to expand a node
• Tighter bounds take more computation but can prune more of the search tree.
pruning: removing part of the search tree because it contains no optimal solution
fathoming: when a solution’s value equals the bound of a node, the node needs no
further exploration
dominating: when a solution found by expanding one node is better than the bound
of another node, the second node is dominated
heuristic: a method for finding good but not necessarily optimal solutions