reffec.com

=(nk in Java Printing qr barcode in Java =(nk

=(nk using barcode printer for applet control to generate, create qr image in applet applications. Microsoft Office Word Website + n-k -2k-2). comparisons. Recalling that k n2 2: +n2 n(n L=kan=E6 + 1)(2n + 1). The edge yw i s xx1 if xv e T: otherwise, xlx 2 if x2 E T; and so on. This process eventually leads to edge viy, as described, because the last vertex u is in T..

388 12 Trees we find that the number of comparisons is (n-2)(n - )+nn- 1)-(n -2)(n-1)(2n 2 + n(n 1)-6 2 6 - 2(n The procedure is 0(n 3 ). 2)(n 2. 2(n -1) = I1 3_-7 + 1. 6 6"+ A Bound for a Minimum Hamiltonian Cycle There is an i Quick Response Code for Java nteresting connection between the Traveling Salesman"s Problem (Section 10.4) and minimum spanning trees in a weighted graph. Recall that the Traveling Salesman"s Problem is to find a Hamiltonian cycle of minimum weight in a weighted Hamiltonian graph.

Our ability to find minimum spanning trees gives us a way to determine lower bounds for the weight of a minimum Hamiltonian cycle. Suppose g is a weighted Hamiltonian graph with Hamiltonian cycle X. Removing any vertex v of g (and the edges with which it is incident) gives us a subgraph g" of g and a subgraph X" of N which is a spanning tree for Q"; in fact, N" is a path through all vertices of 5 except v.

It follows that the weight of X is the weight of N" plus the sum of the weights of the two edges in N incident with v. Hence, w(N) > w(minimum spanning tree for A") + smallest sum of weights of two edges incident with v. By choosing several different vertices v, we can obtain various lower bounds for the weight of the Hamiltonian cycle N and so, in particular, for the weight of a minimum Hamiltonian cycle.

Considering again the graph in Fig 12.16 (which is Hamiltonian), if we remove vertex H (and the three edges with which it is incident), it is easily checked that all the edges of the spanning tree indicated in Fig 12.16, except for H J, comprise a minimum spanning tree for the subgraph, of weight 39 - 3 = 36.

The smallest two weights of edges incident with H are 3 and 5. Therefore, we obtain 36 + 3 + 5 = 44 as a lower bound for the weight of any Hamiltonian cycle. Suppose we remove K instead of H.

This time, the heavy edges in Fig 12.18 form a minimum spanning tree in the subgraph, of weight 38. The two smallest weights of edges incident with K are 3 and 4, so we obtain 38 + 3 + 4 = 45 as a lower bound for the weight of any Hamiltonian cycle, a better estimate than before.

Find a Hamiltonian cycle in the graph of Fig 12.16. What is its weight .

11. Each time an edge is added, we changed the labels on its end vertices to the lower of the two previous labels (and all the vertices in a certain component to the lower as well). All vertices are eventually labeled 1.

. 12.4 Minimum Spanning Tree Algorithms A graph 5 and a spanning tree for 5 \ {K) with weight 38. 12. IHJABCDEF jboss QR Code 2d barcode MKLGI is a Hamiltonian cycle of weight 75. Note how the path JA .

.. GI which results when H is removed is a spanning tree for the subgraph without H, and how the path LG *.

. FM which results when K is removed is a spanning tree for the subgraph without K..

ffrTIM The symbol [B servlet qr-codes B] means that an answer can be found in the Back of the Book. 1. Use Kruskal"s algorithm to find a spanning tree of minimum total weight in each of the graphs in Fig 12.

19. Give the weight of your minimum tree and show your steps. 2.

[BB; (a)] For each of the graphs of Exercise 1, apply Prim"s algorithm to find a minimum spanning tree. Try to find a tree different from the one found before. Start at vertex E in each graph, explain your reasoning, and draw the tree.

3. [BB] Find a minimum spanning tree for the graph in Fig 12.13.

What is the smallest length of pavement required to connect the towns in this graph 4. (a) Explain how Kruskal"s algorithm could be modified so that it finds a spanning tree of maximum weight in a connected graph. (b) Apply the modified algorithm described in (a) to find a maximum spanning tree for each of the following graphs and give the maximum weight of each.

i. ii. iii.

iv. v. EBB] the graph in Exercise l(a) the graph in Exercise I(b) the graph in Exercise l(c) the graph in Exercise 1(d) the graph in Fig 12.

16 5. Repeat Exercise 4 for Prim"s algorithm. For each part of (b), start at vertex A.

6. [BB] Explain how a minimum spanning tree algorithm can be used to find a spanning tree in a connected graph where the edges are not weighted. 7.

How could a minimum spanning tree algorithm be used to find a spanning tree in an unweighted graph which excludes a given edge, assuming such spanning trees exist 8. (a) [BB] Suppose we have a connected graph 5 and we want to find a spanning tree for 5 which contains a given edge e. How could Kruskal"s algorithm be used to do this Discuss both the weighted and unweighted cases.

(b) Use Kruskal"s algorithm to show that if is a connected graph, then any (not necessarily connected) subgraph which contains no circuits is part of some spanning tree for 5. Consider both the weighted and unweighted cases. 9.

Answer Exercise 8 using Prim"s algorithm instead of Kruskal" s. 10. [BB] Prove that at each vertex v of a weighted connected graph, Kruskal"s algorithm always includes an edge of lowest weight incident with v.

.
Copyright © reffec.com . All rights reserved.