QB5 - NPC - Solution

QB5 - NPC - Solution - COMP 271 Design and Analysis of...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: COMP 271 Design and Analysis of Algorithms 2003 Spring Semester Question Bank 5 – Selected Solutions There is some overlap between these question banks and the tutorials. Solving these questions (and those in the tutorials) will give you good practice for the midterm. Some of these questions (or similar ones) will definitely appear on your exam! Note that you do not have to submit answers to these questions for grading. Your TAs will discuss answers to selected questions in the tutorials. 1. Suppose L ∈ P . Then, as seen in class, L ∈ P . Since P ⊆ NP we have L ∈ NP. But, by definition, this means L = L ∈ Co-NP . So, we have just shown that L ∈ P implies L ∈ Co-NP or P ⊆ Co-NP . 2. We already saw in class that L ∈ P if and only if L ∈ P, i.e., P = Co-P . But if NP 6 = Co-NP we would then have P = NP 6 = Co-NP = Co-P leading to a contradiction. 3. (i) True (ii) False (iii) True (iv) False (v) True 4. (i) No problems in NP can be solved in polynomial time. Unknown (ii) Every NP-complete problem requires at least exponential time to be solved. Unknown (iii) X is in NP and X ≤ P SAT. Then X is NP-complete. False : 5. Suppose that G is a graph that has a feedback vertex set of size k . The certificate is the set V of vertices that are in the feedback vertex set. To determine whether V is indeed a feedback vertex set, we need to test whether every cycle in G passes through at least one of these vertices. Note that there are exponentially many cycles in a graph, so testing each cycle would not run in polynomial time. Instead we delete all the vertices of V from G , along with any incident edges. Let G denote the resulting graph. Then we test whether G has a cycle, by running DFS and checking whether the resulting tree has at least one backedge. If so, V is not a feedback edge set (since the cycle in G does not pass through any vertex of V ) and otherwise it is. 1 9. Set Cover (SC) ∈ NP Th certificate consists of the subset C of F . Given C , we first check that C contains k sets. This can be done in O ( k ) time. Note that the input size is at least k since F contains at least k sets. Next, for each element x ∈ X , we check if x appears in some set in C . This takes O ( k | X | 2 ) time, since each set in C has at most | X | elements. Since both checks can be done in time polynomial in the input size, weelements....
View Full Document

Page1 / 4

QB5 - NPC - Solution - COMP 271 Design and Analysis of...

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

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