CS6515_Exam3 Flashcards
LP (Linear Programming) is in P? (T/F)
True
ILP (Integer Linear Programming) is in P? (T/F)
False. It is known to be NP-Complete
NP-Complete problems are the hardest problems in what class? What assumption are we making?
NP, ie the outer layer of the donut. The assumption we’re making is that P != NP, because in that case all NP-Complete problems are not in P.
In some sense, you can think of NP-Complete problems as the “essence” of the class NP.
If a NP-complete problem can be solved in polytime then what does this mean?
Then ALL problems in NP can be solved in polytime.
Describe the P vs. NP question? What is the historical background of it?
Note: not necessarily important for exam, but useful information to help contextualize P vs. NP.
In the 1960-70s scientists began realizing that certain problems had efficient algorithms for solving them, but many other problems did not seem to have such an algorithm. Many of these thorny latter problems had important practical applications, from vehicle routing, network design, etc. Scientists began sorting the problems based on their “hardness”. One thing scientists noticed is that while some of these hard problems did not appear to have polytime algorithms for SOLVING, a given solution could still be checked quickly (ie in polytime). This came to be the class NP.
While most modern researchers think that P != NP, a decisive answer to the question has been incredibly elusive. Doubts arise because sometimes a problem that was thought to be in NP turns out to be in P after someone devises a clever polytime algorithm (eg, finding primes, etc.). THIS IS REALLY YHE CORE QUESTION OF P vs NP: Will we eventually find polytime algorithms for all NP problems, in which case P = NP, or is it just the case that some really hard problems simply don’t have efficient algorithms for solving?
Previous ponderings and correspondence by people like Nash, Godel, and Von Neumann in the 1950s hinted that a problem was afoot. More formal descriptions following. In 1965, Cobham and Edmunds appear to be the first to identify the class of P problems [1][2], ie ones that can be solved in polynomial time. Edmunds published a paper (also in 1965) that provided a template for what would later become the class NP.
The formal theory of NP-Completeness is generally traced back to a few individuals (some working independently) in the early 1970s, namely Stephen Cook, Richard Karp, and Leonid Levin.
Sources:
[1] A. Cobham. The intrinsic computational difficulty of functions. In Y. BarHillel, editor, Proc. 1964 International Congress for Logic Methodology and
Philosophy of Science, pages 24–30, Amsterdam, 1964. North Holland.
[2] J. Edmonds. Paths, trees, and flowers. Canad. J. Math, 17:449–467, 1965.
[3] J. Edmonds. Minimum partition of a matroid into independent subsets.
J. Res. Nat. Bur. Standards Sect. B, 69:67–72, 1965
[4] S. Cook. The complexity of theorem proving procedures. In Proc. 3rd
Ann. ACM Symp. on Theory of Computing, pages 151–158, New York,
1971. Association for Computing Machinery
Describe the different between the following problems in terms of computational complexity:
- Multiplication and sorting
- Sudoku
- The game of Chess or Go
- These are examples of problems that are in the class P because we have very good fast algorithms for solving them, eg Karatsuba algorithm for multiplication, merge-sort for sorting, etc.
- Sudoku is a classic example of an NP problem (it is also NP-Complete). If I give you a solved Sudoku grid, it’s trivial for you to check if it is correct (or at least trivial for a computer). However, solving a Sudoku grid is hard, and it gets exponentially harder as the grid gets bigger. There is no known algorithm for solving Sudoku puzzles in polytime.
- Chess or Go have massive possible state spaces. Solving a game like this is an example that goes outside NP, to the realm of EXPTIME algorithms. No modern superfast computer (or even one we could reasonable expect to develop in the near future) could solve problems like these, even if we let them run for thousands of years. Even just checking whether a move in chess is the best takes exponential time. We’re basically helpless (from a computational perspective) when it comes to problems like these.
What is “Co-NP”
Similar to NP, but instead of it being easy to check a correct solution, Co-NP problems are easy to EXCLUDE WRONG ANSWERS
Define a “search problem”.
Hint: Specify the form of the problem, and then the requirement that has to be met
Form:
Given instance T
- find a solution S for T if one exists
- output ‘NO’ if T has no solutions
Requirement (to be a search problem):
- if given an instance T and solution S, then we can verify that S is a solution to T in polytime (ie polynomial in the size |T|)
How do we show that a problem is in NP?
We show that there is a polytime algorithm for checking solutions to the problem
SAT is in NP? (T/F) Why or why not?
True. Because we can check solutions to SAT in polynomial time. There are worst case n variables to check in for each clause, and there are m clauses, so it takes O(nm) time to verify a solution, which is polynomial.
The k-Colorings problem is not in NP? (T/F) Why or why not?
False, it is in NP because we can verify solutions in polytime. All we have to do is iterate over all the edges in the graph and verify that color(u) != color(v), which takes O(m) time, ie polynomial.
MST is in NP? (T/F) Why or why not?
True, because we can verify solutions in polytime. The steps we take to prove this are as follows:
- Verify the output is of proper form (ie MST is a search problem): there will always be some tree output by MST; a ‘NO’ instance isn’t possible (although it would still be of the correct form if it was possible). So yes, the output is of the proper form.
- Verify that the output is a tree: simply run DFS/BFS and make sure that no cycles are present
- Run Kruskal’s/Prim’s algorithm to check that tree T has minimum weight, which takes polytime.
MST is not in P? (T/F) Why or why not?
False, it is in NP because we can verify solutions in polytime. The steps for this proof are:
- Verify the output is of proper form (ie MST is a search problem): there will always be some tree output by MST; a ‘NO’ instance isn’t possible (although it would still be of the correct form if it was possible). So yes, the output is of the proper form.
- We can find a tree of minimum weight in polytime using Kruskal’s or Prim’s algorithm
Knapsack is in NP? (T/F) Why or why not?
False, because we can’t verify that a solution is a maximum in polynomial time. This is because of the pseudo-polynomial nature of knapsack that we discussed in previous lectures. The budget B is a MAGNITUDE; it isn’t bounded to the input size, it can be an arbitrarily large number.
Knapsack is definitely NOT in NP? (T/F) Why or why not?
False. This may seem to contradict a previous question about whether knapsack is in NP (which is also False). We aren’t actually violating the “Law of the Excluded Middle” though; the reason the answer here is False is an epistemic problem: we simply don’t know whether knapsack is in NP or not, so we can’t conclusively say one way or the other currently.
As best as we know right now, Knapsack is not known to be in NP? (T/F)
This is True. This admits the current epistemic gap that exists, namely, that we don’t know for sure if Knapsack is outside NP.
How do we modify knapsack so that it falls under NP? What is the consequence of this modification?
We get rid of the ‘max’ operation and instead set a goal value that we want to be greater than. The consequence is that this turns the original Knapsack problem into a Search Problem, for which we DO have a polytime algorithm for checking solutions to, which makes this Knapsack Variant fall into the class NP.
If any NP-complete problem is solvable in P, then every problem in NP is solvable in P? (T/F)
True.
“Can we say anything general about when a computational complexity perspective is helpful in philosophy, and when it isn’t?”
Source:
https://arxiv.org/abs/1108.1791
Note: not necessarily important for exam, but useful information to help contextualize P vs. NP.
“Extrapolating from the examples in this essay, I would say that computational complexity tends to be helpful when we want to know whether a particular fact does any explanatory work : Sections 3.2, 3.3, 4, 6, and 7 all provided examples of this.”
Source:
“Why Philosophers Should Care About Computational Complexity”. Scott Aaronson. 2011. https://arxiv.org/abs/1108.1791
NP stands for “Non-Polynomial”? (T/F)
False. It stands for “Non-Deterministic Polynomial Time”.
The explanation in the lectures is that “non-deterministic” as used in this context means something like “allowed to guess at each step”. I like to think of it more as a “branching” of possibilities, and not committing to any single one; all that is required is that there exists >= 1 branch that is an accepting/terminating state.
P is a subset of NP? (True/False)
True. Note that this is True (although in a sort of degenerate sense) even if it turns out P = NP, because that would just mean that NP consists of the empty set.
Assuming P != NP, NP-Complete problems are the hardest problems in the class NP? (T/F)
True
What does it mean for SAT to be NP-Complete?
(a) SAT is in NP
(b) If we can solve SAT in polytime, then we can solve EVERY problem in NP in polytime, ie it would be the case that P = NP.
Let A=Colorings problem and B=SAT problem. What does the notation “A –> B” mean?
It means that we’re REDUCING A to B; ie if we can solve problem B in polytime, then we can use that algorithm to solve A in polytime.