Directed Undirected Ham. Cycle规约到Undirected Ham. Cycle.pptVIP

  • 4
  • 0
  • 约3.41千字
  • 约 12页
  • 2017-07-03 发布于湖北
  • 举报

Directed Undirected Ham. Cycle规约到Undirected Ham. Cycle.ppt

DirectedUndirectedHam.Cycle规约到UndirectedHam.Cycle概要1

CS 332: Algorithms NP Completeness Continued: Reductions Homework 7 Check the web later today… Change in grading policy: drop lowest hw Review: P And NP Summary P = set of problems that can be solved in polynomial time NP = set of problems for which a solution can be verified in polynomial time P ? NP Open question: Does P = NP? Review: Reduction A problem P can be reduced to another problem Q if any instance of P can be rephrased to an instance of Q, the solution to which provides a solution to the instance of P This rephrasing is called a transformation Intuitively: If P reduces in polynomial time to Q, P is “no harder to solve” than Q Review: NP-Hard and NP-Complete If P is polynomial-time reducible to Q, we denote this P ?p Q Definition of NP-Hard and NP-Complete: If all problems R ? NP are reducible to P, then P is NP-Hard We say P is NP-Complete if P is NP-Hard and P ? NP If P ?p Q and P is NP-Complete, Q is also NP- Complete Review: Proving NP-Completeness What steps do we have to take to prove a problem Q is NP-Complete? Pick a known NP-Complete problem P Reduce P to Q Describe a transformation that maps instances of P to instances of Q, s.t. “yes” for Q = “yes” for P Prove the transformation works Prove it runs in polynomial time Oh yeah, prove Q ? NP (What if you can’t?) Directed Hamiltonian Cycle ? Undirected Hamiltonian Cycle What was the hamiltonian cycle problem again? For my next trick, I will reduce the directed hamiltonian cycle problem to the undirected hamiltonian cycle problem before your eyes Which variant am I proving NP-Complete? Draw a directed example on the board What transformation do I need to effect? Transformation: Directed ? Undirected Ham. Cycle Transform graph G = (V, E) into G’ = (V’, E’): Every vertex v in V transforms into 3 vertices v1, v2, v3 in V’ with edges (v1,v2) and (v2,v3) in E’ Every directed edge (v, w) in E transforms into the undirected edge (v3, w1) in E’ (draw it) Can this be implemented in polynomial time? Argu

文档评论(0)

1亿VIP精品文档

相关文档