Adapblm

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Consider the directed graph which has the adjacency matrix as follows:

0 10 15 20
5

9 10

6 13

0 12

Step1 :g(2, ) = c21 = 5 ; g(3, ) = c31 = 6; g(4, ) = c41 = 8.

(2)

Using (2) we obtain


g(2, {3}) = c23 + g(3, ) = 9 + 6 = 15
g(2, {4}) = c24 + g(4, ) = 10 + 8 = 18
g(3, {2}) = c32 + g(2, ) = 13 + 5 = 18
g(3, {4}) = c34 + g(4, ) = 12 + 8 = 20
g(4, {2}) = c42 + g(2, ) = 8 + 5 = 13
g(4, {3}) = c43 + g(3, ) = 9 + 6 =15
step 2:Next, we compute g(i, S) with |S| = 2 and i 1; 1S and i S.
g(2, {3,4})= min {c23 + g(3,{4}), c24 + g(4,{3})} = 25
g(3, {2,4})= min {c32 + g(2,{4}), c34 + g(4,{2})} = 25
g(4, {2,3})= min {c42 + g(2,{3}), c43 + g(3,{2})} = 23
step 3:Finally, from (2) we obtain:
g(1, {2, 3,4})= min {c12 + g(2,{3, 4}), c13 + g(3,{2,4}), c14 + g(4,{2,3})}
= min {35, 40, 43} = 35
step 4: An optimal tour of the graph has length 35.
A tour of this length may be constructed if we retain with each g(i, S)
the value of j that minimizes the right hand side of (2). Let J(i, S) be
this value.
J(1, {2,3,4}) = 2. Thus the tour starts from 1 and goes to 2. The
remaining tour may be obtained from g(2, {3,4}). J(2, {3,4}) = 4. Thus

the next edge is <2,4>. The remaining tour is for g(4,{3}). J(4, {3}) =
3. The optimal tour is <1, 2, 4, 3, 1>

You might also like