Title: Time Complexity
1Time Complexity
2Consider a deterministic Turing Machine which
decides a language
3For any string the computation
of terminates in a finite amount of transitions
Initial state
Accept or Reject
4Decision Time transitions
Initial state
Accept or Reject
5Consider now all strings of length
maximum time required to decide any string
of length
6TIME
STRING LENGTH
Max time to accept a string of length
7Time Complexity Class
All Languages decidable by a deterministic Turing
Machine in time
8Example
This can be decided in time
9Other example problems in the same class
10Examples in class
11Examples in class
CYK algorithm
Matrix multiplication
12Polynomial time algorithms
constant
Represents tractable algorithms
for small we can decide the result fast
13It can be shown
14The Time Complexity Class
Represents
- polynomial time algorithms
15Class
CYK-algorithm
Matrix multiplication
16Exponential time algorithms
Represent intractable algorithms
Some problem instances may take centuries to solve
17Example the Hamiltonian Path Problem
s
t
Question is there a Hamiltonian path
from s to t?
18s
t
YES!
19A solution search exhaustively all paths
L ltG,s,tgt there is a Hamiltonian path
in G from s to t
Exponential time
Intractable problem
20The clique problem
Does there exist a clique of size 5?
21The clique problem
Does there exist a clique of size 5?
22Example The Satisfiability Problem
Boolean expressions in Conjunctive Normal Form
clauses
Variables
Question is the expression satisfiable?
23Example
Satisfiable
24Example
Not satisfiable
25exponential
Algorithm search exhaustively all the
possible binary values of the variables
26Non-Determinism
Language class
A Non-Deterministic Turing Machine decides each
string of length in time
27Non-Deterministic Polynomial time algorithms
28The class
Non-Deterministic Polynomial time
29The satisfiability problem
Example
Non-Deterministic algorithm
- Guess an assignment of the variables
- Check if this is a satisfying assignment
30Time for variables
- Guess an assignment of the variables
- Check if this is a satisfying assignment
Total time
31The satisfiability problem is an - Problem
32Observation
Deterministic Polynomial
Non-Deterministic Polynomial
33Open Problem
WE DO NOT KNOW THE ANSWER
34Open Problem
Example Does the Satisfiability problem
have a polynomial time
deterministic algorithm?
WE DO NOT KNOW THE ANSWER