Consider the following decision problem: • Input: hGi where G is a graph. • Question: Does G contain a clique of size 3? Is this problem in P? Yes, no, unknown? Justify your answer (if your answer is “yes”, briefly describe a polynomial-time algorithm).
Consider the following decision problem: • Input: hGi where G is a graph. • Question: Does...
Exercise 3 (2 pts). Consider the following decision problem: Given a list of integers, deter- mine whether all elements of the list are distinct. Is this problem in P? Yes, no, unknown? Justify your answer (if your answer is "yes", briefly describe a polynomial-time algorith)
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 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).
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.
2. Consider the following problem: Input: graph G, integer k Question: is it possible to partition vertices of G into k disjoint independent sets? Is this problem polynomial or NP-complete? Explain your answer
Question 4 (4 marks). a. Consider the decision problems PROBLEMA and PROBLEMB. PROBLEMA is known to be NP- Complete Your friend has found a polynomial time reduction from PROBLEMB to PROBLEMA. Another friend of yours has found an algorithm to solve any instance of PROBLEMB in polynomial time Have your friends proved that P=NP? Explain your answer. [2 marks b. Consider the following algorithm, which computes the value of the nth triangle number. function TRIANGLENUMBER(n) result 0 for i in...
(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)...
Professor Amongus has just designed an algorithm that can take any graph G with n vertices and determine in O(n^k) time whether G contains a clique of size k. Does Professor Amongus deserve the Turing Award for having just shown that P = NP? Why or why not? R-17.12 Professor Amongus has just designed an algorithm that can take any graph G with n vertices and determine in O(nk) time whether G contains a clique of size k. Does Professor...
QUESTION 5 A program P takes time proportional to n log n where n is the input size. If the program takes 4 seconds to process input of size 100,000,000, how many microseconds does it take to process input of size 10,000? QUESTION 6 algorithm An example of a graph problem that can be solved in polynomial time is (Hint: Starts with 'D' You're allowed to research this one online if you don't know it.)
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...