hamiltonian path problem this girl do this presentation. :) teddy bear work along with me. jeff help...

Download Hamiltonian Path Problem This girl do this presentation. :) Teddy bear work along with me. Jeff help me understand the topic. Are they both cute?

If you can't read please download the document

Upload: susan-greer

Post on 08-Jan-2018

215 views

Category:

Documents


1 download

DESCRIPTION

Step 0: DHamPath  NP Design poly-time algorithm Valid DHamPath (, P) which determines whether a path P is a Hamiltonian Path for. Therefore, DHamPath Therefore, DHamPath  NP Check if P starts at s and end at t. All nodes in G appear in P exactly once. None appear twice in P. Go through P and check if each edge of P is in the G.

TRANSCRIPT

Hamiltonian Path Problem This girl do this presentation. :) Teddy bear work along with me. Jeff help me understand the topic. Are they both cute? Hamiltonian Path Problem in a Directed Graph Given a Directed Graph G, node s and t. Given a Directed Graph G, node s and t. s t Yes Hamiltonian Path is a path from s to t and go through every node in G exactly once. DHamPath DHamPath NP-Complete Step 0: DHamPath NP Design poly-time algorithm Valid DHamPath (, P) which determines whether a path P is a Hamiltonian Path for. Therefore, DHamPath Therefore, DHamPath NP Check if P starts at s and end at t. All nodes in G appear in P exactly once. None appear twice in P. Go through P and check if each edge of P is in the G. DHamPath P easier poly DHamPath P easier NP-Complete 3SAT Step 1: What to reduce it to Step 2: What is What 3SAT Problem: Given an expression E: Does it have a satisfying assignment ? DHamPath: Given a directed graph G, s and t: Does it have a Hamiltonian Path from s to t? s t (x OR y OR z) AND (x OR w OR a) AND Given an oracle for DHAMPath, how can we solve 3SAT? Step 3: Direction of reduction & Code 3SAT( Expression ) = DHAMPATH( ) Step5 Oracle will do it for us Step 6 & 7 Step 8 & 9 Step 5: Instance Map Expression Suppose we have K variables and L clauses in the expression. From C 1 to C L in Expression From left to right in the diamond. For each clause C j, Use a pair of two adjacent nodes to represent it.... For each variable x i, we construct a variable diamond x i. Clause iClause i+1 xixi Step 5: Instance Map Between each clause C j, use one spearator node to separate them.... xixi Step 5: Instance Map xixi Since we have L clauses, we have 3L+1 nodes.... Step 5: Instance Map If wed like to go through all nodes in variable diamond Xi EXACTLY ONCE. xixi... ONLY TWO WAYS. Step 5: Instance Map We have K variable diamonds . x i+1 x i-1 xixi... For each clause Ci, AND (x OR w OR a) AND Step 5: Instance Map CiCi a CiCi... W x we use one node. Step 3: Direction of reduction & Code 3SAT( Expression ) = DHAMPATH( ) Step5 Oracle will do it for us Step 6 & 7 Step 8 & 9 Step 6: Solution Map Sol 3sat = SolutionMap( Sol DHam )... Xi True Xi False In variable diamond X i, Step 3: Direction of reduction & Code 3SAT( Expression ) = DHAMPATH( ) Step5 Oracle will do it for us Step 6 & 7 Step 8 & 9 Step 7: Valid to Valid Prove:A valid Sol DHam Sol 3sat is valid. Expression Yes That is, if we have a Hamiltonian Path, the expression will be true according to the mapping of variables. If we have a Hamiltonian Path, it must go through every node once. So, it must go through every node in every variable diamond X i. xixi... Step 7: Valid to Valid We have K diamonds .... Step 7: Valid to Valid Hamiltonian Path must go through each clause node Ci AND (x OR w OR a) AND CiCi a CiCi... W x Step 7: Valid to Valid We cannot have a Hamiltonian Path like that AND (x OR w OR a) AND CiCi a CiCi... W x Step 7: Valid to Valid If we have Hamiltonian Path like that:... CiCi Step 7: Valid to Valid ... CiCi Step 7: Valid to Valid If we have Hamiltonian Path like that: If there is a Hamiltonian Path, every clause nodes will belong to either one of two cases:... CiCi CiCi Step 7: Valid to Valid X i = True. xjxj xixi... AND (x i OR w OR a) AND X j = False. CiCi... AND ( b OR x j OR a) AND CiCi Step 3: Direction of reduction & Code 3SAT( Expression ) = DHAMPATH( ) Step5 Oracle will do it for us Step 6 & 7 Step 8 & 9 Sol DHam Sol 3sat Expression Yes If there is a satisfiable assignment, we will have a Hamiltonian Path in. Step 8 & 9: Reverse Solution Map If there is a satisfiable assignment, For each variable diamond Xi, Step 8 & 9: Reverse Solution Map... X i = True. xjxj X j = False.... We have K variables. Go through them one by one from top to bottom. It is a Hamiltonian Path. For each clause Ci,... AND (x OR w OR a) AND Step 8 & 9: Reverse Solution Map at least one variable make it true. Choose one. Step 8 & 9: Reverse Solution Map... CiCi CiCi... AND (x OR w OR a) AND a x w Step 3: Direction of reduction & Code 3SAT( Expression ) = DHAMPATH( ) Step5 Oracle will do it for us Step 6 & 7 Step 8 & 9 Question?