Question

Problem 1: Given a graph G (V,E) a subset U S V of nodes is called a node cover if each edge in E is adjacent to at least one node in U. Given a graph, we do not know how to find the minimum node cover in an efficient manner. But if we restriet G to be a tree, then it is possible. Give a greedy algorithm that finds the minimum node cover for a tree. Analyze its correctness and running time. A tree if a connected graph with no cycles, i.e. where any pair of nodes is connected by a simple path.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

            U = Ø

            while(E != Ø )

                        choose a vertex v V having maximum degree in all the remaining unvisited                                              vertices

                        U = U ∪ {v}

                        E ← E - {e ∈ E : v ∈ e}

Return U

  • This algorithm accepts a graph G.
  • Initially define set U as an empty set which will later contain all the vertices in node cover.
  • While loop iterates over all the edges and in each iteration performs following tasks:
    • Select a vertex from all the unvisited vertices which has maximum degree i.e. vertex with highest number of edges incident on it. Call this vertex v.
    • Add this vertex to the set of node cover U
    • Remove all the edges which incidents on v from the set E of edges.
  • Loop stops when all E becomes Ø meaning all the edges have been visited by the node cover.
  • Return set U containing node cover.
  • Time Complexity of above algorithm is O(V + E).
Add a comment
Know the answer?
Add Answer to:
Problem 1: Given a graph G (V,E) a subset U S V of nodes is called...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2) Let G ME) be an undirected Graph. A node cover of G is a subset...

    2) Let G ME) be an undirected Graph. A node cover of G is a subset U of the vertex set V such that every edge in E is incident to at least one vertex in U. A minimum node cover MNC) is one with the lowest number of vertices. For example {1,3,5,6is a node cover for the following graph, but 2,3,5} is a min node cover Consider the following Greedy algorithm for this problem: Algorithm NodeCover (V,E) Uempty While...

  • Consider an unweighted, undirected graph G = 〈V, E). The neighbourhood of a node u E V in the gr...

    Consider an unweighted, undirected graph G = 〈V, E). The neighbourhood of a node u E V in the graph is the set of all nodes that are adjacent (or directly connected) to v. Subsequently, we can define the neighbourhood degree of the node v as the sum of the degrees of all its neighbours (those nodes that are directly connects to v) (a) Design an algorithm that returns a list containing the neighbourhood degree for each node v V,...

  • 3. Given graph G = (V,E), prove that the following statements are equivalent. [Note: the following statements are e...

    3. Given graph G = (V,E), prove that the following statements are equivalent. [Note: the following statements are equivalent definitions of a "tree graph".] 1) There exist exactly one path between any of two vertices u, v EV in the graph G 2) Graph G is connected and does not contain any cycles. 3) Graph G does not contain any cycles, and a cycle is formed if any edge (u, v) E E is added to G 3. Given graph...

  • Consider an unweighted, undirected graph G = 〈V, E). The neighbourhood of a node u E V in the gr...

    This question needs to be done using pseudocode (not any particular programming language). Thanks Consider an unweighted, undirected graph G = 〈V, E). The neighbourhood of a node u E V in the graph is the set of all nodes that are adjacent (or directly connected) to v. Subsequently, we can define the neighbourhood degree of the node v as the sum of the degrees of all its neighbours (those nodes that are directly connects to v) (a) Design an...

  • Let G be a DAG (a graph without loops) and u, v be two designated nodes...

    Let G be a DAG (a graph without loops) and u, v be two designated nodes (there are many other nodes in G). In particular, each node in G is labeled with a color and multiple nodes can share the same color. A good path is one where the number of green nodes is bigger than the number of yellow nodes. Describe an efficient algorithm to count the number of good paths from u to v.

  • 7.(35) A subset S of the nodes of a graph G is a dominating set if...

    7.(35) A subset S of the nodes of a graph G is a dominating set if every other node of G is adjacent to some node in S. Consider the language: DOMINATING-SET ={<G, K> | G has a dominating set with k nodes} Show that DOMINATING-SET is NP-complete by reduction from VERTEX- COVER.

  • NAME . You are given a strongly connected directed graph G (V, E) with positive edge...

    NAME . You are given a strongly connected directed graph G (V, E) with positive edge weights along with a particular node vo E V. Give an efficient algorithm for finding shortest paths between all pairs of nodes, with the one restriction that these paths must all pass through v (8 points)

  • IN JAVA Given is a weighted undirected graph G = (V, E) with positive weights and...

    IN JAVA Given is a weighted undirected graph G = (V, E) with positive weights and a subset of its edges F E. ⊆ E. An F-containing spanning tree of G is a spanning tree that contains all edges from F (there might be other edges as well). Give an algorithm that finds the cost of the minimum-cost F-containing spanning tree of G and runs in time O(m log n) or O(n2). Input: The first line of the text file...

  • Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n...

    Problem 3's picture are given below. 5. (a) Let G = (V, E) be a weighted connected undirected simple graph. For n 1, let cycles in G. Modify {e1, e2,.. . ,en} be a subset of edges (from E) that includes no Kruskal's algorithm in order to obtain a spanning tree of G that is minimal among all the spanning trees of G that include the edges e1, e2, . . . , Cn. (b) Apply your algorithm in (a)...

  • Viterbi algorithm We can use dynamic programming on a directed graph G = (V, E) for...

    Viterbi algorithm We can use dynamic programming on a directed graph G = (V, E) for speech recognition. Each edge (u, v) in E is labeled with a sound s(u, v) from a finite set S of sounds. The labeled graph is a formal model of a person speaking a restricted language. Each path in the graph starting from a distinguished vertex v0 in V corresponds to a possible sequence of sounds produced by the model. The label of a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT