CAD Algorithms. P and NP

Similar documents
Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

The Classes P and NP

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Tutorial 8. NP-Complete Problems

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Lecture 7: NP-Complete Problems

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

CSC 373: Algorithm Design and Analysis Lecture 16

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

The Classes P and NP. mohamed@elwakil.net

Quantum and Non-deterministic computers facing NP-completeness

Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

On the Relationship between Classes P and NP

A Working Knowledge of Computational Complexity for an Optimizer

Why? A central concept in Computer Science. Algorithms are ubiquitous.

OHJ-2306 Introduction to Theoretical Computer Science, Fall

Introduction to Algorithms. Part 3: P, NP Hard Problems

Tetris is Hard: An Introduction to P vs NP

CMPSCI611: Approximating MAX-CUT Lecture 20

Introduction to computer science

Small Maximal Independent Sets and Faster Exact Graph Coloring

Complexity Classes P and NP

Guessing Game: NP-Complete?

Introduction to Logic in Computer Science: Autumn 2006

Computational complexity theory

NP-completeness and the real world. NP completeness. NP-completeness and the real world (2) NP-completeness and the real world

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Universality in the theory of algorithms and computer science

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Why Study NP- hardness. NP Hardness/Completeness Overview. P and NP. Scaling 9/3/13. Ron Parr CPS 570. NP hardness is not an AI topic

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

Chapter 1. NP Completeness I Introduction. By Sariel Har-Peled, December 30, Version: 1.05

Exponential time algorithms for graph coloring

ONLINE DEGREE-BOUNDED STEINER NETWORK DESIGN. Sina Dehghani Saeed Seddighin Ali Shafahi Fall 2015

Quantum Monte Carlo and the negative sign problem

NP-Completeness and Cook s Theorem

CHOOSING THE BEST HEURISTIC FOR A NP-PROBLEM

Answer: (a) Since we cannot repeat men on the committee, and the order we select them in does not matter, ( )

Discuss the size of the instance for the minimum spanning tree problem.

School Timetabling in Theory and Practice

ON THE COMPLEXITY OF THE GAME OF SET.

Euler Paths and Euler Circuits

On the k-path cover problem for cacti

Classification - Examples

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

CS311H. Prof: Peter Stone. Department of Computer Science The University of Texas at Austin

How to Prove a Theorem So No One Else Can Claim It

Randomized algorithms

Approximation Algorithms

Analysis of Computer Algorithms. Algorithm. Algorithm, Data Structure, Program

P versus NP, and More

On the Unique Games Conjecture

Ian Stewart on Minesweeper

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Lecture 1: Course overview, circuits, and formulas

Approximated Distributed Minimum Vertex Cover Algorithms for Bounded Degree Graphs

Distributed Computing over Communication Networks: Maximal Independent Set

Million Dollar Mathematics!

Algorithm Design and Analysis

! X is a set of strings. ! Instance: string s. ! Algorithm A solves problem X: A(s) = yes iff s! X.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

5.1 Bipartite Matching

Boulder Dash is NP hard

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

8.1 Min Degree Spanning Tree

Single machine parallel batch scheduling with unbounded capacity

Quantum Computability and Complexity and the Limits of Quantum Computation

Near Optimal Solutions

Notes on NP Completeness

Theoretical Computer Science (Bridging Course) Complexity

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP.

Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

Chapter. NP-Completeness. Contents

APP INVENTOR. Test Review

(67902) Topics in Theory and Complexity Nov 2, Lecture 7

Faster deterministic integer factorisation

Parallel Simulated Annealing Algorithm for Graph Coloring Problem

Applied Algorithm Design Lecture 5

Minesweeper as a Constraint Satisfaction Problem

Definition Given a graph G on n vertices, we define the following quantities:

A Performance Comparison of Five Algorithms for Graph Isomorphism

Load Balancing and Rebalancing on Web Based Environment. Yu Zhang

3. Computational Complexity.

MATHEMATICAL ENGINEERING TECHNICAL REPORTS. An Improved Approximation Algorithm for the Traveling Tournament Problem

Transcription:

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using computers. If we think about the problems we actually present to the computer we note that not too many computations require more than O(n 3 ) or O(n 4 ) time assuming that n is very large. Most of the important algorithms we compute are somewhere in the O(log n) to O(n 3 ) range. 6 September 2010 2 1

Class P Practical computation resides within polynomial time (O(N c ), c > 1) bounds. Definition: The class of polynomially solvable problems, P contains all sets in which membership may be decided by an algorithm whose running time is bounded by a polynomial. Advantage: Its use allows us to not worry about our machine model since all reasonable models of computation (including programs and Turing machines) have time complexities, which are polynomially related. 6 September 2010 3 Class NP NP is a class of problems that we would love to solve but are unable to do so exactly. Example: Consider final examination scheduling. A school has n courses and five days in which to schedule examinations. An optimal schedule would be one where no student has to take two examinations on the same day. There are O(5 n ) possible different schedules. 200,000,000,000,000,000,000 years! (regardless of the type of machine used) Obviously this will not be done between registration and the end of the semester! 6 September 2010 4 2

Class NP Another Example: Find minimal length tour of n cities where we begin and end at the same place. This is called closed tour problem. N! different tours are possible. If we have a tour (a solution), we can easily check to see how long it is. Thus, if we want a tour of less than some fixed length, we can quickly check candidates to see if they qualify. Also, previous tours can help find a new one that could potentially provide better result Genetic algorithm 6 September 2010 5 NP There are many tasks for which we may apply fast (polynomial) algorithms. There are also some problems that cannot be solved algorithmically. One example of a class of problems which cannot be solved in the "traditional" way, are NP problems. There are many important problems in which it is very difficult to find a solution, but once we have it, it is easy to check the solution. This is key in developing many algorithms in solving very complex problems. If we can determine the worth of an answer, then maybe we can investigate promising solutions and keep the best one. This fact led to NP-complete problems. 6 September 2010 6 3

Definition: NP Problems The class of nondeterministic polynomially acceptable problems, NP, contains all sets in which membership can be verified in polynomial time. It means that it is possible to "guess" the solution (by some nondeterministic algorithm) and then check it. Nondeterministic is just a fancy way of talking about guessing a solution. A problem is in NP if you can quickly (in polynomial time) test whether a solution is correct (without worrying about how hard it might be to find the solution). NP does not stand for "non-polynomial". There are many complexity classes that are much harder than NP. 6 September 2010 7 VLSI Kind of Example Partitioning Problem: A large circuit is divided into smaller subcircuits (blocks) Objective: Minimize cutsize Block 1 Block 2 Cutsize = 6 6 September 2010 8 4

NP Problems As of today, there are no faster algorithm to provide exact answers to NP-problems. The discovery of such algorithms remains a big task for researchers (maybe you!). Today many people think that such algorithms do not exist and so they are looking for alternative methods. An example of an alternative method is the genetic algorithm. 6 September 2010 9 NP Examples Many graph problems used in CAD algorithms for computer chip design fit in class of NP. Other examples: Scheduling problems Steiner tree Satisfiability Problem Closed Tour Given n cities and an integer k, is there a tour, of length less than k, of the cities which begins and ends at the same city? 6 September 2010 10 5

NP Examples Examination Scheduling Given a list of courses, a list of conflicts between them, and an integer k; is there an exam schedule consisting of k dates such that there are no conflicts between courses which have examinations on the same date? Vertex Cover Given a graph and an integer k, is there a collection of k vertices such that each edge is connected to one of the vertices in the collection? Chromatic Number (Color) Given a graph and an integer k, is there a way to color the vertices with k colors such that adjacent vertices are colored differently? 6 September 2010 11 Solutions Use a heuristic. If you can't quickly solve the problem with a good worst case time, maybe you can come up with a method for solving a reasonable fraction of the common cases. Solve the problem approximately instead of exactly. A lot of the time it is possible to come up with a provably fast algorithm, that doesn't solve the problem exactly but comes up with a solution you can prove is close to right. 6 September 2010 12 6

Solutions Use an exponential time solution anyway. If you really have to solve the problem exactly, you can settle down to writing an exponential time algorithm and stop worrying about finding a better solution. 6 September 2010 13 7