/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q1E Consider the following graph.(a)... [FREE SOLUTION] | 91影视

91影视

Consider the following graph.

(a) What is the cost of its minimum spanning tree?

(b) How many minimum spanning trees does it have?

(c) Suppose Kruskal鈥檚 algorithm is run on this graph. In what order are the edges added to the MST? For each edge in this sequence, give a cut that justifies its addition.

Short Answer

Expert verified

a).The cost of its minimum spanning treeby usingKruskal鈥檚 algorithm is 19.

b).Theminimum number of spanning trees does is 2.

c). Theorder of the edges added to the MST or each edge in the sequence isAE,EF,BE,FG,GH,CG,andGD.

Step by step solution

01

A minimal spanning tree:

A minimal spanning tree is indeed an edge-weighted graph with a weight that is equal to which is less than the value about any other spanning tree.

02

The least cost of spanning tree.  

a)

Minimum spanning tree cost:

The number of edges for a minimal spanning tree may be calculated using the formula below.:

Numberofedges=Numberofvertices1

In Equation, replace"numberofvertices=8"with the value.

Numberofedges=81=7

The following are the steps to determining the least spanning tree:

Begin with the graph's vertices " A ."

鈥 Each vertices "A " has two angles with such a load of 6 vertices point A to point B and 1 vertices from to .

鈥 From A through E vertices, the minimum weight is 1 as indicated below:

Next, starts with vertex 鈥B 鈥.

鈥 The vertex "B " has four edges with weights of 6 vertices from B to A ,5 vertices from B to C ,2 vertices from B to E , and 2 vertices from B to F . From B to E vertices, the minimum weights are 2; from B to F vertices, the minimum weights are 2. Take a look at the initial minimal weight value. As a result, the minimal weight 2 from B to E vertices are as follows:

Then comes the vertex " C ."

鈥 Each vertices " C " has four edges having weights of 5 vertices through C to B ,6 vertices as C to D,5 vertices from C to F, and 4 vertices from C to G.

鈥 From C through G vertices, the lower limit is 4 as indicated below:

Then comes the vertex "D ."

鈥 Each vertices "D" has four edges having weights of 5 vertices through D to B,6 vertices as D to D ,5 vertices from D to F, and 4 vertices from D to G.

鈥 From D through G vertices, the lower limit is 4.

Then comes the vertex " E ."

鈥 The vertex "E " has three edges with weights of one from E to A , two from E to B, and one from E to F vertices.

鈥 The first and second weights have already been drawn.

From E through F vertices, the minimum weight is 1 as indicated below:

Next, begin with vertex "F ."

鈥 The vertex "F " has four edges, each with a weight of one from F to E , two from F to B , five between F and C , and three from F to G .

鈥 The first and second weights have already been drawn.

From F through G vertices, the minimum weight is 3 as indicated below:

The following vertex is "G."

鈥 The vertex "G" has four edges with weights of 3 between G and F vertices,4 between G and C vertices,5 between G and D vertices, and 3 between G and H vertices.

鈥 The third and fourth weights have already been drawn.

o From G through H vertices, the minimum weight is 3 as illustrated below:

Finally, the minimum spanning tree is shown below:

The cost of the minimum spanning tree is the sum of all the weighted edges.

Therefore, the cost of the minimum spanning tree: 19

03

The number of minimum spanning tree in this graph.

b)

In the given graph, there are two possibilities of the minimum spanning tree. That is, we can take the weight 2 from B to E or weight 2 fromEtoF .

One possible minimum spanning tree with weight2fromBtoEand is given below:

Another possible minimum spanning tree with weight2fromEtoFand is given below:

Therefore, the number of minimum spanning tree in this graph is 2.

04

Run the MST using Kruskal’s algorithm:

c)

The minimum spanning tree using the Kruskal鈥檚 algorithm is given below:

In this MST,

鈥 There are 7 edges are included into the minimum spanning tree such as,

AE,EF,BE,FG,GH,CG,andGD.

ForAEedge,thecutsareA,B,C,DandE,F,G,H.ForEFedge,thecutsareA,B,C,D,EandF,G,H.ForBEedge,thecutsareA,E,F,G,HandB,C,D.ForFGedge,thecutsareA,B,EandC,D,F,G,H.ForGHedge,thecutsareA,B,E,F,GandC,D,H.ForCGedge,thecutsareA,B,E,F,G,HandC,D.ForGDedge,thecutsareA,B,C,E,F,G,HandD.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91影视!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Give a linear-time algorithm that takes as input a tree and determines whether it has a perfect matching: a set of edges that touches each node exactly once.

A feedback edge set of an undirected graph G(V,E) is a subset of edgesE'Ethat intersects every cycle of the graph. Thus, removing the edges will render the graph acyclic.

Give an efficient algorithm for the following problem:

Input: Undirected graph G(V,E) with positive edge weights we.

Output: A feedback edge set E'Eminimum total weight eE'we.

Let G=(V,E) be an undirected graph. Prove that if all its edge weights are distinct, then it has a unique minimum spanning tree

Ternary Huffman. Trimedia Disks Inc. has developed 鈥渢ernary鈥 hard disks. Each cell on a disk can now store values 0,1, or 2(instead of just 0 or 1). To take advantage of this new technology, provide a modified Huffman algorithm for compressing sequences of characters from an alphabet of size n, where the characters occur with known frequencies f1, f2,...., fn. Your algorithm should encode each character with a variable-length codeword over the values 0,1,2, such that no codeword is a prefix of another codeword and so as to obtain the maximum possible compression. Prove that your algorithm is correct

We use Huffman's algorithm to obtain an encoding of alphabet {a,b,c}with frequencies fa,fb,fc. In each of the following cases, either give an example of frequencies (fa,fb,fc)that would yield the specified code, or explain why the code cannot possibly be obtained (no matter what the frequencies are).

(a) Code:{0,10,11}

(b) Code:{0,1,00}

(c) Code:{10,01,00}

Suppose we want to find the minimum spanning tree of the following graph.

(a) Run Prim鈥檚 algorithm; whenever there is a choice of nodes, always use alphabetic ordering (e.g., start from node A). Draw a table showing the intermediate values of the cost array.

(b) Run Kruskal鈥檚 algorithm on the same graph. Show how the disjoint-sets data structure looks at every intermediate stage (including the structure of the directed trees), assuming path compression is used.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.