← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper
← RGPV CS-501 (CBGS) Theory of Computation November 2019 Solved Paper
Question
Explain P, NP and NP-complete problems with suitable examples.
Asked in: CD-501 | December 2024 | 7(b)
Write a short note on NP-complete problems.
Asked in: CS-501 | November 2019 | 8(iv)
Answer
P is the class of decision problems solvable by a deterministic Turing machine in polynomial time in input length. Examples include graph reachability and deciding whether a graph has a path of length at most a given bound.
NP is the class of decision problems with polynomial-size certificates verifiable in deterministic polynomial time, equivalently solvable by a nondeterministic TM in polynomial time. For Hamiltonian cycle, a certificate is a sequence of vertices; verifying that every vertex occurs once and every required edge exists takes polynomial time.
A problem is NP-hard if every problem in NP reduces to it by a polynomial-time many-one reduction. It is NP-complete if it is both NP-hard and in NP. SAT, 3-SAT and Hamiltonian cycle are standard NP-complete decision problems.
To prove NP-completeness of a new problem B, show B∈NP, then reduce a known NP-complete problem A to B in polynomial time. The direction A≤pB is essential. P⊆NP; whether P=NP is unresolved. A polynomial-time algorithm for any NP-complete problem would imply P=NP. NP does not mean non-polynomial.
← RGPV CD-501 Theory of Computation December 2024 Solved Question Paper
← RGPV CS-501 (CBGS) Theory of Computation November 2019 Solved Paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion