Tractable & Intractable Problems: - We Will Be Looking at
Tractable & Intractable Problems: - We Will Be Looking at
• We will be looking at :
– What is a P and NP problem
– NP-Completeness
– The question of whether P=NP
– The Traveling Salesman problem again
• From what we’ve covered to date the answer is obviously no. There
are many examples of problems that cannot be solved by any computer
no matter how much time is involved
• There are also problems that can be solved, but not in time O(nk) for
any constant k
• For example, “Find the shortest path from vertex x to vertex y in a given
weighted graph”. This can be solved efficiently without much difficulty.
• No one has yet been able to find a problem that can be proven to be in NP
but not in P
• Is the set P = NP? We don’t know. If it is, then there are many efficient
algorithms out there just waiting to be discovered.
• Partition: Given a set of integers, can they be divided into two sets
whose sum is equal?
• Remember if we could find one then we could solve all the NP-Complete
problems
Approx-TSP-Tour(G, c)
- select a vertex r ∈ V[G] to be a “root” vertex
- grow a minimum spanning tree T for G from root r using MST-Prim(G,c,r)
- Let L be the list of vertices visited in a preorder tree walk of T
- return the Hamiltonian cycle H that visits the vertices in the order L
endalg
• NP-Complete problems are problems that are in NP, but which have the
added property that if one can be solved, they all can be solved