Question

1) Consider the clique problem: given a graph G (V, E) and a positive integer k, determine whethe...

1) Consider the clique problem: given a graph G (V, E) and a positive integer k, determine whether the graph contains a clique of size k, i.e., a set of k vertices S of V such that each pair of vertices of S are neighbours to each other. Design an exhaustive-search algorithm for this problem. Compute also the time complexity of your algorithm.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Algorithm: Max-Clique (G, k, v) 
S := Φ 
for i = 1 to k do 
   t := choice (1…n)  
   if t Є S then 
      return failure 
   S := S ∪ t  
for all pairs (i, j) such that i Є S and j Є S and i ≠ j do 
   if (i, j) is not a edge of the graph then  
      return failure 
return success 
let count be an integer
set count to 0
for each vertex v in V’
    remove all edges adjacent to v from set E
    increment count by 1
    if count = k and E is empty
    then
        the given solution is correct
    else
        the given solution is wrong
Add a comment
Know the answer?
Add Answer to:
1) Consider the clique problem: given a graph G (V, E) and a positive integer k, determine whethe...
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. For a given graph G, we say that H is a clique if H is a complete subgraph of Design an algori...

    2. For a given graph G, we say that H is a clique if H is a complete subgraph of Design an algorithm such that if given a graph G and an integer k as input, determines whether or not G has a clique with k vertices in polynomial time. (Hint: Try to first find a polynomial time algorithm for a different problem and reduce the clique problem to that problem). 2. For a given graph G, we say that...

  • 2. For a given graph G, we say that H is a clique if H is...

    2. For a given graph G, we say that H is a clique if H is a complete subgraph of Design an algorithm such that if given a graph G and an integer k as input, determines whether or not G has a clique with k vertices in polynomial time. (Hint: Try to first find a polynomial time algorithm for a different problem and reduce the clique problem to that problem).

  • (a) Given a graph G = (V, E) and a number k (1 ≤ k ≤...

    (a) Given a graph G = (V, E) and a number k (1 ≤ k ≤ n), the CLIQUE problem asks us whether there is a set of k vertices in G that are all connected to one another. That is, each vertex in the ”clique” is connected to the other k − 1 vertices in the clique; this set of vertices is referred to as a ”k-clique.” Show that this problem is in class NP (verifiable in polynomial time)...

  • 4. Approximating Clique. The Maximum Clique problem is to compute a clique (i.e., a complete subgraph) of maximum size i...

    4. Approximating Clique. The Maximum Clique problem is to compute a clique (i.e., a complete subgraph) of maximum size in a given undirected graph G. Let G = (V,E) be an undirected graph. For any integer k ≥ 1, define G(k) to be the undirected graph (V (k), E(k)), where V (k) is the set of all ordered k-tuples of vertices from V , and E(k) is defined so that (v1,v2,...,vk) is adjacent to (w1,w2,...,wk) if and only if, for...

  • Show that the following three problems are polynomial reducible to each other Determine, for a given...

    Show that the following three problems are polynomial reducible to each other Determine, for a given graph G = <V, E> and a positive integer m ≤ |V |, whether G contains a clique of size m or more. (A clique of size k in a graph is its complete subgraph of k vertices.) Determine, for a given graph G = <V, E> and a positive integer m ≤ |V |, whether there is a vertex cover of size m...

  • 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,...

  • Prove that the following problem is NP-complete: given an undirected graph G = (V, E) and...

    Prove that the following problem is NP-complete: given an undirected graph G = (V, E) and an integer k, return a clique of size k as well as an independent set of size k, provided both exist.

  • 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...

  • Definition: Given a Graph \(\mathrm{G}=(\mathrm{V}, \mathrm{E})\), define the complement graph of \(\mathrm{G}, \overline{\boldsymbol{G}}\), to be \(\bar{G}=(\mathrm{V},...

    Definition: Given a Graph \(\mathrm{G}=(\mathrm{V}, \mathrm{E})\), define the complement graph of \(\mathrm{G}, \overline{\boldsymbol{G}}\), to be \(\bar{G}=(\mathrm{V}, E)\) where \(E\) is the complement set of edges. That is \((\mathrm{v}, \mathrm{w})\) is in \(E\) if and only if \((\mathrm{v}, \mathrm{w}) \notin \mathrm{E}\) Theorem: Given \(\mathrm{G}\), the complement graph of \(\mathrm{G}, \bar{G}\) can be constructed in polynomial time. Proof: To construct \(G\), construct a copy of \(\mathrm{V}\) (linear time) and then construct \(E\) by a) constructing all possible edges of between vertices in...

  • X) (4 points) If k is a positive integer, a k-coloring of a graph G is an assignment of one of k ...

    COMP Discrete Structures: Please answer completely and clearly. (3). (5). x) (4 points) If k is a positive integer, a k-coloring of a graph G is an assignment of one of k possible colors to each of the vertices/edges of G so that adjacent vertices/edges have different colors. Draw pictures of each of the following (a) A 4-coloring of the edges of the Petersen graph. (b) A 3-coloring of the vertices of the Petersen graph. (e) A 2-coloring (d) 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