Branch and Bound
Thenode currently being explored is called E-node and all
the vertices which have been already visited but yet not
explored are live nodes
The term Branch and Bound refers to all state space search
methods in which all children of the E-node are generated
before any other node can become the E-node
BFS and D-search are both branch and bound techniques.
D-search differs from BFS only in that the next node to
explore is the most recently reached unexplored node
1
4 5 6
3
2
BFS
D.Search
3.
In BB terminologyBFS like state space search is called FIFO
search and D-search like search is called LIFO search
Bounding function will be used kill live nodes without
generating all its children.
A dead node is a generated node that is either not to be
expanded further(killed)or one for which all of its child
nodes have been generated
In both LIFO and FIFO branch and bound technique, the
selection rule for next node to be explored is rigid and
does not give preference to a node that has a very good
chance of getting the search to an answer node quickly
The search can be speeded up by using an intelligent ranking
function C^
(.) [Cost function]for live nodes
4.
A search strategythat uses a cost function to select next E-
node with least cost is called LCBB –least cost Branch and
Bound strategy
Let C(x) be the minimum cost of any answer node in the sub
tree with root x. it is not easy compute c(x) hence C^
(x) <
C(x) is used which is easier to compute
An upper bound or bounding function U(x) >C(x) is used to
kill nodes whose C^
(x) >C(x)
5.
Least Cost Search(LC)
•The search of answer node can be speeded up
using an intelligent ranking function C^(.) for live
nodes. The next E node is selected on the basis
of ranking function. For any node x,
i)the number of nodes in subtree of x needed to
be generated before an answer node is
generated.
ii)the number of level the nearest answer node is
from x.
using this ii) method the cost of root of a tree is 4.
7.
• The searchstrategy which uses cost function to
select next E node would always choose live node
with least cost (C^(.)). This strategy is known as least
cost search.
• BFS and DFS are special cases of LC search.
• LC search coupled with bounding functions is called
an LC branch and bound search.
• If x is answer node then c(x) is the cost of reaching x
from root of state space tree.
• If x is not answer node, then c(x) = ∞.if subtree x
does not contain answer node. otherwise c(x) equals
cost of minimum cost answer node in subtree x.
11.
0/1 Knapsack problem
Weuse LCBB search with minimization problems as least cost
criteria matches with the objective of minimization of
costs
We replace the objective function ∑pixi by the function
–∑ pixi. Clearly ∑pixi is maximized iff –∑pixi is minimized
Normally , in minimization problems , upper bound is the
cost of a known solution. The upper bound can be refined
once you get a lesser cost solution.
An upper bound and C^ can be defined for each node x in the
tree which will use the fact that certain assignments are
already made to xi’s to reach x
Upper bound can be obtained by making remaining
assignments 1 till it exceeds knapsack capacity.
12.
Since it iscost of a solution it will be more than cost of
optimal solution
For C^ we use the fact that the optimal solution of the
corresponding fractional knapsack problem will always
have higher profit and thus its negative value will act like
a lower bound
We arrange objects in descending order of pi/wi
U(x) = ∑ pixi <= m and C^(x) = ∑ pixi (with fraction)
13.
Example: [LCBB]Consider theknapsack instance n=4, (p1,p2,p3,p4) =
(10,10,12,18),
(w1,w2,w3,w4) = (2,4,6,9) and m=15
Search begins with root as the E-node. For this node we have…..
C^(1) = -38 and U(1) = -32
m = 15 p=(10,10,12,18) , w=(2,4,6,9)
For, C^(x) = ∑ pixi (with fraction)
C= 10+10 +12+18 = 10+10+12+(3/9*18) = -38
2 + 4 + 6 + (3/9)
U= 10+10+12 = -32
c^(2) = (x1=1) = -38 and u(2) = -32
c^(2) = (x1=0) =
Consider n=5, (p1,p2,,…p5)=(10,15,6,8,4),(w1,w2….w5)=(4,6,3,4,2)
and m =12
p/w=(2.5,2.5,2,2,2) is already in descending order
With the root node U(x) = 10+15=25
C^(x)= 10+15+2/3*6=29
Traveling SalesPerson problem
Touse LCBB search ,we need to define a C^(x) function for each
node x in the state space tree and also define an upper bound
Normally , in minimization problems , upper bound is the cost of a
known solution. The upper bound can be refined once you get a
lesser cost solution.
Initially upper bound = ∞
C^ can be obtained by using reduced cost matrix.
A row or column in a matrix is said to be reduced if it contains at
least one zero and remaining entries are non-negative.
A row or column can be reduced by selecting the minimum value in
row or column from each entry
25.
Consider the TSPmatrix
∞ 7 3 12 8
3 ∞ 6 14 9
5 8 ∞ 6 18
9 3 5 ∞ 11
18 14 9 8 ∞
Since every tour includes exactly
one edge i to k, subtracting a
constant t reduces the length of
every tour by t
Subtracting 3 from first row will
reduce the first row and the
minimum tour cost will be equal to
The total amount subtracted from columns and rows to
reduce each row and column acts as a lower bound on the
length of the minimum cost tour and can be used as the C^
value for the root of the state space tree
3 + minimum tour cost of ∞ 4 0 9 5
Matrix with reduced row 3 ∞ 6 14 9
5 8 ∞ 6 18
9 3 5 ∞ 11
18 14 9 8 ∞
26.
Reducing first therows
∞ 7 3 12 8 3
3 ∞ 6 14 9 + 3
5 8 ∞ 6 18 + 5
9 3 5 ∞ 11 +3
18 14 9 8 ∞ +8
The total amount subtracted from columns and rows =rank
of the matrix= 25 and can be used as the C^ value for the
root of the state space tree
∞ 4 0 9 5
0 ∞ 3 11 3
0 3 ∞ 1 13
6 0 2 ∞ 8
10 6 1 0 ∞
+ 3
2
0
10
5
∞
25
i1=2 i1=3 i1=4 i1=5
27.
For subsequent nodesin the tree c^ should include the cost
of the edge already traveled plus the value of the reduced
cost matrix corresponding to that node
The reduced cost matrix corresponding to the node obtained
after including the edge ( i, j) is computed as follows
i) Change all entries in ith
row and jth
column to ∞. This
prevents the use of any edges leaving vertex i and entering
vertex j in subsequent calculation of tour.
ii) Set C(j,1) to ∞. This prevents abrupt conclusion of the
tour by going back to 1
iii) Obtain this new matrix R from the original matrix S. If r is
the rank of R and s is the rank of S then
c^= cij (edge cost)+ A(i, j)+ reduction factor