Branch and Bound: Live-Node: A Node That Has Not Been Expanded
Branch and Bound: Live-Node: A Node That Has Not Been Expanded
Definitions:
Branch and Bound is a state space search method in which all the
children of a node are generated before expanding any of its children.
1 1 1
2 3 4 5 2 3 4 5 2 3 4 5
Live Node: 2, 3, 4, and 5
6 7 8 9 8 9 6 7
FIFO Branch & Bound (BFS) LIFO Branch & Bound (D-Search)
Children of E-node are Children of E-node are inserted in a
inserted in a queue. stack.
The selection rule for the next E-node in FIFO or LIFO branch-and-bound
is sometimes “blind”. i.e. the selection rule does not give any preference to
a node that has a very good chance of getting the search to an answer
node quickly.
^
Expanded-node (E-node): is the live node with the best value
C
Requirements
^
Get an approximation of C(x), (x) such that
C
^
(x) C(x), and
C
^
(x) = C(x) if x is a solution-node.
C
^
The approximation part of (x) is
C
h(x)=the cost of reaching a solution-node from X,
not known.
Least-cost search:
^
The next E-node is the one with least
C
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. -2-
Design and Analysis of Algorithms (DAA) Unit – VII
Example: 8-puzzle
^
Cost function: = g(x) +h(x)
C
where
h(x) = the number of misplaced tiles
and g(x) = the number of moves so far
12356784 12358674
12356784
^
C 1 4 5 ^ ^
C 1 2 3 C 1 4 5
12356478 12356784 12563784
^ ^ ^
C 2 1 3 C235 C235
12358674 12356784 13526784
^
C3 25 ^
C303
12358674 12358674
Definitions:
Branching:
Each node splits the remaining solutions into two groups: those
that include a particular edge and those that exclude that edge
L
All Solutions
L1 L2
Subtract of a constant from any row and any column does not
change the optimal solution (The path).
The cost of the path changes but not the path itself.
Get the reduced matrix A' of A and let L be the value subtracted
from A.
L: represents the lower bound of the path solution
The cost of the path is exactly reduced by L.
Note that the right subtree only sets the branching edge to
infinity.
Pick the edge that causes the greatest increase in the lower
bound of the right subtree, i.e., the lower bound of the root
of the right subtree is greater.
Example:
o The reduced cost matrix is done as follows:
- Change all entries of row i and column j to infinity
- Set A(j,1) to infinity (assuming the start node is 1)
- Reduce all rows first and then column of the resulting matrix
1 25
Vertex = 2 Vertex = 5
Vertex = 3 Vertex = 4
2 35 3 53 4 25 5 31
Vertex = 2 Vertex = 5
Vertex = 3
6 28 7 50 8 36
Vertex = 3 Vertex = 5
9 52 10 28
Vertex = 3
11 28
Row # 4: Reduce by 3:
Row # 4: Reduce by 4
Column 1: Reduce by 1
Column 2: It is reduced.
Column 3: Reduce by 3
Column 4: It is reduced.
Column 5: It is reduced.
The reduced cost is: RCL = 25
So the cost of node 1 is:
Cost(1) = 25
The reduced matrix is:
cost(1) = 25
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 10 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 11 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 12 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 13 -
Design and Analysis of Algorithms (DAA) Unit – VII
In summary:
o So the live nodes we have so far are:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
4: cost(4) = 25, path: 1->4
5: cost(5) = 31, path: 1->5
o Explore the node with the lowest cost: Node 4 has a cost of 25
o Vertices to be explored from node 4: 2, 3, and 5
o Now we are starting from the cost matrix at node 4 is:
Cost(4) = 25
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 14 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 15 -
Design and Analysis of Algorithms (DAA) Unit – VII
Reduce column # 1: by 11
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 16 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 17 -
Design and Analysis of Algorithms (DAA) Unit – VII
In summary:
o So the live nodes we have so far are:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
5: cost(5) = 31, path: 1->5
6: cost(6) = 28, path: 1->4->2
7: cost(7) = 50, path: 1->4->3
8: cost(8) = 36, path: 1->4->5
o Explore the node with the lowest cost: Node 6 has a cost of 28
o Vertices to be explored from node 6: 3 and 5
o Now we are starting from the cost matrix at node 6 is:
Cost(6) = 28
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 18 -
Design and Analysis of Algorithms (DAA) Unit – VII
Reduce column # 1: by 11
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 19 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 20 -
Design and Analysis of Algorithms (DAA) Unit – VII
In summary:
o So the live nodes we have so far are:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
5: cost(5) = 31, path: 1->5
7: cost(7) = 50, path: 1->4->3
8: cost(8) = 36, path: 1->4->5
9: cost(9) = 52, path: 1->4->2->3
10: cost(2) = 28, path: 1->4->2->5
o Explore the node with the lowest cost: Node 10 has a cost of 28
o Vertices to be explored from node 10: 3
o Now we are starting from the cost matrix at node 10 is:
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 21 -
Design and Analysis of Algorithms (DAA) Unit – VII
A.Dhasaradhi M.Sc.(IT).,M.Tech(CSE).,M.I.S.T.E.,HDCHN. - 22 -