Professional Documents
Culture Documents
Branch Bound 6
Branch Bound 6
Branch Bound 6
BFS strategy is called FIFO branch & bound and D-search is a LIFO branch &
bound.
FIFO branch & bound uses a queue and LIFO uses a stack.
Like backtrack there is a use of bounding function to check a criteria for branching.
Let us see how a FIFO branch-and-bound algorithm would search the state space tree for
the 4-queens problem.
X1=1
X1=1 4
2 3
X2=2 4
3
X1=1
2 3
Oiuy8
Fig. 1: Portion of 4-queens state space tree generated by FIFO branch & bound.
Note 1: Numbers outside the node give the order in which the nodes are generated by FIFO
branch-and-bound.
Legal moves: are ones in which a tile adjacent to the empty spot (ES) is moved to ES. In
Fig. 3, four legal moves are possible.
Note: There are 16! (16! ≈ 20.9 x 10 12) different arrangements of the tiles on the frame. Of
these only one half are reachable from any given initial state.
Let POSITION(i) be the position number in the initial state of the tile numbered i and
LESS(i) be the number of tiles j such that
j < i and POSITION(j) > POSITION(i).
Let X = 1 if in the initial state, the empty spot is at one of the shaded positions of Fig. 5 and
X = 0 if it is at one of the remaining positions.
LESS (i) x
i 1
is even.
State Space Tree:
Order of legal moves (ES rather than tiles): Up, Right, Down or Left
No node p has a child that is same as p’s parent.
Result of DFS:
Intelligent Search Method:
Let c(X) be the length of a path from the root to a nearest goal node (if any) in the
subtree with root X.
This will simplify search and quickly finds the answer node.
g(X) is an estimate of the length of a shortest path from X to a goal node in the
subtree with root X.
One possible choice of g(X) = no. of nonblank tiles not in their goal position
Nodes 22 and 23 are next generated. Node 23 is determined to be a goal node and the search
terminates.
Alorithm:
Task 1: Consider the following sum of subsets problem: (w1, w2, w3, w4) = (11, 13, 24, 7).
Draw the state space tree (variable size) and apply the FIFO branch and bound technique to
obtain the solution. Show the generated tree during the FIFO search and Compare it to that
generated by the backtracking method and make your comment with detailed analysis.
Task 2: Verify whether the initial arrangement can be reachable to the goal arrangement
given below:
6 2
4
3
16
Hints Task 2: Check whether LESS (i) x
i 1
is even or not.