Chapter 5: Q4E (page 161)
Show that if an undirected graph with n vertices has k connected components, then it has at least n - k edges.
Short Answer
The undirected graph with n vertices has k connected components with least n - k edges.
Chapter 5: Q4E (page 161)
Show that if an undirected graph with n vertices has k connected components, then it has at least n - k edges.
The undirected graph with n vertices has k connected components with least n - k edges.
All the tools & learning materials you need for study success - in one app.
Get started for freeA prefix-free encoding of a finite alphabet Γ assigns each symbol in Γ a binary codeword, such that no codeword is a prefix of another codeword. A prefix-free encoding is minimal if it is not possible to arrive at another prefix-free encoding (of the same symbols) by contracting some of the keywords. For instance, the encoding is not minimal since the codeword 101 can be contracted to 1 while still maintaining the prefix-free property.
Show that a minimal prefix-free encoding can be represented by a full binary tree in which each leaf corresponds to a unique element of Γ, whose codeword is generated by the path from the root to that leaf (interpreting a left branch as 0 and a right branch as 1 ).
Consider an undirected graph with nonnegative edge weights role="math" localid="1658915178951" . Suppose that you have computed a minimum spanning tree of G, and that you have also computed shortest paths to all nodes from a particular node role="math" localid="1658915296891" . Now suppose each edge weight is increased by 1: the new weights are .
(a) Does the minimum spanning tree change? Give an example where it changes or prove it cannot change.
(b) Do the shortest paths change? Give an example where they change or prove they cannot change.
Under a Huffman encoding of symbols with frequencies , what is the longest a codeword could possibly be? Give an example set of frequencies that would produce this case.
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 edgesthat 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 .
Output: A feedback edge set minimum total weight .
Suppose you implement the disjoint-sets data structure usingunion-by-rank but not path compression. Give a sequence of union and find operations onelements that take time.
What do you think about this solution?
We value your feedback to improve our textbook solutions.