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

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
Advertisements

NP-Hard Nattee Niparnan.
Max Cut Problem Daniel Natapov.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
NP-Completeness: Reductions
An NP-completeness Example. The graph CLIQUE problem Undirected Graph G = (V, E) –a clique is a complete subgraph of G Subset V’ of vertices that are.
NP and NP Complete. Definitions A problem is in the class P if there is a polynomial time solution to the problem A problem is in the class NP if there.
Department of Computer Science & Engineering
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Reduction Techniques Restriction Local Replacement Component Design Examples.
The Theory of NP-Completeness
CHAPTER 10 P and NP. Algorithm Crossword Puzzle This algorithm solves a crossword puzzle, represented by a Boolean matrix D[i,j], 1 = i,j = n,
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
1 1. Draw the machine schema for a TM which when started with input 001 halts with abbb on the tape in our standard input format. 2. Suppose you have an.
Lecture 22 More NPC problems
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Additional NP-complete problems
5.2: Solving Systems of Equations using Substitution
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
The Theory of NP-Completeness
More NP-Complete and NP-hard Problems
Richard Anderson Lecture 26 NP-Completeness
UNIT III DYNAMIC PROGRAMMING ALGORITHMS
More NP-complete Problems
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
CS21 Decidability and Tractability
Objectives Identify solutions of linear equations in two variables.
The Theory of NP-Completeness
Lecture 24 Classical NP-hard Problems
Lecture 23 NP-Hard Problems
Presentation 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 we’d 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?