Branch and bound is a state space search method that generates all children of a node before expanding any children. It associates a cost or profit with each node and uses a min or max heap to select the next node to expand. For the travelling salesman problem, it constructs a permutation tree representing all possible routes and uses lower bounds and reduced cost matrices at each node to prune the search space and find an optimal solution.
Branch and Boundis a state space search
method in which all the children of a node
are generated before expanding any of its
children.
3.
Least Cost ormax profit
This scheme associates a cost or profit with each node. If
we are searching for a solution with least cost, then the
list of live nodes can be set up as a min heap. The next E-node
is the live node with least cost. If we want a solution
with maximum profit, the live node list can be set up as a
max heap. The next E-node is the live node with
maximum profit.
4.
1
Ways toselect E-Node
2 3 4 5
Live Node: 2, 3, 4, and 5
1
2 3 4 5
6 7 8 9
1
2 3 4 5
8 9 6 7
FIFO Branch & Bound (BFS)
Children of E-node are inserted in a
queue.
LIFO Branch & Bound (D-Search)
Children of E-node are inserted in
a stack.
5.
Requirements
• Branching:A set of solutions, which is represented
by a node, can be partitioned into mutually
exclusive sets. Each subset in the partition is
represented by a child of the original node.
• Lower bounding: An algorithm is available for
calculating a lower bound on the cost of any
solution in a given subset.
6.
Searching: Least-costsearch (LC)
• Cost and approximation
• Each node, X, in the search tree
is associated with a cost: C(X)
• C(X) = cost of reaching the
current node, X (E-node), from the
root + the cost of reaching an
answer node from X.
C(X) = g(X) + h(X)
7.
Example: 8-puzzle
^
= g(x) +h(x)
Cost function: C
Where,
h(x)=the number of misplaced tiles
g(x)=the number of moves so far
Assumption: move one tile in any direction cost 1,
Initial State Final State
1 2 3
5 6
7 8 4
1 2 3
5 8 6
7 4
Travelling salesman problem
In this problem we are given an n vertex network
(either directed or undirected) and are to find a
cycle of minimum cost that includes all n vertices.
Any cycle that includes all n vertices of a
network is called a tour. In the traveling-salesperson
problem, we are to find a least-cost
tour.
State space diagramor permutation tree
A
B
1
2
3
4
C D E
3 4 2 4 2 3
F G H I J K
4 3 4 2 3 2
L M N O P Q
12.
formulas
• S={1,p,1|p=Permutationof (2,3,…,n)}
Size of S=(n-1)!
oT(S)=T(R)+A(i,j)+r
where,
R=parent node
A=reduced cost matrix for node R
S=child of R such that <R,S>=<i,j> belongs to E
r=reduced constant
13.
EXAMPLE
Let thefollowing cost matrix be for n=5 in graph
G(V,E):
Cost (2):
•Theresulting cost matrix is:
T(2)=T(1)+A(1,2)+r
=25+10+0
=35
18.
Cost (3):
•Theresulting cost matrix is:
T(3)=T(1)+A(1,3)+r
=25+17+11
=53
19.
Cost (4):
•Theresulting cost matrix is:
T(4)=T(1)+A(1,4)+r
=25+0+0
=25
20.
• In summary:
So the live nodes we have so far are:
o2: cost(2) = 35, path: 1->2
o3: cost(3) = 53, path: 1->3
o4: cost(4) = 25, path: 1->4
o5: cost(5) = 31, path: 1->5
Explore the node with the lowest cost: Node 4 has a cost of 25
Vertices to be explored from node 4: 2, 3, and 5
Now we are starting from the cost matrix at node 4 is:
Cost(4):
21.
•Choose to goto vertex 2: Node 6 (path is 1->4->2)
The resulting cost matrix is:
T(6)=T(4)+A(4,2)+r
=25+3+0
=28
22.
•In summary:
Sothe live nodes we have so far are:
o2: cost(2) = 35, path: 1->2
o3: cost(3) = 53, path: 1->3
o5: cost(5) = 31, path: 1->5
o6: cost(6) = 28, path: 1->4->2
o7: cost(7) = 50, path: 1->4->3
o8: cost(8) = 36, path: 1->4->5
Explore the node with the lowest
cost: Node 6 has a cost of 28
Vertices to be explored from node 6:
3 and 5
Now we are starting from the cost
matrix at node 6 is:
Cost(6)=28
23.
•Choose to goto vertex 3: Node 9 ( path is 1->4->2->3 )
The resulting cost matrix is:
T(9)=T(6)+A(2,3)+r
=28+11+13
=52
24.
•Choose to goto vertex 3: Node 10 ( path is 1->4->2-
>5)
The resulting cost matrix is:
T(10)=T(6)+A(2,5)+r
=28+0+0
=28
25.
• In summary:
So the live nodes we have so far are:
o2: cost(2) = 35, path: 1->2
o3: cost(3) = 53, path: 1->3
o5: cost(5) = 31, path: 1->5
o7: cost(7) = 50, path: 1->4->3
o8: cost(8) = 36, path: 1->4->5
o9: cost(9) = 52, path: 1->4->2->3
o10: cost(2) = 28, path: 1->4->2-
>5
Explore the node with the lowest
cost: Node 10 has a cost of 28
Vertices to be explored from node 10:
3
Now we are starting from the cost
matrix at node 10 is:
26.
•Choose to goto vertex 3: Node 11( path is 1->4->2->5->3 )
The resulting cost matrix is:
T(11)=T(10)+A(5,3)+r
=28+0+0
=28