The following statements may or may not be correct, In each case, either prove it (if it is correct) or give a counter-example (if it isn’t correct). Always assume that the graph G=(V,E)is undirected. Do not assume that edge weights are distinct unless this is specifically stated.

  1. If a graph G has more than |V|-1edges, and there is a unique heaviest edge, then this edge cannot be part of a minimum spanning tree.
  2. If G has a cycle with a unique heaviest edge e, then e cannot be part of any MST.
  3. Let e be any edge of minimum weight in G. Then e must be part of some MST.
  4. If the lightest edge in a graph is unique, then it must be part of every MST.
  5. If e is part of some MST of G, then it must be a lightest edge across some cut of .
  6. If G has a cycle with a unique lightest edge e must be part of every MST.
  7. The shortest-path tree computed by Dijkstra’s algorithm is necessarily an MST.
  8. The shortest path between two nodes is necessarily part of some MST.
  9. Prim’s algorithm works correctly when there are negative edges.
  10. (For any r>0, define an r-path to be a path whose edges all have weight <r). If G contains an r-path from node s to t , then every MST of G must also contain an r-path from node s to node t.

Short Answer

Expert verified

The following statements are correct or not:

  1. False
  2. True
  3. True
  4. True
  5. True
  6. False
  7. False
  8. False
  9. True
  10. True

Step by step solution

01

Explain the Minimum Spanning Tree.

Consider the undirected graph with weighted edges and the subgraphs.The sum of the weights of all the edges in the tree is the spanning-tree cost. The tree with the minimum spanning cost is known as the minimum spanning tree.

02

Show whether the given statement is correct or not.

(a)

Consider the undirected graph G=V,E, with more than V-1edges and a unique heaviest edge. The unique heaviest edge cannot be a part of a minimum spanning tree.

Consider the below graph as the counter-example:

In the above diagram, the edge with a weight of 10 is the unique heaviest edge. The minimum spanning tree of the above graph will not accept the heaviest edge since it is not included in the cycle.

Therefore, the provided statement is False, as shown by the counter-example.

03

Show whether the given statement is correct or not.

(b)

Consider the undirected graph G with the unique heaviest edge e. The graph G has the cycle with a unique heaviest edge as follows:

In the above diagram, the edge D to E is the unique heaviest edge. The edges A, B, C, and D form the cycle. The cycle is the minimum spanning tree of the graph that does not include the unique heaviest edge.

Therefore, the provided statement is True, and the graph proves it.

04

Show whether the given statement is correct or not.

(c)

Consider the graph G that has the edge e that has minimum weight. Consider the graph given in the diagram below. The edge B to A has a minimum weight of 2.


In the above graph, the minimum spanning tree includes the edge B to the minimum weight edge of the graph.

Therefore, the minimum edge e in a graph must be part of some MST, and the graph diagram proves it.

05

Show whether the given statement is correct or not.

(d)

Consider the graph G with the lightest unique edge.

The above graph has the lightest unique edge D to E with weight 1. The graph’s minimum spanning tree will include the edge D to E with weight one since the least minimum weight of the graph is 1.

Therefore, the unique lightest edge of the graph must be part of every true MST that is proved by the graph.

06

Show whether the given statement is correct or not.

(e)

Consider the graph G with the lightest edge across some cut of G

In the above graph, the minimum edge e of the minimum spanning tree is A to B. The edge D to E is the lightest edge e' across the cut. The minimum edge e can be replaced by the lightest edge across the cut e' and obtain a smaller minimum spanning tree.

Therefore, the Lightest edge across some cuts is the part of some MST that is True, which is proved by the graph.

07

Show whether the given statement is correct or not.

(f)

Consider the graph G with the lightest unique edge.

Consider the above graph that has the lightest unique edge e is B to C. The bold edge with weight 1 is not the part of the MST but the lightest edge in the cycle ABCD.

Therefore, the statement is False, and a counter-example is provided.

08

Show whether the given statement is correct or not.

(g)

Consider the graph G as follows:

In the above graph, the shortest path from A to D by Dijkstra’s algorithm is A-D. The edge A-D is the heaviest edge of the graph. Dijkstra’s algorithms will use the heaviest edge of a cycle; it is on the shortest path from the source to the destination.

Therefore, the provided statement is False, and the counter-example proves it.

09

Show whether the given statement is correct or not.

(h)

Consider the graph G as follows:


In the above graph, the shortest path between the source and the destination is A-D . The minimum spanning tree of the graph is ABCD. The shortest path between the source and destination is not part of any MST.

Therefore, the provided statement is False, and the counter-example proves it.

10

Show whether the given statement is correct or not.

(i)

Consider the graph that has negative edges. Prim’s algorithm always adds the lightest edge between the visited vertices and the unvisited vertices, which is the lightest edge of this cut.

Therefore, Prim’s algorithm correctly works when there are negative edges.

11

Show whether the given statement is correct or not.

(j)

Suppose that a graph G contains an r-path from the source to destination but that there is an MST T of G that does not contain an r-path from source to destination. ThenT contains a path from source to destination with an edge e of weight wer . Consider the partition of vertices made by removing e from T. One vertex e' of the r-path must be along this cut, as the r-path connects source and destination. Since we'<r , swap e' for e to get a spanning tree that is lighter than T, a contradiction.

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 Vaia!

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

A long string consists of the four characters A,C,G,T ; they appear with frequency 31%,20%,9%and40% respectively. What is the Huffman encoding of these four characters?

A binary counter of unspecified length supports two operations: increment (which increases its value by one) and reset (which sets its value back to zero). Show that, starting from an initially zero counter, any sequence of n increment and reset operations takes time O(n); that is, the amortized time per operation is O(1) .

Sometimes we want light spanning trees with certain special properties. Here’s an example.

Input: Undirected graph G=(V,E) ; edge weights we; subset of vertices UV

Output: The lightest spanning tree in which the nodes of U are leaves (there might be other leaves in this tree as well).

(The answer isn’t necessarily a minimum spanning tree.)

Give an algorithm for this problem which runs in O(ElogV) time. (Hint: When you remove nodes Ufrom the optimal solution, what is left?)

Graphs with prescribed degree sequences. Given a list of n positive integers d1,d2,,dn, we want to efficiently determine whether there exists an undirected graphG=(V,E) whose nodes have degrees preciselyd1,d2,,dn . That is, if V={v1,,vn}, then the degree of vi should be exactly di. We call (d1,,dn) the degree sequence of G. This graph G should not contain self-loops (edges with both endpoints equal to the same node) or multiple edges between the same pair of nodes.

(a) Give an example of d1,d2,d3,d4 where all the di3 and d1+d2+d3+d4 is even, but for which no graph with degree sequence(d1,d2,d3,d4) exists.

(b) Suppose that d1d2d3dn and that there exists a graph G=(V,E) with degree sequence (d1,,dn). We want to show that there must exist a graph that has this degree sequence and where in addition the neighbors of v1 are v2,v3,,vdi+1 . The idea is to gradually transform G into a graph with the desired additional property.

i. Suppose the neighbors ofv1 in Gare not v2,v3,,vdi+1. Show that there exists i<jn and uV and such that {v1,vi},{u,vj}Eand {v1,vj},{u,vi}E

ii. Specify the changes you would make to G to obtain a new graph G'=(V,E') with the same degree sequence as G and where (v1,vi)E'.

iii. Now show that there must be a graph with the given degree sequence but in which v1 has neighbors v2,v3,,vdi+1.

c) Using the result from part (b), describe an algorithm that on input d1,,dn (not necessarily sorted) decides whether there exists a graph with this degree sequence. Your algorithm should run in time polynomial in n and in m=i=1ndi .

The basic intuition behind Huffman’s algorithm, that frequent blocks should have short encodings and infrequent blocks should have long encodings, is also at work in English, where typical words like I, you, is, and, to, from, and so on are short, and rarely used words like velociraptor are longer.

However, words like fire!, help!, and run! are short not because they are frequent, but perhaps because time is precious in situations where they are used.

To make things theoretical, suppose we have a file composed of m different words, with frequencies f1,...,fm. Suppose also that for the ithword, the cost per bit of encoding is ci. Thus, if we find a prefix-free code where the ithword has a codeword of length Ii, then the total cost of the encoding will be localid="1659078764835" fi·ci·li.

Show how to modify Huffman’s algorithm to find the prefix-free encoding of minimum total cost.

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.

Sign-up for free