6: P and NP Reductions Flashcards

1
Q

What is verification?

A

Checking that a proposed solution to a problem is correct.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the prime factorisation problem? Why is it significant?

A

Finding the prime factors (i.e. factors that are prime numbers - have not factors themselves) of a given number. It is the basis of cryptographic systems such as RSA which assume there is no “fast” - polynomial algorithm to solve it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a graph clique?

A

A graph is a clique of size n if it has n nodes and edges connecting each possible pairing of the n nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a subgraph?

A

A graph whose nodes and edges are subsets of another parent graph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a clique problem?

A

Finding if a graph contains a subgraph that is a clique of a certain size. Can also be verifying a certificate that this is the case for a given subgraph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a satisfiability problem?

A

Given a logical formula, can we assign T/F values to the variables in it such that the value of the whole formula becomes true?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is CNF? What is its structure?

A

Conjunctive Normal Form is a set of rules for standardising logical formulae. It compromises of literals, variables or negated variables, disjointed (ORed) in clauses, which are in turned conjoined (ANDed) together to form the whole formula.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are SAT problems?

A

Satisfiability problems given in CNF format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does P = NP boil down to?

A

If there are problems that are solvable in polynomial time nondeterministically (and sometimes verifiable in polynomial time deterministically) that cannot be solved within polynomial time deterministically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are reductions? What are reductions aka?

A

Using an algorithm for one problem as a subroutine to solve another problem, especially if done to improve the time complexity of doing so, often aiming to reduce it to polynomial time. Reductions are aka transformations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Cook’s Theorem?

A

The Cook–Levin theorem states that SAT (the Boolean Satisfiability problem) is NP-complete.

NP-completeness means that any other problem in NP can be reduced to it, so allows easier proving that other problems are in NP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are 3-SAT problems?

A

SAT Problems are satisfiability problems given in CNF format. 3-SAT problems are further restricted SAT problems such that clauses may hold no more than 3 literals. You can also define k-SAT for any such maximum number of k literals per clause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you transform SAT problems to 3-SAT problems?

A

Split up each clause with more than 3 literals in by repeatedly taking the first 2 literals from it, and placing them in a new clause. Then add a new literal (to the whole expression) in the new clause and its negated form is added to the original clause to replace the 2 literals removed. By repeating this iteratively for each clause in the SAT problem, you can sure each clause has 3 or fewer literals in it, enforcing 3-SAT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are polynomial Karp reductions?

A

Karp reductions change a problem into an instance of another one within polynomial time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are polynomial Turing/Cook reductions?

A

Turing reductions use one problem as a subroutine ( ~ oracle) to solve another one, being called at most a polynomial amount of times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between Karp and Turing/Cook polynomial reductions?

A

Cook/Turing reductions relate the computability of problems (i.e. if A is computable [in polynomial time] then so is B), whereas Karp reductions are more about relating the fundamental structure of problems (i.e. Problem A can be “presented” as a case of Problem B).

Karp reductions change a problem into an instance of another one and Turing reductions use one problem as a subroutine (~ oracle) to solve another one, being called at most a polynomial amount of times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you prove a problem is in P?

A

Provide a proof that it is deterministically solvable within polynomial time - usually just an algorithm to do so.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How do you prove a problem is in NP?

A

Provide a proof that it is nondeterministically solvable within polynomial time - a certificate to get precomputed output that must, in turn, be checkable within polynomial time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How do you prove a problem is in NP-complete?

A

Prove that the problem is in NP, and then that any problem in NP can be reduced/transformed to it (in practice only need to show 1 problem can be transformed into it since, in turn, all others must be able to transform into that 1 problem).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you prove a problem is in NP-hard?

A

Show a problem is in both NP and NP-complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the Cook-Levin theorem state? What is its significance?

A

SAT is NP-complete. SAT was the first problem proven to be NP-complete, and seeing if it can be reduced to other problems the allowed for easy checking if other problems are also NP-complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the proof for the Cook-Levin theorem?

A

Roughly:

Guess a random assignment to variables and then check each clause is true. In other words, a linear-time nondeterministic algorithm.

Alternatively, a linear-length certificate (assignment).

23
Q

?? missing part of lecture slides

A

??

24
Q

?? missing part of lecture slides

A

??

25
Q

?? missing part of lecture slides

A

??

26
Q

?? missing part of lecture slides

A

??

27
Q

?? missing part of lecture slides

A

??

28
Q

?? missing part of lecture slides

A

??

29
Q

What are graph-colouring problems? How are they notated?

A

Finding whether a colour can be assigned to each node in a graph such that two adjacent nodes (attached with an edge) are never the same colour, for a given graph and number of unique colours.

30
Q

Under how many colours are graph-colouring problems “difficult”?

A

Any planar graph can be coloured with 4 colours, and finding whether any planar graph can be coloured with 2 colours is polynomial.

Finding whether a planar graph is colourable with 3 colours is NP-complete.

31
Q

How do you transform from k-COL to SAT problems?

A

There will be (k * n) variables, where k = the number of colours in the k-COL problem, and n = the number of nodes in the k-COL problem.

  1. An at-least-one clause is introduced for each node in the k-COL problem, containing k literals, that enforces that each the node must have at least one colour, the colours being represented by the k literals.
  2. An at-most-one clause is added for each node and unique pair of (different) colours that enforces that the node can’t be both colours, represented by 2 literals.
  3. Edge clauses are added for each pair of adjacent nodes and each colour j, that enforces that both nodes cannot simultaneously be the same colour, represented by the 2 literals in the clause.
32
Q

How do you transform from 3-SAT to k-COL problems?

A

Create n x nodes, n ¬x nodes, n y nodes, and k C nodes, where n = the number of variables in the 3-SAT problem and k = the number of clauses in the 3-SAT problem.

Each xi node is connected to each ¬xi; each y node is connected to every other y node; each node yi is connected to each xj and ¬xj for all j != i; each Ci node is connected to each x or ¬x literal not in the equivalent ith clause in the input 3-SAT problem. The number of colours in the resultant k-COL problem is the number of variables in the input 3-SAT problem + 1.

33
Q

How do you transform from SAT to clique problems?

A

Add a vertex for each literal in each clause. Connect all vertices to all others in the resulting graph, except for those in the same clause or of the same value (whether or not one or both are negated) as the original SAT literal the vertex represents.

34
Q

What is a vertex cover problem?

A

To find minimum size vertex cover, given an undirected graph. A vertex cover of an undirected graph is a subset of its vertices such that for every edge (u, v) of the graph, either ‘u’ or ‘v’ is in the vertex cover.

35
Q

How do you transform from clique to vertex cover problems?

A

Convert the graph in the clique problem to have the same vertices but edges only where the original graph does not. The clique area on the new graph will be a vertex cover, and vice versa for the opposite transformation. The original graph will have a clique size of at least k if and only if the altered graph has a vertex cover of the size ≤ the number of vertices - k, where k = the minimum size of the clique.

36
Q

What is a Hamiltonian Circuit?

A

A route which visits every vertex once, without using an edge more than once, and returns to its starting point.

37
Q

What are Hamiltonian Circuit problems?

A

Finding whether a given graph contains a Hamiltonian circuit.

38
Q

What is an undirected graph?

A

All edges are bidirectional: you can go either way along them. When directed you may only move along edges in 1 direction.

39
Q

How do you transform from vertex cover to undirected Hamiltonian Circuit problems?

A

Put all the edges at vertex v in G into order, say (v, w1), …, (v, wd).
• In GH, link each ai to vw1,1, vw1,6 to vw2,1, and so on, and vwd,6 is linked to all the ai.
• Now, a Hamiltonian circuit of GH must go through all the ai, and so we can split it up into k pieces.
• Each piece must start at ai, then to some vw1,1 and end at vwd,6. We call v (a vertex in G) the key vertex of that piece.
• The piece will visit all the vwi on the way. It may also visit some of the wvi (provided v,w is an edge).
• Now, since every vertex of GH is visited, every edge e of G must be connected to one of the key vertices, which therefore form a vertex cover.

40
Q

How do you transform from undirected Hamiltonian Circuit (UHC) problems into directed Hamiltonian Circuit (DHC) problems?

A

Given an undirected graph, replace every edge (v,w) with 2 new edges: (v, w) and (w, v). The resulting directed graph will have a Hamiltonian Circuit if and only if the original undirected graph did.

41
Q

What does NSPACE mean?

A

NSPACE is the space used by a nondeterministic (Turing) machine to solve a certain problem.

42
Q

What does DSPACE mean?

A

NSPACE is the space used by a deterministic (Turing) machine to solve a certain problem.

43
Q

What does Savitch’s theorem state?

A

NSPACE is a subset of (less than or equal to) DSPACE: if an NTM can decide a problem in f(n) space, a DTM can in [f(n)]^2 space: the same amount squared. The speedup given is, therefore, much less than exponential.

44
Q

What is the proof for Savitch’s theorem?

A

??

45
Q

What are Directed Graph Reachability problems?

A

Finding if there is a path along edges between given end nodes on a given graph.

46
Q

?? missing part of lecture slides

A

??

47
Q

?? missing part of lecture slides

A

??

48
Q

?? missing part of lecture slides

A

??

49
Q

?? missing part of lecture slides

A

??

50
Q

?? missing part of lecture slides

A

??

51
Q

?? missing part of lecture slides

A

??

52
Q

?? missing part of lecture slides

A

??

53
Q

What is a graph clique? What is a clique problem?

A

A clique is a subset of a graph that is fully connected, i.e. all distinct pairs of nodes in it are adjacent. A clique problem is finding whether a clique of a set size exists in a given graph.