Costas Busch - LSU1 Time Complexity
Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language
Costas Busch - LSU3 For any string the computation of terminates in a finite amount of transitions Accept or Reject Initial state
Costas Busch - LSU4 Accept or Reject Decision Time = #transitions Initial state
Costas Busch - LSU5 Consider now all strings of length = maximum time required to decide any string of length
Costas Busch - LSU6 Max time to accept a string of length STRING LENGTH TIME
Costas Busch - LSU7 Time Complexity Class: All Languages decidable by a deterministic Turing Machine in time
Costas Busch - LSU8 Example: This can be decided in time
Costas Busch - LSU9 Other example problems in the same class
Costas Busch - LSU10 Examples in class:
Costas Busch - LSU11 Examples in class: CYK algorithm Matrix multiplication
Costas Busch - LSU12 Polynomial time algorithms: Represents tractable algorithms: for small we can decide the result fast constant
Costas Busch - LSU13 It can be shown:
Costas Busch - LSU14 The Time Complexity Class “tractable” problems polynomial time algorithms Represents:
Costas Busch - LSU15 CYK-algorithm Class Matrix multiplication
Costas Busch - LSU16 Exponential time algorithms: Represent intractable algorithms: Some problem instances may take centuries to solve
Costas Busch - LSU17 Example: the Hamiltonian Path Problem Question: is there a Hamiltonian path from s to t? s t
Costas Busch - LSU18 s t YES!
Costas Busch - LSU19 Exponential time Intractable problem A solution: search exhaustively all paths L = { : there is a Hamiltonian path in G from s to t}
Costas Busch - LSU20 The clique problem Does there exist a clique of size 5?
Costas Busch - LSU21 The clique problem Does there exist a clique of size 5?
Costas Busch - LSU22 Example: The Satisfiability Problem Boolean expressions in Conjunctive Normal Form: Variables Question: is the expression satisfiable? clauses
Costas Busch - LSU23 Satisfiable: Example:
Costas Busch - LSU24 Not satisfiable Example:
Costas Busch - LSU25 Algorithm: search exhaustively all the possible binary values of the variables exponential
Costas Busch - LSU26 Non-Determinism Language class: A Non-Deterministic Turing Machine decides each string of length in time
Costas Busch - LSU27 … … … … accept reject (deepest leaf) depth All computations of on string
Costas Busch - LSU28 Non-Deterministic Polynomial time algorithms:
Costas Busch - LSU29 The class Non-Deterministic Polynomial time
Costas Busch - LSU30 Example: The satisfiability problem Non-Deterministic algorithm: Guess an assignment of the variables Check if this is a satisfying assignment
Costas Busch - LSU31 Time for variables: Total time: Guess an assignment of the variables Check if this is a satisfying assignment
Costas Busch - LSU32 The satisfiability problem is a - Problem
Costas Busch - LSU33 Observation: Deterministic Polynomial Non-Deterministic Polynomial
Costas Busch - LSU34 Open Problem: WE DO NOT KNOW THE ANSWER
Costas Busch - LSU35 Example: Does the Satisfiability problem have a polynomial time deterministic algorithm? WE DO NOT KNOW THE ANSWER Open Problem: