• Tidak ada hasil yang ditemukan

An Efficient Test Vector Ordering Algorithm for Minimizing Peak Switching Activity

3.3 Algorithm for BTSP

We have used the heuristic proposed by (Larusic et al., 2012) for solv- ing BTSP. This algorithm uses the N earest N eighbour Heuristic(N N H) proposed in (Lawler, 1985), for computing upper-bound and Bottleneck Biconnected Spanning Subgraph(BBSS)algorithm proposed in (Pun- nen and Nair, 1994) for computing lower-bound. These algorithms are explained in Algorithm 1 and Algorithm 2 respectively. Algorithm 1 finds a Hamiltonian Cycle in a complete graph G and returns max cost edge in this cycle. This is an upper-bound for BT SP solution. Algorithm 2 finds an biconnected spanning subgraph of G by

19

ordering the edges in non decreasing order of edge weights, and does a binary search to find the set of edges in the required biconnected subgraph. To motivate, the bottleneck biconnected spanning subgraph and the nearest neighbourhood of the complete graph in Figure 3.1, are shown in Figures 3.4(a) and 3.4(b) respectively. The BTSP algorithm is shown in Algorithm 3.

Algorithm 1: N N H Algorithm Input: GraphG

Output: An upper-boundU BforBT SP Solution

/* Let C be an Hamiltonian cycle in G. Output of this

1

algorithm is maximum cost edge in C. */

Letcurrent_vertexbe any vertex in graphGand markcurrent_vertexas

2

visited ;

Letstart_vertexbecurrent_vertex;

3

Letmax_costbezero. ;

4

whilethere is any unvisited vertex in graph Gdo

5

LetV be any unvisited vertex inGsuch that edge cost between

6

current_vertexandV is minimum;

Letcurrent_costbe edge cost betweencurrent_vertex, V ;

7

Letmax_costbe themax(max_cost, current_cost);

8

Letcurrent_vertexbeV;

9

end

10

Letcurrent_costbe edge cost betweencurrent_vertex, start_vertex;

11

Letmax_costbe themax(max_cost, current_cost);

12

returnmax_cost.

13

Before going into the details of this algorithm, we will next explain an operation calledControlled shake operation, which is extensively used in this algorithm. Let G be a graph andδ be a positive number. Controlled shake operation on graphG with valueδcreates a graphGsas follows

• Vertex set ofGsis the same as vertex set ofG

• Edge set ofGsis the same as edge set ofG

• cost of an edgeeinGsis zero if the cost of the corresponding edge inG is less than or equal toδ

• cost of an edgee in Gs is any positive random number if the cost of the corre- sponding edge inG is greater thanδ

Having understood theControlled shake operation, we will now try to briefly under- stand the different steps in Algorithm 3. A detailed description of the same can be found

Algorithm 2: BBSSP Algorithm Input: GraphG

Output: A lower-boundLB forBT SP Solution

/* Let G be a biconnected spanning subgraph of G such

1

that maximum cost edge in G is minimum. Output of this algorithm is maximum cost edge in G. */

LetZ1 < Z2 <· · ·< Zkbe the distinct edge costs ofGsorted in increasing

2

order;

Letl = 1,u =k;

3

while l<u do

4

δ =⌊(u−l2 ⌋+l;

5

G = (V, E)whereE ={(i, j)∈E :Cij ≤Zδ }

6

ifG is biconnectedthen

7

u=δ;

8

end

9

else

10

l =δ+ 1;

11

end

12

end

13

returnZl.

14

in (Larusic et al., 2012). The following points summarize the different steps involved in Algorithm 3.

• LetGsbe a graph obtained from a graphG bycontrolled shake operationwith valueδ. Note that ifGscontains Hamiltonian tour with cost zero thenGcontains a BTSP tour with cost at mostδ.

Suppose BTSP tour cost in a graph G is ≤ δ. Then if we apply controlled shake operation on G several times with the same δ then one of the graphs generated by these operations will have Hamiltonian tour with cost zero with high probability.

In the algorithm 3,while loopfrom line 10 to 18 uses these two ideas while trying to findBT SP tour with cost atmost δ. With high probability it will find such a tour if there exists one.

• The while loop from line 5 to 26 tries to find an index i, where 1 ≤ i ≤ k, such that given graphG contains a BTSP tour with cost at mostZi using binary search.

• In line21of the algorithm, whenever we are setting upper bounduequal tomid then we are certain that BTSP tour cost inG is at mostZu.

• In line24in the algorithm, if we are setting lower boundl tomid+ 1 does not mean that BTSP tour cost in G is at least Zl. It can be less than Zl with some small probability. This is because we are using a heuristic to test whether the given graph contains a Hamiltonian cycle or not.

21

0

1 3

2

4

4

5

3 4

4

5

0 0 0

0 0

(a) Bottleneck biconnected spanning subgraph inG

0

1 3

2

4

4

5

3 4

5

0 0

(b) Nearest Neighbourhood inG

Figure 3.4: BBSS and NN inG

• Whenever this algorithm terminates, lower boundlis equal to upper bounduand given graph contains a BTSP tour with cost at mostZu.

Now, the lower bound given byBBSS Algorithm 2 is not a tight lower bound. Keep- ing this in mind, in order to optimize further, we propose Algorithm 4, which tries to tighten this lower bound value. It compares bottleneck value given by BT SP Algorithm 3 and maximum cost edge value given by BBSS Algorithm 2, and tries to tighten the lower bound value. We refer to the lower bound thus obtained by Algorithm 4, as Enhanced lower bound. In the experimental results, we use this Enhanced lower boundto quantify the performance ofBT SP Algorithm.

Algorithm 5 explains the entire process of computing bottleneck value.

Dokumen terkait