Applied Computer Science II Chapter 7: Time Complexity Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.

Slides:



Advertisements
Similar presentations
Applied Computer Science II Chapter 4: Decidability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Advertisements

1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Applied Computer Science II Chapter 3 : Turing Machines Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Applied Computer Science II Chapter 1 : Regular Languages Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Applied Computer Science II Chapter : Grammars Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
NP-Complete Problems Problems in Computer Science are classified into
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Applied Computer Science II Chapter 5: Reducability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
Time Complexity.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
MCS312: NP-completeness and Approximation Algorithms
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSCI 2670 Introduction to Theory of Computing November 23, 2004.
The class P Section 7.2 CSC 4170 Theory of Computation.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
LIMITATIONS OF ALGORITHM POWER
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CSE 105 theory of computation
CSC 4170 Theory of Computation The class P Section 7.2.
CSC 4170 Theory of Computation The class P Section 7.2.
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
CLASSES P AND NP.
Chapter 11 Limitations of Algorithm Power
CSC 4170 Theory of Computation The class NP Section 7.3.
Theory of Computability
Time Complexity Classes
CSC 4170 Theory of Computation The class NP Section 7.3.
CSE 105 theory of computation
Theory of Computability
Theory of Computability
Presentation transcript:

Applied Computer Science II Chapter 7: Time Complexity Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Overview Measuring complexity The class P The class NP NP-completeness Additional NP-complete problems

Measuring complexity How much time needed to decide a language Use Machine M1

Measuring complexity Worst-case versus average-case We typically use big-O and small-o notation (cf. ACS I); asymptotic analysis

Big-O

Small-o

Time Complexity

Analyzing algorithms

2-tape machine

Complexity relationship among models

Definition 7.9 including figure 7.1

Differences in models Polynomial difference between single- and multiple tape deterministic TM Exponential difference between deterministic and non-deterministic TM Compare exponential versus polynomial behaviour !

Towards the class P Distinction between : Exponential algorithms –Brute force search –Impractical Polynomial –Practical –Robust for reasonable models of computation (I.e. polynomially equivalent) Here, we ignore differences between, e.g., level of abstraction

P is invariant for all models of computation that are polynomially equivalent to a single tape deterministic TM P roughly corresponds to the class of problems that are realistically solvable on a computer

Conventions High-level descriptions of algorithms Abstraction of specific model used (as long as polynomially equivalent) Algorithms proceed in numbered stages Analysis in two steps : –A polynomial bound on the number of stages –Each stage can be implemented in polynomial time on deterministic single tape TM (or poly. Equivalent model)

Conventions Encoding method for problems We use notation as before Reasonable methods require encoding and decoding of objects into other (internal ?) representation to require polynomial time. E.g (unreasonable) instead of 9 (or other base k-notation)

Encoding Graphs Option 1 : –List of nodes –List of edges Option 2 : –Adjacency matrix

Figure 7.2

Insert algorithm

Towards the class NP

HAMPATH Easy to obtain exponential time algorithm : –Generate all paths of length m (no. of nodes) and check whether they are hamiltonian Polynomial verifiability : –Checking whether a given path is hamiltonian can be done in polynomial time Verifying existence of hamiltonian path is easier than determining the existence Consider also Similar for COMPOSITES

The class NP

NTM for HAMPATH Algorithm

Proof

P versus NP

P= the class of languages where membership can be decided quickly NP=the class of languages where membership can be verified quickly NP-complete problems : if a polynomial time (determ.) algorithm exists for one NP-complete problem, then P=NP

Polynomial time reducibility Fig 7.6

Proof: N works in polynomial time

Fig 7.7

NP-completeness

Set Covering

BinPacking

Traveling Salesman Problem

Coloring

Key Reductions SAT 3SAT SetCoverClique VertexCover SubsetSum Partition BinPacking Hampath UHampath TSP Coloring

Conclusions The class P The class NP NP-completeness(e.g. 3SAT) Polynomial time reductions Two further classes : –coNP : –NP-hard:

Standard Reference Garey and Johson, Computers and Intractability – A guide to the theory of NP- completeness, W.H.Freeman, 1979.