340 likes | 576 Views
Time Complexity. Consider a deterministic Turing Machine which decides a language . For any string the computation of terminates in a finite amount of transitions. Initial state. Accept or Reject. Decision Time = #transitions. Initial state. Accept or Reject.
E N D
Time Complexity Prof. Busch - LSU
Consider a deterministic Turing Machine which decides a language Prof. Busch - LSU
For any string the computation of terminates in a finite amount of transitions Initial state Accept or Reject Prof. Busch - LSU
Decision Time = #transitions Initial state Accept or Reject Prof. Busch - LSU
Consider now all strings of length = maximum time required to decide any string of length Prof. Busch - LSU
TIME STRING LENGTH Max time to accept a string of length Prof. Busch - LSU
Time Complexity Class: All Languages decidable by a deterministic Turing Machine in time Prof. Busch - LSU
Example: This can be decided in time Prof. Busch - LSU
Other example problems in the same class Prof. Busch - LSU
Examples in class: Prof. Busch - LSU
Examples in class: CYK algorithm Matrix multiplication Prof. Busch - LSU
Polynomial time algorithms: constant Represents tractable algorithms: for small we can decide the result fast Prof. Busch - LSU
It can be shown: Prof. Busch - LSU
The Time Complexity Class Represents: • polynomial time algorithms • “tractable” problems Prof. Busch - LSU
Class CYK-algorithm Matrix multiplication Prof. Busch - LSU
Exponential time algorithms: Represent intractable algorithms: Some problem instances may take centuries to solve Prof. Busch - LSU
Example: the Hamiltonian Path Problem s t Question: is there a Hamiltonian path from s to t? Prof. Busch - LSU
s t YES! Prof. Busch - LSU
A solution: search exhaustively all paths L = {<G,s,t>: there is a Hamiltonian path in G from s to t} Exponential time Intractable problem Prof. Busch - LSU
The clique problem Does there exist a clique of size 5? Prof. Busch - LSU
The clique problem Does there exist a clique of size 5? Prof. Busch - LSU
Example: The Satisfiability Problem Boolean expressions in Conjunctive Normal Form: clauses Variables Question: is the expression satisfiable? Prof. Busch - LSU
Example: Satisfiable: Prof. Busch - LSU
Example: Not satisfiable Prof. Busch - LSU
exponential Algorithm: search exhaustively all the possible binary values of the variables Prof. Busch - LSU
Non-Determinism Language class: A Non-Deterministic Turing Machine decides each string of length in time Prof. Busch - LSU
Non-Deterministic Polynomial time algorithms: Prof. Busch - LSU
The class Non-Deterministic Polynomial time Prof. Busch - LSU
The satisfiability problem Example: Non-Deterministic algorithm: • Guess an assignment of the variables • Check if this is a satisfying assignment Prof. Busch - LSU
Time for variables: • Guess an assignment of the variables • Check if this is a satisfying assignment Total time: Prof. Busch - LSU
The satisfiability problem is an - Problem Prof. Busch - LSU
Observation: Deterministic Polynomial Non-Deterministic Polynomial Prof. Busch - LSU
Open Problem: WE DO NOT KNOW THE ANSWER Prof. Busch - LSU
Open Problem: Example: Does the Satisfiability problem have a polynomial time deterministic algorithm? WE DO NOT KNOW THE ANSWER Prof. Busch - LSU