Time Complexity - PowerPoint PPT Presentation

Loading...

PPT – Time Complexity PowerPoint presentation | free to view - id: 260fea-MDU3Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Time Complexity

Description:

Question: is the expression satisfiable? (not x1 or x2) and (x1 or x3) ... Satisfiable: Example: Not satisfiable. Example: Algorithm: search exhaustively all ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 41
Provided by: imsUnist
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Time Complexity


1
Time Complexity Slides based on RPI CSCI
2400 Thanks to Costas Busch
2
Question so far
Computable? Yes or no?
This lecture Computable in reasonable
time? Goal Low time complexity
3
Consider a decidable (recursive) language
which is decided by a Turing Machine
For any string the computation
of terminates (in an accept of reject state) in a
finite amount of transitions
Accept or Reject
Time transitions followed
4

Max time to accept a string of length
5
Language class
Languages for which there is a deterministic
Turing Machine that decides each string of the
language within time
6
Language classes for 1) an 2) anbn 3)
membership problem for context free languages ?
7
Examples
8
Big-oh notation
9
Example The membership problem
for context free languages
(CYK - algorithm)
Polynomial time
10
Theorem
11
Polynomial time algorithms
For every constant
Represent tractable algorithms
For small we can compute the result fast
12
Example word w, !w!10
13
The class
for all
  • Polynomial time
  • All tractable problems

14
CYK-algorithm
15
Exponential time algorithms
Represent intractable algorithms
Some problem instances may take centuries to
solve Making computers faster doesn't help. Why?
16
Example
17
Example the Hamiltonian Path Problem
s
t
Question is there a Hamiltonian path
from s to t?
18
s
t
YES!
19
Algorithm?
20
A solution search exhaustively all paths
L ltG,s,tgt there is a Hamiltonian path
in G from s to t
Exponential time
Intractable problem
21
The clique problem
22
The clique problem Exponential
23
Example The Satisfiability Problem
Boolean expressions in Conjunctive Normal Form
Variables
Question is the expression satisfiable?
24
(not x1 or x2) and (x1 or x3) (x1 or x2) and
(not x1) and (not x2)
25
Example
Satisfiable
26
Example
Not satisfiable
27
exponential
Algorithm search exhaustively all the
possible binary values of the variables
28
Non-Determinism
Language class
A Non-Deterministic Turing Machine accepts each
string of length in time
29
Example
Non-Deterministic Algorithm to accept a string
  • Use a two-tape Turing machine
  • Guess the middle of the string
  • and copy on the second tape
  • Compare the two tapes

30
Time needed
  • Use a two-tape Turing machine
  • Guess the middle of the string
  • and copy on the second tape
  • Compare the two tapes

Total time
31
(No Transcript)
32
In a similar way we define the class
for any time function
Examples
33
Non-Deterministic Polynomial time algorithms
34
The class
for all
Non-Deterministic Polynomial time
35
The satisfiability problem
Example
Non-Deterministic algorithm
  • Guess an assignment of the variables
  • Check if this is a satisfying assignment

36
Time for variables (or length of
expression?)
  • Guess an assignment of the variables
  • Check if this is a satisfying assignment

Total time
37
The satisfiability problem is an - Problem
38
Observation
Deterministic Polynomial
Non-Deterministic Polynomial
39
Open Problem
WE DO NOT KNOW THE ANSWER
40
Open Problem
Example Does the Satisfiability problem
have a polynomial time
deterministic algorithm?
WE DO NOT KNOW THE ANSWER
About PowerShow.com