Professional Documents
Culture Documents
TM to
TM to reduce solve B
A to B
TM that solves A
This does not mean that either HCP or TSP can be solved in p-time in
the general case: but it does mean that a fast (p-time ) solution to
TSP would facilitate a fast solution to HCP too.
TSP and HCP are in NP-complete:
each NP-complete problem reduces to all the others:
fi a p-time solution to any NP-complete problem
would give a p-time solution to all the others
Computability and Complexity
Lecture 18 (so putting them all into P)
Computability and Complexity
≤ is a pre-order
1. ≤ is reflexive: A ≤ A
so if w is a yes-instance of A
fi fX(w) is a yes-instance of A
if w is a no-instance of A
fi fX(w) is a no-instance of A.
fi X reduces A to A.
2. ≤ is transitive
suppose A ≤B and B ≤ C,
A, B, C all yes-no problems
Prove A ≤ C.
X*Y is a deterministic TM which reduces A to C output
fY(fX(w))
X*Y
(input word:
instance of A) mark return
w sq. 0 X to sq. 0 Y instance
of C
(input word:
instance of A) mark return
w sq. 0 X to sq. 0 N
(input word:
instance of A) mark return
w sq. 0 X to sq. 0 M
X if M accepts w return
output w1
to sq 0
Mark
sq 0 M'
if M rejects w return
output w2
to sq 0