Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 12 - Theory of Computation - Chapter Review Problems - Page 572: 37

Answer

Option (a)

Work Step by Step

Class P: Problems that can be solved by a deterministic algorithm in polynomial time. Class NP: Problems for which a solution can be verified in polynomial time, but not necessarily found in polynomial time. Many famous NP problems are not known to be in P (and are believed not to be). a. For a given set S of n integers, sort S. - Sorting can be done efficiently by algorithms like Merge Sort, Heap Sort, or Quick Sort, all of which run in $O(\log n)$ time. - Polynomial time → in class P. b. The Traveling Salesperson Problem (TSP). - Given a set of cities and distances, find the shortest possible tour that visits each city once and returns to the start. - Brute-force: $O(n!)$ possibilities — exponential. - No known polynomial-time algorithm for the general case. $\rightarrow$ Not in P (it’s NP-hard / NP-complete). c. The Hamilton Path problem. - Determine whether a graph contains a path that visits every vertex exactly once. - This is a classic NP-complete problem (decision version). $\rightarrow$ Not in P (unless P = NP). d. The Node (Vertex) Cover problem. - Given a graph and an integer $𝑘$, decide whether there’s a subset of $k$ vertices that covers all edges. - Another classic NP-complete problem. $\rightarrow$ Not in P (unless P = NP). Therefore: Only (a) is in class P.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.