Time Complexity P vs NP.

Presentation on theme: "Time Complexity P vs NP."— Presentation transcript:

Time Complexity P vs NP

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

Consider now all strings of length
= maximum time required to decide any string of length

TIME STRING LENGTH Max time to accept a string of length

Time Complexity Class:
All Languages decidable by a deterministic Turing Machine in time

Example: This can be decided in time

Other example problems in the same class

Examples in class:

Examples in class: CYK algorithm Matrix multiplication

Polynomial time algorithms:
constant Represents tractable algorithms: for small we can decide the result fast

It can be shown:

The Time Complexity Class
Represents: polynomial time algorithms “tractable” problems

Class CYK-algorithm Matrix multiplication

Exponential time algorithms:
Represent intractable algorithms: Some problem instances may take centuries to solve

Example: the Hamiltonian Path Problem
s t Question: is there a Hamiltonian path from s to t?

s t YES!

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

The clique problem Does there exist a clique of size 5?

The clique problem Does there exist a clique of size 5?

Example: The Satisfiability Problem
Boolean expressions in Conjunctive Normal Form: clauses Variables Question: is the expression satisfiable?

Example: Satisfiable:

Example: Not satisfiable

exponential Algorithm: search exhaustively all the possible binary values of the variables

Non-Determinism Language class: A Non-Deterministic Turing Machine
decides each string of length in time

Non-Deterministic Polynomial time algorithms:

The class Non-Deterministic Polynomial time

Example: The satisfiability problem Non-Deterministic algorithm: Guess an assignment of the variables Check if this is a satisfying assignment

Time for variables: Guess an assignment of the variables Check if this is a satisfying assignment Total time:

The satisfiability problem is an - Problem

Observation: Deterministic Polynomial Non-Deterministic Polynomial

Open Problem: WE DO NOT KNOW THE ANSWER

Open Problem: Example: Does the Satisfiability problem have a polynomial time deterministic algorithm? WE DO NOT KNOW THE ANSWER

P versus NP P versus NP (polynomial versus nondeterministic polynomial) refers to a theoretical question presented in 1971 by Leonid Levin and Stephen Cook, concerning mathematical problems that are easy to solve (P type) as opposed to problems that are difficult to solve (NP type).

Any P type problem can be solved in "polynomial time
Any P type problem can be solved in "polynomial time.“ A P type problem is a polynomial in the number of bits that it takes to describe the instance of the problem at hand. An example of a P type problem is finding the way from point A to point B on a map. An NP type problem requires vastly more time to solve than it takes to describe the problem. An example of an NP type problem is breaking a 128-bit digital cipher. The P versus NP question is important in communications, because it may ultimately determine the effectiveness (or ineffectiveness) of digital encryption methods.