The problem and are
View worked solution
Answer: C
The correct option is C.
Here is the classification of both problems:
- 3-SAT: This is a classic NP-complete problem. It is a special case of the Boolean satisfiability problem where each clause contains exactly three literals. It was one of Richard Karp's original 21 NP-complete problems.
- 2-SAT: This problem restricts each clause to have at most two literals. Unlike 3-SAT, 2-SAT can be solved in polynomial time, placing it in P.
Polynomial-time algorithm for 2-SAT:
A 2-SAT instance can be represented as an implication graph, where each clause is equivalent to two implications: and . By constructing this directed graph and finding its Strongly Connected Components (SCCs) using Kosaraju's or Tarjan's algorithm, we can determine satisfiability in linear time. If no variable and its negation lie in the same SCC, the formula is satisfiable.
Thus, 3-SAT is NP-complete and 2-SAT is in P.
Free practice · Your answers on this page are not saved.
