# fall 2006costas busch - rpi1 time complexity. fall 2006costas busch - rpi2 consider a deterministic...

Post on 29-Mar-2015

216 views

Category:

## Documents

Tags:

• #### costas busch rpi31

Embed Size (px)

TRANSCRIPT

• Slide 1

Fall 2006Costas Busch - RPI1 Time Complexity Slide 2 Fall 2006Costas Busch - RPI2 Consider a deterministic Turing Machine which decides a language Slide 3 Fall 2006Costas Busch - RPI3 For any string the computation of terminates in a finite amount of transitions Accept or Reject Initial state Slide 4 Fall 2006Costas Busch - RPI4 Accept or Reject Decision Time = #transitions Initial state Slide 5 Fall 2006Costas Busch - RPI5 Consider now all strings of length = maximum time required to decide any string of length Slide 6 Fall 2006Costas Busch - RPI6 Max time to accept a string of length STRING LENGTH TIME Slide 7 Fall 2006Costas Busch - RPI7 Time Complexity Class: All Languages decidable by a deterministic Turing Machine in time Slide 8 Fall 2006Costas Busch - RPI8 Example: This can be decided in time Slide 9 Fall 2006Costas Busch - RPI9 Other example problems in the same class Slide 10 Fall 2006Costas Busch - RPI10 Examples in class: Slide 11 Fall 2006Costas Busch - RPI11 Examples in class: CYK algorithm Matrix multiplication Slide 12 Fall 2006Costas Busch - RPI12 Polynomial time algorithms: Represents tractable algorithms: for small we can decide the result fast constant Slide 13 Fall 2006Costas Busch - RPI13 It can be shown: Slide 14 Fall 2006Costas Busch - RPI14 The Time Complexity Class tractable problems polynomial time algorithms Represents: Slide 15 Fall 2006Costas Busch - RPI15 CYK-algorithm Class Matrix multiplication Slide 16 Fall 2006Costas Busch - RPI16 Exponential time algorithms: Represent intractable algorithms: Some problem instances may take centuries to solve Slide 17 Fall 2006Costas Busch - RPI17 Example: the Hamiltonian Path Problem Question: is there a Hamiltonian path from s to t? s t Slide 18 Fall 2006Costas Busch - RPI18 s t YES! Slide 19 Fall 2006Costas Busch - RPI19 Exponential time Intractable problem A solution: search exhaustively all paths L = { : there is a Hamiltonian path in G from s to t} Slide 20 Fall 2006Costas Busch - RPI20 The clique problem Does there exist a clique of size 5? Slide 21 Fall 2006Costas Busch - RPI21 The clique problem Does there exist a clique of size 5? Slide 22 Fall 2006Costas Busch - RPI22 Example: The Satisfiability Problem Boolean expressions in Conjunctive Normal Form: Variables Question: is the expression satisfiable? clauses Slide 23 Fall 2006Costas Busch - RPI23 Satisfiable: Example: Slide 24 Fall 2006Costas Busch - RPI24 Not satisfiable Example: Slide 25 Fall 2006Costas Busch - RPI25 Algorithm: search exhaustively all the possible binary values of the variables exponential Slide 26 Fall 2006Costas Busch - RPI26 Non-Determinism Language class: A Non-Deterministic Turing Machine decides each string of length in time Slide 27 Fall 2006Costas Busch - RPI27 Non-Deterministic Polynomial time algorithms: Slide 28 Fall 2006Costas Busch - RPI28 The class Non-Deterministic Polynomial time Slide 29 Fall 2006Costas Busch - RPI29 Example: The satisfiability problem Non-Deterministic algorithm: Guess an assignment of the variables Check if this is a satisfying assignment Slide 30 Fall 2006Costas Busch - RPI30 Time for variables: Total time: Guess an assignment of the variables Check if this is a satisfying assignment Slide 31 Fall 2006Costas Busch - RPI31 The satisfiability problem is an - Problem Slide 32 Fall 2006Costas Busch - RPI32 Observation: Deterministic Polynomial Non-Deterministic Polynomial Slide 33 Fall 2006Costas Busch - RPI33 Open Problem: WE DO NOT KNOW THE ANSWER Slide 34 Fall 2006Costas Busch - RPI34 Example: Does the Satisfiability problem have a polynomial time deterministic algorithm? WE DO NOT KNOW THE ANSWER Open Problem:

Recommended