TSP Branch and Bound Lecture 2015
TSP Branch and Bound Lecture 2015
TSP Branch and Bound Lecture 2015
Solution : Let cij equals to cost of edge <i, j>, and cij = ∞ if <i,j> E,
and |v|=n.
Assume that every tour start and end at vertex 1. So solution space is
given by S={ 1, x | x is a permutation of (2, 3, ….n) }
To use the LCBB to search the SST, we define the cost function C(.) such that
the solution node with least C(.) corresponds to optimal tour.
TSP Problem
To use the LCBB to search the SST, we define the cost function C(.) such that
the solution node with least C(.) corresponds to optimal tour. And two other
^
functions C (.) and U(.).
C(A) = length of tour defined by path from the root to A if A is leaf node
= cost of min-cost leaf in the sub-tree A, If A is not leaf node.
^ ^
A simple C (.) such that C (A) <= C(A) for all A obtained by defining
^
C () = length of path defined at node A.
The path defined at node 6 is i0 , i1, i2 = 1,2,4. it consist of edge <1,2> , <2, 4>.
^
A better C (.) can be obtained by using reduced cost matrix corresponding to
G.
1. A row (column) is reduced iff it contain at least one zero and all remaining
entries are non-negative.
2. A matrix is reduced if every row and column is reduced.
How to reduce the cost matrix of given graph G.
TSP Problem
(a) cost matrix row reduced
∞ 20 30 10 11 ∞ 10 20 0 1
15 ∞ 16 4 2 13 ∞ 14 2 0
3 5 ∞ 2 4 1 3 ∞ 0 2
19 6 18 ∞ 3 16 3 15 ∞ 0
16 4 7 16 ∞ 12 0 3 12 ∞
Since every tour in this graph include exactly one edge <i, j > with i=k, 1<=k<=5
and exactly one edge <i, j > with j=k , 1<=k<=5.
Subtracting a constant t from every entry in one column or row of the cost-
matrix reduced the length of every tour by exactly t. A min-cost tour remain a
min-cost following this operation.
Obtain the reduced cost matrix. The total amount subtracted is the lower
bound on min-cost tour.
Subtracting 10,2,2,3,4 from rows 1,2,3,4,5
TSP Problem
Row reduced matrix (b)reduced matrix L=25
10 20 0 11
∞ 10 17 0 1
∞
12 ∞ 11 2 0
13 ∞ 13 2 0
0 3 ∞ 0 2
1 3 ∞ 0 2
15 3 12 ∞ 0
16 3 15 ∞ 0
11 0 0 12 ∞
12 0 3 12 ∞
Let A be a reduced cost matrix for node R. Let S be child of R such that tree
edge (R,S) corresponds to include the edge <i, j > in the tour.
If S is not the leaf then reduced cost matrix for node S is obtained as follows:
TSP Problem
If S is not the leaf then reduced cost matrix for node S is obtained as follows:
1. Change all entries in row i and column j to ∞ ( this prevent any more edge
leaving vertex i and entering to vertex j ).
2. Set A(j,1) to ∞, this prevent the use of edge <j, 1>
3. Reduced all rows and columns in resulting matrix except for rows and
columns containing only ∞.
Start with the root node as E-node, nodes 2,3,4 and 5 are generated.
Calculate the reduced-matrix for these nodes.
(1) Reduced matrix for node 2 is calculated from matrix (b).
a) Set all entries in row 1 and column 2 to ∞ .
b) Set element at position A(2,1) to ∞
TSP Problem
25 1
i1=2 i1=3 i1=4 i1=5
35 2 53 4 25 5 31
3
i2=2 i2=3 i2=5
28 50 36
6 7 8
i3=3 i3=5
52 28
9 10
i4=3
28 11
i4=3
28 11
(e ) path 1,4,2 : node 6 (f) path 1,4,3: node 7 (g) path 1,4,5: node 8
^ ^ ^
C (6)=bound=28 C (7)= bound=50 C (8)= bound=36
TSP Problem
25 1
i1=2 i1=3 i1=4 i1=5
35 2 53 4 25 5 31
3
i2=2 i2=3 i2=5
28 50 36
Green = live nodes 6 7 8
Red = E-nodes i3=3 i3=5
52 28
9 10
i4=3
28 11
Next node 6 become the E-node. Nodes 9 and 10 are generated. Calculate the
reduced matrix for this node, ant its bound are 52 and 28.
TSP Problem
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
∞ ∞ ∞
∞ ∞ 11 ∞ 0 ∞ ∞ ∞ ∞ ∞ ∞
∞ ∞ ∞ ∞
0 ∞ ∞ ∞ 2 ∞ 1 ∞ ∞ 0 0 ∞ ∞ ∞ ∞
∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
∞ ∞ ∞ ∞
11 ∞ 0 ∞ ∞ 0 ∞ ∞ ∞ ∞ ∞ ∞ 0 ∞ ∞
(e ) path 1,4,2 : node 6 (h) path 1,4,2,3: node 9 (i) path 1,4,2,5: node 10
bound=28 bound=52 bound=28
^
The tour length for this node is C (11)=28 and upper is updated to 28.
TSP Problem
25 1
i1=2 i1=3 i1=4 i1=5
35 2 53 4 25 5 31
3
i2=2 i2=3 i2=5
28 50 36
6 7 8
i3=3 i3=5
52 28
9 10
i4=3
11 28
solution node
Figure1: SST generated by procedure LCBB
^
For the next E-node , node 5 , C (5) = 31 > upper. (node is non-promising). All other
live nodes becomes non-promising because their bounds > 31.
Hence, LCBB terminates with path 1, 4, 2, 5, 3, 1 as the shortest path( tour).