Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)

Slides:



Advertisements
Similar presentations
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Advertisements

What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Computational problems, algorithms, runtime, hardness
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
The Theory of NP-Completeness
Analysis of Algorithms CS 477/677
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.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
1 UNIT -6 P, NP, and NP-Complete. 2 Tractability u Some problems are intractable: as they grow large, we are unable to solve them in reasonable time u.
Programming & Data Structures
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
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 11 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
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.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSC 413/513: Intro to Algorithms NP Completeness.
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.
Polynomial-time reductions We have seen several reductions:
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
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.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Compsci 100, Fall What is Computing? Informatics? l What is computer science, what is its potential?  What can we do with computers in our lives?
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
2101INT – Principles of Intelligence Systems Lecture 3.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Design and Analysis of Algorithms NP-Completeness Haidong Xue Summer 2012, at GSU.
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.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Chapter.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
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.
CS10: The Beauty and Joy of Computing Lecture #21 Limits of Computing Instructor: Sean Morris UCB announces The Turing Test Tournament.
Chapter 12: Theory of Computation
Unsolvable Problems December 4, 2017.
Computational Complexity
Discrete Mathematics CS 2610
Chapter 11 Limitations of Algorithm Power
CSC 380: Design and Analysis of Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
RAIK 283 Data Structures & Algorithms
Presentation transcript:

Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)

Computer Science Research Areas Artificial Intelligence Biosystems & Computational Biology Database Management Systems Graphics Human-Computer Interaction Networking Programming Systems Scientific Computing Security Systems Theory - Complexity theory - … … [

Revisiting Algorithm Complexity A variety of problems that: are tractable with efficient solutions in reasonable time are intractable are solvable approximately, not optimally have no known efficient solution are not solvable

Revisiting Algorithm Complexity Recall: - running time of an algorithm: how many steps does the algorithm take as a function of the size of the input - various orders of growth, for example: - constant - logarithmic - linear - quadratic - cubic - exponential Examples ?

Revisiting Algorithm Complexity Recall: - running time of an algorithm: how many steps does the algorithm take as a function of the size of the input - various orders of growth, for example: - constant - logarithmic - linear - quadratic - cubic - exponential Efficient: order of growth is polynomial Such problems are said to be “in P” (for polynomial)

Intractable Problems - Can be solved, but not fast enough; for example - exponential running time - also, when the running time is polynomial with a huge exponent (e.g., f(n) = n 10 ) - in such cases, can solve only for small n…

Hamiltonian Cycle Input: cities with road connections between some pairs of cities Output: possible to go through all such cities (every city exactly once) ? Notice: YES/NO problem (such problems are called decision problems)

Hamiltonian Cycle Input: cities with road connections between some pairs of cities Output: possible to go through all such cities (every city exactly once) ? PEER INSTRUCTION: For this input, is there a Hamiltonian cycle ? (a) Answer YES (b) Answer NO

Hamiltonian Cycle Input: cities with road connections between some pairs of cities Output: possible to go through all such cities (every city exactly once) ? What did you do to solve the problem ?

Traveling Salesman Problem Input: cities with road connections between pairs of cities, roads have lengths Output: find a route that goes through all the cities, returns to the origin, and minimizes the overall traveled length PEER INSTRUCTION: For this input, what is the shortest possible length ? (a) total length 7 (b) total length 8 (c) total length 9 (d) total length

Traveling Salesman Problem Input: cities with road connections between pairs of cities, roads have lengths Output: find a route that goes through all the cities, returns to the origin, and minimizes the overall traveled length Not a decision problem… But we can ask: Is there a route shorter than x ?

Traveling Salesman Problem Bob Bosch (TSP Art)David Applegate, Robert Bixby, Vašek Chvátal, William Cook

- suppose we have a magic device that solves the Traveling Salesman Problem - can we use it to solve the Hamiltonian Cycle ? This is called a reduction. Find a solution to one problem, then all others that reduce to it can be solved! Hamiltonian Cycle vs Traveling Salesman

Recall: P = problems with polynomial-time algorithms We do not know how to solve Hamiltonian Cycle or Traveling Salesman in polynomial time! (No efficient solution known.) But… If we “guess” a permutation of the cities, we can easily verify whether they form a cycle of length shorter than x. NP = problems whose solutions can be efficiently verified (N stands for non-deterministic [guessing]; P is for polynomial) P vs NP

P = problems with polynomial-time algorithms NP = problems whose solutions can be efficiently verified The BIG OPEN PROBLEM in CS: Is P = NP ??? A problem is NP-hard if all problems in NP reduce to it. I.e., efficiently solving an NP-hard problem gives efficient algorithms for all problems in NP! An NP-hard problem is NP-complete if it is in NP. Examples: Hamiltonian Cycle, Traveling Salesman Problem, … P vs NP $1,000,000 reward

NP-complete problem: what to do ? What to tell your boss if they ask you to solve an NP-complete problem: “I can’t find an efficient solution but neither can all these famous people.”

NP-complete problem: what to do ? Another option: approximate the solution - Seems unlikely to solve exactly but sometimes can get “close” to the optimum - For example, traveling salesman: - If the input is a metric (satisfies the triangle inequality), then we can efficiently find a solution that is not worse than 1.5x optimum

Beyond NP: Unsolvable problems Are there problems that, no matter how much time we use, we cannot solve ? Some terminology: - Decision problems: YES/NO answer - Algorithm is a solution if it produces the correct answer in a finite amount of time - Problem is decidable if it has a solution Alan Turing proved that not all problems are decidable!

Review: Proof by Contradiction How many primes are there ? Euclid content/uploads/2011/01/euclides.jpg

Input: a program and its input Output: does the program eventually stop ? Turing’s proof, by contradiction: - Suppose somebody can solve it - Write Stops on Self - Write Weird - Call Weird on itself… Beyond NP: The Halting Problem

- Complexity theory: important part of CS - If given an important problem, rather than try to solve it yourself, see if others have tried similar problems - If you do not need an exact solution, approximation algorithms might help - Some problems are not solvable! Conclusions

P = NP ? Pavel Pudlák