Erdal Kose CC30.10 These slides are based of Prof. N. Yanofsky Lecture notes.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

1 P, NP, and NP-Complete Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
NP-Hard Nattee Niparnan.
Limitation of Computation Power – P, NP, and NP-complete
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
CSE373: Data Structures & Algorithms Lecture 24: The P vs. NP question, NP-Completeness Nicki Dell Spring 2014 CSE 373 Algorithms and Data Structures 1.
9.2 The Traveling Salesman Problem. Let us return to the question of finding a cheapest possible cycle through all the given towns: We have n towns (points)
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Computability and Complexity 32-1 Computability and Complexity Andrei Bulatov Boolean Circuits.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Circuits CSE 373 Data Structures Lecture 22. 3/12/03Circuits - Lecture 222 Readings Reading ›Sections and 9.7.
Chapter 11: Limitations of Algorithmic Power
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Programming & Data Structures
NP-Complete Problems CSC 331: Algorithm Analysis NP-Complete Problems.
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:
CSCE350 Algorithms and Data Structure
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
FACULTY OF ENGINEERING & INFORMATION TECHNOLOGIES P, NP, and Complexity Six fundamental facts One rule of thumb Three fundamental notions One fundamental.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
MIT and James Orlin1 NP-completeness in 2005.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC 413/513: Intro to Algorithms NP Completeness.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
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.
Cliff Shaffer Computer Science Computational Complexity.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Georgia Institute of Technology Speed part 6 Barb Ericson Georgia Institute of Technology May 2006.
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
Lecture 11: 9.4 Connectivity Paths in Undirected & Directed Graphs Graph Isomorphisms Counting Paths between Vertices 9.5 Euler and Hamilton Paths Euler.
Week 13 - Monday.  What did we talk about last time?  B-trees  Hamiltonian tour  Traveling Salesman Problem.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
CSC 413/513: Intro to Algorithms
Feasibility and Infeasibility Are all problems easy to solve?
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
Great Theoretical Ideas in Computer Science.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Limitation of Computation Power – P, NP, and NP-complete
Analysis and design of algorithm
Chapter 11 Limitations of Algorithm Power
Prabhas Chongstitvatana
RAIK 283 Data Structures & Algorithms
Presentation transcript:

Erdal Kose CC30.10 These slides are based of Prof. N. Yanofsky Lecture notes

Objectives What Computers Can do Some Easy Problems Adding & Multiply Numbers Searching Sorting Euler Circuit (Konigsberg bridges) How Hard Can a Problem be? NP-Problems Reduction Of Problems What A Computer Cannot do (Halting Problem)

What Can Computers do Computer can; add, multiply numbers, sort any given input, search through millions of records for a specific one.

Some Easy Problems Adding and Multiplying numbers The computerense term for a standard procedure or exact sequence of instructions is Algorithm (Steps for solving a problem) Searching: imagine you are looking for a cabinet full of files where each file contains information about musical bands. The only way to find the desired file is to examine them all, one at a time. Such a quest might be termed a brute-force search.

Cont.. Sorting: there are many different algorithms for perform sorting. The simplest one is selection sort: 1. Search through all the elements and find the minimum element 2. Swap that minimum element with the first element in the list 3. Search the rest of the list until you find its minimum 4. Swap that element with the second element in the list 5. Continue this procedure until all the elements are in their correct position

Euler Circuit The city of Königsberg in Prussia (now Kaliningrad, Russia) was set on both sides of the Pregel River, and included two large islands which were connected to each other and the mainland by seven bridges.KönigsbergPrussiaKaliningradRussiaPregel River The problem was to find a walk through the city that would cross each bridge once and only once. The islands could not be reached by any route other than the bridges, and every bridge must have been crossed completely every time (one could not walk half way onto the bridge and then turn around and later cross the other half from the other side). Site:

Cont..

Cont.. All the problems presented so far can be solved with algorithms that demand n, n 2, log(n) operations. Such problems are called polynomial problems. They can be performed with a polynomial amount of operations. The collection all polynomial problems is denoted as P All polynomial problems can be solved ona modern computer in a feasible amount of operations. Such problems take a feasible amount of time to solve.

Hard Problems In order to show how hard a problem is, let introduce some problems which are easy to describe. The Traveling Salesman Problem. Hamiltonian Cycle Problem Set Partition Problem Subset Problem Satisfiability Problem

Playing Chess A board configuration must be represented in bits. Nest the computer must use an algorithm to decide on a move. The algorithm use an evaluation function. Based on the evaluation function a computer will make a move. Checking the all possible moves for a computer is generally infeasible. It will take a long time, such as one hundred years to make a move.

Cont.. Such Problem, where we are given an input and we are asked to find the shortest or longest or the best solutions called an Optimization Problem Many problems that computers can solve are optimization problems. All these problems can also come in anther form called decision problem A decision problems is one in which the computer is only required to give a “yes” or “No” answer

Cont.. The class of all decision problem that demand 2 n or n! Operations to solve is called NP All problem in NP will be called an “NP problem” Since P is the class of problems that can be solved in a polynomial amount of operations, polynomials grow slower than exponential or factorial, we have set P is a subset of NP. That’s mean every “easy” problem is an element of the class of “hard” or easy problems, or P<=NP.

Universality Problem What does make a computer more powerful than another? Any computer using simple instructions could simulate any other computer. That means; all the computers have the same power, some might be faster than the other, but all of them are designed in the same way. This fact is known as Universality Principle. Dell, HP, Sony, IBM, Macintosh: they are all same. Depending to their hardware, some might be fast, but all of them are designed in the same way.

How hard can a problem be? There are algorithms requiring work proportional to n, n, n 2,n 3, and so on. This algorithms are know as polynomial time algorithms There are algorithms requiring work proportional to exponential time. Problems that required polynomial time (such as n, n 2,n 3 ) to be solved are know as easy problem. Examples: sorting problems, searching problems.

NP-Complete Problems (infeasible Problems) There are much more difficult computations, may of which are important to business, science, and engineering. For example finding the cheapest set of plane tickets for a touring n cities. This kind of problems do not have a “practical” algorithmic solution. Such problems are know as NP-Problems. NP-Problems are hard Problems.

Reduction of Problems Imagine we have a problem B and a computer that can solve problem B. That means we have a machine that can input an instance of the problem B and will output either a “YES” or “No” depending on whether or not the instance has a solution. Now imagine that we have a problem A. If there is way of transforming an instance of problem A in to an instance of problem B, we can create a machine that decide A by connecting the transformer to the B decider. When We have such a relationship between problem A and B, we say we have a reduction of problem A to problem B or problem A reduces to problem B

Unsolvable problems There are some problems computer cannot solve at all. It is not that algorithm takes too long, there are NO algorithm, no solution, period!!!! For example it is impossible for a computer to determine if a program has a bug (logical mistake, such as an infinite loop) in it. The problem of wringing a program to get a program as input and to check if that program has an infinite loop in it is know as loop checker. It also known as HALTING PROBLEM.

End..