Question

In: Computer Science

Prove that the following problem is in NP: Given a digraph G over n vertices (n...

Prove that the following problem is in NP: Given a digraph G over n vertices (n is an even number), does G contain 2 vertex-disjoint simple cycles in which each cycle is of length n/2?

Solutions

Expert Solution

A problem P is in NP if and only if it is a decision problem with output Yes or No. And for every Yes output, its solution is verifable in polynomial time.

Since this problem is a decision problem and below is the verifier with solution consisting of set C1 and C2 i.e. vertex disjoint cycle C1 and C2 and each should be of length n/2.

Verifier(G=(V,E), C1, C2)

1. If |V| mod 2 = 1 then return False //since number of vertices are odd and hence such cycle cannot exist

2. If |C1| |V|/2 or |C2| |V|/2 then return False //if number of vertices in each cycle is not n/2 then return false

3. If then return False //since cycle must be disjoint

4. For every edge (u,v) in C1:-

5.........If then return False //since every edges in cycle must be part of edge set E

6. For every edge (u,v) in C2:-

7.........if then return False

8. If C1 and C2 contains |V|/2 vertices and edges in sequence forming a cycle then return True

9. else return False

Since each step of the verifier is done in polynomial time of the input size, hence the verifier is polynomial time verifier and the given problem is in NP.

Please comment for any clarification.


Related Solutions

Given a connected graph G with n vertices. We say an edge of G is a...
Given a connected graph G with n vertices. We say an edge of G is a bridge if the graph becomes a disconnected graph after removing the edge. Give an O(m + n) time algorithm that finds all the bridges. (Partial credits will be given for a polynomial time algorithm.) (Hint: Use DFS)
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove...
Prove that the 0/1 KNAPSACK problem is NP-Hard. (One way to prove this is to prove the decision version of 0/1 KNAPSACK problem is NP-Complete. In this problem, we use PARTITION problem as the source problem.) (a) Give the decision version of the O/1 KNAPSACK problem, and name it as DK. (b) Show that DK is NP-complete (by reducing PARTITION problem to DK). (c) Explain why showing DK, the decision version of the O/1 KNAPSACK problem, is NP-Complete is good...
1.)Prove that f(n) = O(g(n)), given: F(n) = 2n + 10; g(n) = n 2.)Show that...
1.)Prove that f(n) = O(g(n)), given: F(n) = 2n + 10; g(n) = n 2.)Show that 5n2 – 15n + 100 is Θ(n2 ) 3.)Is 5n2 O(n)?
(a) Prove the following claim: in every simple graph G on at least two vertices, we...
(a) Prove the following claim: in every simple graph G on at least two vertices, we can always find two distinct vertices v,w such that deg(v) = deg(w). (b) Prove the following claim: if G is a simple connected graph in which the degree of every vertex is even, then we can delete any edge from G and it will still be connected.
Given an undirected graph G = (V,E), consisting of n vertices and m edges, with each...
Given an undirected graph G = (V,E), consisting of n vertices and m edges, with each edge labeled from the set {0,1}. Describe and analyze the worst-case time complexity of an efficient algorithm to find any cycle consisting of edges whose labels alternate 0,1.
Prove and give a counterexample: If N ⊲ G and G ⊲ H, then N ⊲...
Prove and give a counterexample: If N ⊲ G and G ⊲ H, then N ⊲ H. Please write an explanation with some details
Question 1 a) Prove that if u and v are distinct vertices of a graph G,...
Question 1 a) Prove that if u and v are distinct vertices of a graph G, there exists a walk from u to v if and only if there exists a path (a walk with distinct vertices) from u to v. b) Prove that a graph is bipartite if and only if it contains no cycles of odd length. Please write legibly with step by step details. Many thanks!
You are given a directed graph G(V,E) with n vertices and m edges. Let S be...
You are given a directed graph G(V,E) with n vertices and m edges. Let S be the subset of vertices in G that are able to reach some cycle in G. Design an O(n + m) time algorithm to compute the set S. You can assume that G is given to you in the adjacency-list representation.
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given...
Show that if P=NP then there is a polynomial-time algorithm for the following search problem: given a graph, find its largest clique.
Prove a connected simple graph G with 16 vertices and 117 edges is not Eulerian.
Prove a connected simple graph G with 16 vertices and 117 edges is not Eulerian.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT