1.0 - Complexity Class P

1.1 - Polynomial-Time Reduction Algorithm

Problem A is polynomial-time reducible to B if there exists a polynomial-time reduction algorithm to transform every instance α\alpha of AA into an instance β\beta of BB

2.0 - Complexity Class NP

2.1 - P=NP

2.2 - Example of an NP Problem - TSP

check-tsp(G, S, k) 1. Check that every vertex is in S exactly once. 2. Check that every pair of adjacent vertices is in S is conncted by an edge in G 3. Check that there is an edge from the last vertex to the first 4. Sum weights of all such edges, and call the total t 5. return t <= k

2.3 - Progress with P=NP (NP-Hard)

2.4 - NP-Complete

2.5 - NP Recap

2.5.1 - NP-Complete and Cook’s Theorem

2.4.2 - CircuitSAT (Circuit Satisfiability)

  1. Step 1 is polynomial time and applies to all problems in NP (from Cook’s theorem)
  2. Hence if Step 2 is also polynomial time, all problems in NP can be solved in polynomial time (Including those in NP-Complete)

2.6 - Reductions

💡 Using Cook’s Theorem as an intermediate to find a reduction from any NP problem to your problem - we already have a reduction from all problems to CircuitSAT, so just need to find a reduction from circuit sat to our problem.

2.7 - Travelling Salesman Problem - NP Completeness

2.7.1 - TSP - Reduction from Hamiltonian Cycle to TSP

As mentioned above, we perform this step to prove that the TSP problem is NP Hard.

Recall

3.0 - Recap

3.1 - Approximation Algorithms

💡 This algorithm, at worst is twice the cost of the optimal solution

approx-tsp-tour(G, c) 1. select a vertex r in G.V to be a root vertex 2. Compute a minimum spanning tree T for G from root r using MST-Prim(G, c, r) 3. Let L be the list of vertices visited in preorder tree walk of T 4. Return the Hamiltonian cycle H that visits the vertices in order of L

(b) is the minimum spanning tree for the graph - upper bound on the cost of the tour

(c) pre-order traversal of MST

Tour (d) is that returned by approximate-tsp-tour with cost of 19.074 - this is the tour generated by a pre-order traversal of the MST

Tour (e) is an optimal tour, with cost 14.715