NP (AI generated from transcript) Flashcards
(100 cards)
What does NP stand for in complexity theory?
Nondeterministic Polynomial time
True or False: NP means ‘Not Polynomial’ time.
False
Which complexity class is a subset of the other? A) P is a subset of NP B) NP is a subset of P
A) P is a subset of NP
If P = NP, which of the following is true? A) All NP-Complete problems can be solved in polynomial time B) No NP-Complete problems can be solved in polynomial time
A) All NP-Complete problems can be solved in polynomial time
To prove a problem is in NP, what must be demonstrated?
That a proposed solution can be verified in polynomial time
For a problem to be NP-Complete, which conditions must be satisfied? A) It is in NP B) All problems in NP reduce to it C) Both A and B D) Either A or B
C) Both A and B
If problem A reduces to problem B, and B is in P, what can we conclude about A?
A is in P
In a reduction from problem A to problem B, the reduction arrow points: A) From A to B B) From B to A
A) From A to B
To verify a clique of size k in a graph with n vertices, the time complexity is:
O(n²)
In a reduction, which transformations must run in polynomial time?
Both input and output transformations
True or False: When showing an ‘if and only if’ relationship in a reduction proof, proving ‘if A has a solution then B has a solution’ and ‘if B has no solution then A has no solution’ is sufficient.
False
The statement mixes one direction (A → B) with the contrapositive of the other direction (¬B → ¬A).
Would be valid if “A -> B” and “B -> A”, or “A -> B” and “!A -> !B”
Which of the following problems is in P?
1. MST
2. Knapsack-search
3. k-Coloring
4. SAT
Minimum Spanning Tree
When proving a graph problem is NP-Complete, which problems are typically best to reduce from?
Independent Set, Clique, or Vertex Cover
The time complexity to verify a solution to the Subset Sum problem is:
O(n log W) where W is the sum of the integers
True or False: In a reduction, we transform the input of the problem we’re proving is NP-Complete to the input of the known NP-Complete problem.
False
When reducing SAT to 3SAT, what is the main transformation technique?
Splitting clauses with more than three literals by introducing new variables
The contrapositive of ‘If P then Q’ is:
If not Q then not P
Which statement about NP-Hard problems is correct?
1. All NP Hard problems are NP-Complete
2. All NP-Hard problems are in NP
3. NP Hard can be verified in polynomial time
4. Not all NP-Hard problems are in NP
Not all NP-Hard problems are in NP
In the reduction from 3SAT to Independent Set, the goal value g is set to:
The number of clauses in the 3SAT formula
In the reduction from Independent Set to Vertex Cover, how is the budget b determined?
b = n - g (where n is the number of vertices)
True or False: In the reduction from Independent Set to Clique, we use the complement of the original graph.
True
Complement Graph:
The complement of a graph is a graph with the same vertices, but where an edge exists between two vertices if and only if it did not exist in the original graph
In the reduction from 3SAT to Subset Sum, what number base is used to avoid carries between digits?
Base 10
Which of the following is NOT in NP?
Maximum Independent Set (optimization version)
The time complexity to verify a Vertex Cover solution is:
(Given a candidate solution for VC of vertex set S and input graph G=(V,E), check that for all edges (x,y) in E, at least x or y is in vertex set S.)
O(n + m) where n is vertices and m is edges
Given n vertices in V and m edges in E, this check takes O(n+m). We then check that size of S is at most budget b by counting the number of vertices in S. Counting all vertices takes O(n) time. O(n+m) dominates and is polynomial.