t11ans - CS3230 Tutorial 11 1. Show that the question of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Tutorial 11 1. Show that the question of determining whether a graph G = ( V,E ) has a simple cycle of size at least k is NP-complete. Ans: (a) Certificate would be a cycle of size at least k . Verifier just checks whether the cycle is indeed simple (that is, it does not repeat a vertex), and all the edges in the cycle are indeed in the graph. This clearly can be done in polynomial time. (b) Hamiltonian circuit problem can be reduced to the above problem by using the same graph and taking k = n (the number of nodes in the graph). 2. Consider the following problem called vertex cover. Input: An undirected graph G = ( V,E ), and a number k . Question: Does there exists a vertex cover of size k ? That is, does there exist V 0 V , | V 0 | ≤ k such that, for each edge ( u,v ) E , at least one of u,v is in V 0 . Show that the above problem is NP complete. Ans: (a) To show that the problem is in NP, the certificates would be of the form V 0 of cardi- nality at most k which form a cover. Verification would be to check that indeed V 0 V , | V 0 | ≤ k , and for every edge ( u,v ) E , at least one of u,v is in V 0 . (b) Two methods. First method: Note that for a given graph G = ( V,E ), V 0 is a vertex cover iff V - V 0 is an independent set. Thus, there exists a vertex cover of size k iff there exists an independent set of size ≥ | V |- k . As independent set problem is NP-hard, we immediately get that vertex cover problem is NP-hard. Second method: Direct reduction from 3-SAT: Suppose ( U,C ) is a 3-SAT problem. Consider the vertex cover problem constructed as follows: Suppose U = { x 1 ,x 2 ,...,x n } , and C = { c 1 ,c 2 ,...,c m } , where c i = ` 1 i ` 2 i ` 3 i . Then, let
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

t11ans - CS3230 Tutorial 11 1. Show that the question of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online