drama at the oscars
DESCRIPTION
Drama At the Oscars. Some History…. Not that there’s anything wrong with that!. How Can a Catastrophe be Avoided?. Getting It Right. Naive Algorithm. Naive Algorithm. Times Square. Rockefeller Center. Empire State Building. Stuyvesant Tn. World Trade Center. 9. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/1.jpg)
Y T H E O R Y
1
C
O
M
P
L
E
X
I
T
![Page 2: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/2.jpg)
2
Goal: •Introduce basic concepts in Complexity Theory.
Plan:•Meet Celebrities and Computations•Growth Rate and Tractability•Reducibility•… etc. …
![Page 3: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/3.jpg)
3
Drama At the OscarsProblem:
• seat all guests around a table, so people who sit next to each other get along.
![Page 4: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/4.jpg)
Some History…
4
Not that there’s anything wrong
with that!
![Page 5: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/5.jpg)
How Can a Catastrophe be Avoided?
5
![Page 6: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/6.jpg)
6
Getting It Right
![Page 7: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/7.jpg)
Observation:
• Given a seating one can efficiently check if all guests get along with their neighbors
For each seating arrangement: Check if all guests are OK with neighborsStop if a good arrangement is foundHow much time would it take? (worse case)
7
Naive Algorithm
![Page 8: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/8.jpg)
For each seating arrangement: Check if all guests are OK with neighborsStop if a good arrangement is foundHow much time would it take? (worse case)
8
Naive Algorithm
Guests Steps
N (N-1)!
5 24
15 87178291200
100 9·10155
• say our computer is capable of 1010
instructions per second, this will still take 3·10138
years!
Can you do better?
![Page 9: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/9.jpg)
9
Stuyvesant Tn.
World Trade Center
Rockefeller Center
Empire State Building
Tour Problem
• Plan a trip that visits every location exactly once.
Times Square
![Page 10: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/10.jpg)
10
Naive Algorithm (Backtracking)
For each siteTry out all reachable
sitesnot yet visited
Backtrack and retry
Repeat the process until
stuck
![Page 11: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/11.jpg)
Sites Steps
N N!
5 120
15 1307674368000
100 9·10157
11
How Much Time?
• On a computer that can check 10,000 options per second, this still takes 4 years!
![Page 12: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/12.jpg)
Yes •and here’s an efficient algorithm that solves it
No• and I can prove it
? •and if neither is the case?
12
Is a Problem Tractable?
![Page 14: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/14.jpg)
14
Basic split in time-complexity
Maybereasonable
Totallyunreasonabl
e
polynomial nO(1)
exponential
2nO(1)
![Page 15: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/15.jpg)
15
Which is Harder?
SEATING
TOUR
![Page 16: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/16.jpg)
If
• assuming an efficient procedure for B there is an efficient procedure for A
Then
• A cannot be radically harder than B
an efficient procedure for A using
an efficient procedure forB
an efficient procedure for A using
an efficient procedure forB
16
Relations Between Problems
![Page 17: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/17.jpg)
an efficient procedure for A using
an efficient procedure forB
Notation
17
ReductionsA cannot be radically harder than B
• In other words:
B is at least as hard as A
A ≤p B
![Page 18: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/18.jpg)
18
Reduce Tour to Seating
Find someone who can seat next to everyone
![Page 19: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/19.jpg)
Completeness:
• If there’s a tour, there’s a way to seat all the guests around the table.
Soundness:
• If there’s a seating, we can easily find a tour path (no tour, no seating).
19
Reduce Tour to Seating
QED
• seating is at least as hard as tour
![Page 20: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/20.jpg)
COULDNOT:
•find an efficient algorithm for problems
NOR •prove they are intractable
DIDMANAGE:
•to show a very strong correlation between their complexity
20
So Far
![Page 21: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/21.jpg)
Interestingly,we can also reduce the
seating problem to the tour problem.
Furthermore, there is a whole class of
problems, which can be pair-wise efficiently reduced to
each other.
21
Can you?
![Page 22: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/22.jpg)
Does P=NP
NP
P
• Efficiently computable
NP
• Solution efficiently verifiable
22
NP and P
![Page 23: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/23.jpg)
NP
23
NPC
Contains thousand
s of distinct
problems
each reducible
to all others
exponential-time algorithmsefficient algorithms
![Page 24: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/24.jpg)
The “P vs. NP” question is the most fundamental of CS• Human ingenuity is redundant!• So would mathematicians be!!
Resolving it would bring you great honor…
… as well as significant fortune… www.claymath.org/
Philosophically: if P=NP
Is nature nondeterministic?
24
How can Complexity make you a Millionaire?
![Page 25: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/25.jpg)
Next:
•we’ll review basic questions explored through the course.
25
What’s Ahead?
![Page 26: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/26.jpg)
Generalized Tour Problem
• Each segment of the tour problem now has a cost• find a least-costly tour
26
$2
$5
$4
$3$1
$4
$6
$5
$2
Approximate the optimal tour?
i.e. – find a tour that
costs, say, no more
than twice as much as
the least costly.
![Page 27: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/27.jpg)
Is Running Time the
only Resourc
e?• What about
memory (space)?
• Any other?
27
![Page 28: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/28.jpg)
Word Games:Players take turns
choose a word whose first letter matches other player’s last
28
Games
Apple EggGirl LordDog
GuyYardDeer
Apple
Egg Girl
Ear
LordDog
Red
![Page 29: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/29.jpg)
Can one compute a winning strategy?
How much time would it take?
How much space?
29
Egg Girl DogApple Ear LordRed
GirlEgg EarDog DogLord Girl Red
Lord Lord
Dog
Dog
Girl
Lord
Dog Girl
Lord
Girl Girl Red Lord Dog Lord Dog Girl
Apple
Egg Girl
Ear
LordDog
Red
![Page 30: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/30.jpg)
We have introduced two problems: 1. Seating HAMILTONIAN-CYCLE 2. Tour HAMILTONIAN-PATH
Unable to settle their complexity we, nevertheless, showed strong correlations between them
These problems are representatives of a large class of problems: NPC
30
Summary
![Page 31: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/31.jpg)
Topics to be studied later:
•Approximation•Space-bounded computations
31
Prognosis
![Page 32: Drama At the Oscars](https://reader035.vdocuments.site/reader035/viewer/2022062408/5681431d550346895daf7d97/html5/thumbnails/32.jpg)
WWindex
32
Complexity Theory
Computations
Completeness
Hamiltonian Path
Growth Rate
Complexity Classes
NPC P NP Exponential Timewww.cl
aymath.org
Approximation
Reducibility
Completeness
Soundness