0% found this document useful (0 votes)
37 views6 pages

5.5 Branch and Bound - Lifo and Fifo Search

Uploaded by

susmitha092004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views6 pages

5.5 Branch and Bound - Lifo and Fifo Search

Uploaded by

susmitha092004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BRANCH AND BOUND

● The Branch-and-Bound algorithmic technique is applicable to optimization problems.


● It is an enhancement of backtracking technique.
● An optimization problem seeks to minimize or maximize some objective function.
● A feasible solution is a point in the problem’s search space that satisfies all the problem’s
constraints.
● An optimal solution is a feasible solution with the best value of the objective function.
● Main distinction between backtracking and branch-and-bound technique are:
❖ The branch-and-bound algorithm does not limit us to any particular way of
traversing the tree and is used only for optimization problems.
❖ The backtracking algorithm requires the use of DFS traversal and is used for
non-optimization problems.
● Two mechanisms has to be focused in branch-and-bound :
❖ A mechanism to generate branches when searching the solution space.
❖ A mechanism to generate a bound so that many branches can be terminated
● As the branch-and-bound algorithm progresses, a tree of subproblems is formed.The
original problem is considered the root problem.
● A method or constraint is used to construct an upper and lower bound for a given
problem.
● A bound on a node is a guarantee that any solution obtained from expanding the node
will be:
❖ Greater than some number (lower bound)
❖ Or less than some number (upper bound)
● At each node, apply the bounding methods:
❖ If the bounds match, it is deemed a feasible solution to that particular sub problem.
❖ If bounds do not match, partition the problem represented by that node, and makes
the two subproblems into children nodes.
❖ Continue, using the best known feasible solution to trim sections of the tree, until
all nodes have been solved or trimmed.
● Branch-and-bound technique demands two things:
❖ for every node of a state-space tree a bound on the best value of the objective
function must be provided on any solution that can be obtained by adding further
components to the partially constructed solution represented by the node.
❖ the value of the best solution seen so far.
● In branch-and-bound, a bounding function is used to compute a bound at a node on a
state-space tree and determine if it is promising or not.
● A node is declared as promising if the bound is better than the value of the best solution
so far and further expansion is possible.
● A node is declared as non -promising if the bound is no better than the value of the best
solution so far. So no expansions are possible beyond this point. This is called pruning
the state-space tree.
● A search path at the current node in a state-space tree is terminated for any one of the
following three reasons:
❖ The value of the node’s bound is not better than the value of the best solution seen
so far.
❖ The node represents no feasible solutions because the constraints of the problem
are already violated.
❖ The subset of feasible solutions represented by the node consists of a single point
and hence no further choices can be made. In this case we compare the value of the
objective function for this feasible solution with that of the best solution seen so far
and update the latter with the former if the new solution is better.
● Branch-and-Bound is efficient in the average case because many branches can be
terminated very early.
● Although it is very efficient, a very large tree may be generated in the worst case.
● Many NP-hard problems can be solved by this strategy in the average case; however, the
worst case time complexity is still exponential.

LIFO & FIFO SEARCH

● Branch and Bound refers to all state space search methods in which all children of the
ENode are generated before any other live node becomes the E-Node.
● Branch and Bound is the generalization of both graph search strategies, BFS and
D-search.
❖ A BFS like state space search is called FIFO (First in first out) search as the list of
live nodes in a first in first out.
❖ A D-search like state space search is called as LIFO (last in first out) search as the
list of live nodes in a last in first out list.
● Live node is a node that has been generated but whose children have not yet been
generated.
● E-node is a live node whose children are currently being explored. In other words, an
E-node is a node currently being expanded.
● Dead node is a generated anode that can not be expanded or explored any further.
● All children of a dead node have already been expanded. Here we will use 3 types of
search strategies:
1. FIFO (First In First Out)
2. LIFO (Last In First Out)
3. LC (Least Cost) Search

FIFO Branch and Bound Search:

● A data structure called Queue is used. Initially Queue is empty.

Example:

● Assume the node 12 is an answer node (solution).


● In FIFO search, first we will take E-node as a node 1.
● Next we generate the children of node 1. Place all these live nodes in a queue.

2 3 4

● Now delete an element from queue, i.e. node 2, next generate children of node 2 and place them in
queue.

3 4 5 6
● Next, delete an element from the queue and take it as an E-node, generate the children of node 3, 7, 8 are
children of 3 and these live nodes are killed by bounding functions. So we will not be included in the
queue.

4 5 6

● Again delete an element from the queue. Take it as an E-node, generate the children of 4. Node 9 is
generated and killed by boundary function. Next, delete an element from the queue. Generate children of
nodes 5, i.e., nodes 10 and 11 are generated and by boundary function, the last node in the queue is 6.
The child of node 6 is 12 and it satisfies the conditions of the problem, which is the answer node, so
search terminates.

LIFO Branch and Bound Search

● A data structure called stack. Initially the stack is empty.

Example:

● Generate children of node 1 and place these live nodes into stack.

● Remove element from stack and generate the children of it, place those nodes into stack. 2 is removed
from stack. The children of 2 are 5, 6. The content of stack is,
● Again remove an element from stack, i.,e node 5 is removed and nodes generated by 5 are 10, 11 which
are killed by bounded function, so we will not place 10, 11 into the stack.

● Delete an element from stack, i.,e node 6. Generate child of node 6, i.,e 12, which is the answer node, so
the search process terminates.

LC (Least Cost) Branch and Bound Search

● In both FIFO and LIFO Branch and Bound the selection rules for the next E-node are rigid and blind.
● The selection rule for the next E-node does not give any preferences to a node that has a very good
chance of getting the search to an answer node quickly.
● In this use ranking function or cost function and generate the children of E-node, among these live
nodes; select a node which has minimum cost. By using a ranking function,calculate the cost of each
node.

● Initially we will take node 1 as E-node. Generate children of node 1, the children are 2, 3, 4.
● By using ranking function we will calculate the cost of 2, 3, 4 nodes is ĉ =2, ĉ =3, ĉ =4 respectively.
Now select a node which has minimum cost i.,e node 2. For node 2, the children are 5, 6. Between 5 and
6 we will select the node 6 since its cost minimum.
● Generate children of node 6 i.,e 12 and 13.
● Select node 12 since its cost (ĉ =1) is minimum.Here 12 is the answer node. So, we terminate the search
process.

You might also like