Complexity ©D.Moshkovitz 1 Introduction. Complexity ©D.Moshkovitz 2 Introduction Objectives: –To introduce some of the basic concepts of complexity theory.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Reductions Complexity ©D.Moshkovitz.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
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,
1 ©D.Moshkovitz Complexity The Traveling Salesman Problem.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
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 
Great Theoretical Ideas in Computer Science for Some.
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Computational problems, algorithms, runtime, hardness
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
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
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
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.
A Brief Introduction To The Theory of Computer Science and The PCP Theorem By Dana Moshkovitz Faculty of Mathematics and Computer Science The Weizmann.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Programming & Data Structures
NP-Complete Problems CSC 331: Algorithm Analysis NP-Complete Problems.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
MCS312: NP-completeness and Approximation Algorithms
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.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
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.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
RESOURCES, TRADE-OFFS, AND LIMITATIONS Group 5 8/27/2014.
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.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
CSC 413/513: Intro to Algorithms NP Completeness.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
The Traveling Salesman Problem Over Seventy Years of Research, and a Million in Cash Presented by Vladimir Coxall.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
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.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CSE332: Data Abstractions Lecture 27: A Few Words on NP Tyler Robison Summer
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
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.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
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.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
Lecture 20 CSE 331 July 30, Longest path problem Given G, does there exist a simple path of length n-1 ?
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Introduction to Randomized Algorithms and the Probabilistic Method
Complexity Introduction Complexity ©D.Moshkovitz.
Analysis and design of algorithm
Chapter 11 Limitations of Algorithm Power
Reductions Complexity ©D.Moshkovitz.
Reductions Complexity ©D.Moshkovitz.
Discrete Mathematics and Its Applications
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

Complexity ©D.Moshkovitz 1 Introduction

Complexity ©D.Moshkovitz 2 Introduction Objectives: –To introduce some of the basic concepts of complexity theory. Overview: –Tea parties and computations –Growth rate and reasonability –Reducibility – … And more…

Complexity ©D.Moshkovitz 3 The Crazy Tea Party Problem To seat all guests at a round table, so people who sit in adjacent seats like each other. JohnMaryBobJaneAlice John  Mary  Bob  Jane  Alice 

Complexity ©D.Moshkovitz 4 Solution for the Example Alice Bob Jane John Problem To seat all guests at a round table, so people who sit an adjacent seats like each other. Mary

Complexity ©D.Moshkovitz 5 Naive Algorithm For each ordering of the guests around the table –Verify each guest likes the guest sitting in the next seat.

Complexity ©D.Moshkovitz 6 How Much Time Should This Take? (worse case) guests steps n (n- 1)!  9 · say our computer is capable of instructions per second, this will still take  3 · years!

Complexity ©D.Moshkovitz 7 Tours Problem Plan a trip that visits every site exactly once.

Complexity ©D.Moshkovitz 8 Solution for the Example Problem Plan a trip that visits every site exactly once.

Complexity ©D.Moshkovitz 9 Naive Algorithm (Backtracking) For each site –Try out all reachable sites, which have not been visited yet –Backtrack and retry –Repeat the process until stuck

Complexity ©D.Moshkovitz 10 How Much Time Should This Take? sites steps n n!  9 · If our computer can carry out 10,000 instructions per second, than it will take us 4 years!

Complexity ©D.Moshkovitz 11 Is a Problem Tractable? YES! And here’s the efficient algorithm for it NO! and I can prove it and what if neither is the case?

Complexity ©D.Moshkovitz 12 Food for Thought… Can you design an efficient algorithm for the tour problem if the sites’ map contains no cycles?

Complexity ©D.Moshkovitz 13 Growth Rate: Sketch 10n n2n2 2n2n n! =2 O(n lg n) input length time

Complexity ©D.Moshkovitz 14 The World According to Complexity reasonableunreasonable polynomial  n O(1) exponential  2 n O(1)

Complexity ©D.Moshkovitz 15 Could One be Fundamentally Harder than the Other? Tour Seating ?

Complexity ©D.Moshkovitz 16 Relations Between Problems Assuming an efficient procedure for problem A, there is an efficient procedure for problem B B cannot be radically harder than A

Complexity ©D.Moshkovitz 17 Reductions B pp A B cannot be radically harder than A In other words: A is at least as hard as B

Complexity ©D.Moshkovitz 18 Which One is Harder? Tour Seating ?

Complexity ©D.Moshkovitz 19 Reduce Tour to Seating First Observation: The problems aren’t so different site guest “directly reachable from…”“liked by…”

Complexity ©D.Moshkovitz 20 Reduce Tour to Seating Second Observation: Completing the circle Let’s invite to our party a very popular guest, i.e one who can sit next to everyone else.

Complexity ©D.Moshkovitz 21 Reduce Tour to Seating If there is a tour, there is also a way to seat all the imagined guests around the table.... popular guest

Complexity ©D.Moshkovitz 22 Reduce Tour to Seating If there is a seating, we can easily find a tour path (no tour, no seating).... popular guest...

Complexity ©D.Moshkovitz 23 Bottom Line The seating problem is at least as hard as the tour problem

Complexity ©D.Moshkovitz 24 Discussion Although we couldn’t come up with an efficient algorithm for the problems Nor to prove they don’t have one, We managed to show a very powerful claim regarding the relation between their hardness

Complexity ©D.Moshkovitz 25 Discussion Interestingly, we can also reduce the seating problem to the tour problem. Moreover, there is a whole class of problems, which can be pairwise efficiently reduced to each other.

Complexity ©D.Moshkovitz 26 Food for Thought… Can you reduce the seating problem to the tour problem?

Complexity ©D.Moshkovitz 27 NPC Contains thousands of distinct problem  exponential algorithms  efficient algorithms ? each reducible to all others

Complexity ©D.Moshkovitz 28 How Can Studying Complexity Make You a Millionaire? P vs NP is the most fundamental open question of computer science. Resolving it would get you great honor … as well as substantial fortune… Philosophical: if P=NP –Human ingenuity unnecessary –No need for mathematicians!! Is nature nondeterministic?

Complexity ©D.Moshkovitz 29 What More? Let’s review some more questions to be discussed in this course.

Complexity ©D.Moshkovitz 30 Generalized Tour Problem Add prices to the roads of the tour problem Ask for the least costly tour $8 $10 $13 $12 $19 $3 $17 $13

Complexity ©D.Moshkovitz 31 Approximation How about approximating the optimal tour? I.e – finding a tour which costs, say, no more than twice as much as the least costly. $8 $10 $13 $12 $19 $3 $17 $13

Complexity ©D.Moshkovitz 32 Is Running Time the Only Precious Resource? How about memory (space)? Are there other resources?

Complexity ©D.Moshkovitz 33 Games Each player picks a word, which begins with the letter that ended the previous word. Apple Egg Girl Lord DogGuy YardDeer

Complexity ©D.Moshkovitz 34 Dictionary Apple EggGirl Ear Lord Dog Red

Complexity ©D.Moshkovitz 35 Game Tree EggGirlDogAppleEarLordRed GirlEggEarDog LordGirlRed Lord Dog Girl Lord DogGirl Lord Girl RedLordDogLordDogGirl Apple Egg Girl Ear Lord Dog Red

Complexity ©D.Moshkovitz 36 Winning Games How can we find a winning strategy for this game? How much space would it take to compute it using game trees?

Complexity ©D.Moshkovitz 37 Summary We got to know two problems: –The seating problem (HAMILTONIAN-CYCLE) –The tour problem (HAMILTONIAN-PATH) Although we could say very little about them, we managed to show their computational hardness are related. Moreover, we claimed they are part of a large class of problems, called NPC. 

Complexity ©D.Moshkovitz 38 Summary We also mentioned some of the topics we will discuss later in the course: –Approximation –Space-bounded computations 