FlashKeepers

Computer Science · College · College and University

Algorithms: P, NP and NP-Completeness

P versus NP, reductions, SAT, classic NP-complete problems, approximation algorithms and undecidability.

About this set

35 basic cards for College Computer Science. Set 4 of 5 in Algorithms. It opens with "What is the P class in computational complexity?" and "What is the NP class in computational complexity?". Study it alongside the other College sets below.

35 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is the P class in computational complexity?
Show answerThe set of decision problems solvable by a deterministic Turing machine in polynomial time.
What is the NP class in computational complexity?
Show answerThe set of decision problems verifiable by a deterministic Turing machine in polynomial time, given a certificate.
Is every problem in P also in NP?
Show answerYes. If a problem is solvable in polynomial time, it is also verifiable in polynomial time (ignore the certificate).
What is the P versus NP problem?
Show answerThe unsolved question of whether P equals NP (whether every polynomial-time verifiable problem is also polynomial-time solvable).
What does it mean for a problem to be NP-complete?
Show answerA problem is NP-complete if it is in NP and every problem in NP can be reduced to it in polynomial time.
What is a polynomial-time reduction from problem A to problem B?
Show answerAn algorithm that transforms any instance of A into an instance of B in polynomial time, preserving the answer (yes-instance maps to yes-instance).
What is the Boolean satisfiability problem (SAT)?
Show answerGiven a Boolean formula in conjunctive normal form, determine if there exists an assignment of variables that makes it true.
Why is SAT the canonical NP-complete problem?
Show answerThe Cook-Levin theorem proves SAT is in NP and NP-hard, with every NP problem reducing to SAT in polynomial time.
What is 3-SAT?
Show answerThe satisfiability problem restricted to formulas in conjunctive normal form where each clause contains exactly 3 literals.
What is the clique problem?
Show answerGiven a graph and integer k, determine if the graph contains a complete subgraph (clique) of size at least k.
What is the vertex cover problem?
Show answerGiven a graph and integer k, determine if there exists a set of at most k vertices such that every edge has at least one endpoint in the set.
What is the independent set problem?
Show answerGiven a graph and integer k, determine if there exists a set of k vertices with no edges between them.
What is the Hamiltonian path problem?
Show answerGiven a graph, determine if there exists a path that visits every vertex exactly once.
What is the Traveling Salesman Problem (TSP)?
Show answerGiven n cities and distances, find the shortest tour that visits each city exactly once and returns to the start.
What is the subset sum problem?
Show answerGiven a set of integers and a target sum, determine if there is a subset that sums to the target.

20 more cards in the app

Study this set free