32
PHILIP CHAN RYAN STANSIFER MAR 24, 2017 A Closer Look at Computing: The Million-Dollar Algorithms

A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

P H I L I P C H A N

R Y A N S T A N S I F E R

M A R 2 4 , 2 0 1 7

A Closer Look at Computing: The Million-Dollar Algorithms

Page 2: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

P H I L I P C H A N

Ranking Web Pages

Page 3: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Basic Problem

Input: Search query (keywords)

Web pages

Output Ranking of web pages relevant to the search query

Page 4: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Basic Problem

Input: Search query (keywords)

Web pages

Output Ranking of web pages relevant to the search query

If given 10 web pages and a search query (e.g. internet)

How would your rank the web pages?

Page 5: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Search Engines in the 1990s

Altavista

Excite

Infoseek

Webcrawler

Internet Archive: archive.org/web

Page 6: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Search Engines in the Early 2000s

Many search engines faded away

Google began to dominate

Page 7: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Secret Sauce of Google

Google did not advertise itself

Mostly by word of mouth

“free advertisement” from the press

Why did Google start to dominate?

What is the secret sauce of Google?

Page 8: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Brief History of Google

1996 -- 2 graduate students at Stanford U.

1997 – google.com was registered

1998 – [to be filled in later]

1998 – $100K investment, company incorporated

2004 – initial public offering (NASDAQ)

Page 9: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Secret Sauce of Google

A different way to rank web pages

In addition to words on a page

They use links between pages

How would you use links to rank pages?

Page 10: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Brief History of Google

1996 -- 2 graduate students at Stanford U.

1997 – google.com was registered

1998 -- publication of their algorithm in WWW Conf.

1998 – $100K investment, company incorporated

2004 – initial public offering (NASDAQ)

Page 11: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Algorithm: Page Rank

Input

Links between web pages

Output

Score for each web page

https://www.youtube.com/watch?v=Q9HjeFD62Uk

8:27-13:43

Page 12: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

P H I L I P C H A N

Mystery Million-Dollar Problem

Page 13: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

What is common among these tasks?

With a grocery shopping list

you try to gather all the items and leave quickly

Given a truck load of packages

a UPS/FedEx driver tries to deliver them quickly

Given locations of holes on a circuit board

Drill all the holes quickly

Page 14: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Common Problem

Given an initial location and other locations

Find the shortest route:

Start from an initial location

Visit each of the other locations exactly once

Go back to the initial location

Traveling Salesman Problem (TSP)

Page 15: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Traveling Salesman Problem (TSP)

https://www.youtube.com/watch?v=Q9HjeFD62Uk

36:12- 38:50

Page 16: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

A Closer Look at TSP

Consider the initial location is Home

A, B, C are other locations

1st visit 2nd visit 3rd visit

Home A

B

C

Page 17: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

A Closer Look at TSP

Consider the initial location is Home

A, B, C are other locations

1st visit 2nd visit 3rd visit

Home A B

C

B A

C

C A

B

Page 18: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

A Closer Look at TSP

Consider the initial location is Home

A, B, C are other locations

1st visit 2nd visit 3rd visit

Home A B C

C B

B A C

C A

C A B

B A

Page 19: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

A Closer Look at TSP

Consider the initial location is Home

A, B, C are other locations

1st visit 2nd visit 3rd visit Last visit

Home A B C Home

C B

B A C

C A

C A B

B A

Page 20: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

A Closer Look at TSP

Consider the initial location is Home

A, B, C are other locations

3 * 2 * 1 = 6 possible routes

1st visit 2nd visit 3rd visit Last visit

Home A B C Home

C B

B A C

C A

C A B

B A

Page 21: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

4 locations

1st visit

4 choices

2nd visit

3 choices

3rd visit

2 choices

4th visit

1 choice

4*3*2*1 = 24 possible routes

Page 22: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

n locations

1st visit

n choices

2nd visit

n-1 choices

nth visit

1 choice

# of possible routes?

Page 23: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

n locations

1st visit

n choices

2nd visit

n-1 choices

nth visit

1 choice

# of possible routes?

n*(n-1)*(n-2) …. *2*1 = n!

Page 24: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Computer checks 1 billion routes per second

# of locations # of possible routes Completion time

10 3.6M 0.003 s

Page 25: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Computer checks 1 billion routes per second

# of locations # of possible routes Completion time

10 3.6M 0.003 s

15 ?

Page 26: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Computer checks 1 billion routes per second

# of locations # of possible routes Completion time

10 3.6M 0.003 s

15 1.3 x 10^12 22 minutes

20 ?

Page 27: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Computer checks 1 billion routes per second

# of locations # of possible routes Completion time

10 3.6M 0.003 s

15 1.3 x 10^12 22 minutes

20 2.4 x 10^18 77 years

100 ?

Page 28: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Computer checks 1 billion routes per second

# of locations # of possible routes Completion time

10 3.6M 0.003 s

15 1.3 x 10^12 22 minutes

20 2.4 x 10^18 77 years

100 9.3 x 10^157 3 x 10^141 years

Page 29: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

TSP and Bees

https://www.youtube.com/watch?v=Q9HjeFD62Uk

38:50-42:30

Page 30: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

$1M prize

Clay Mathematical Institute

claymath.org

Millennium Prize Problems (7)

$1M each

P=NP?

Does an efficient algorithm for TSP exist?

A yes or no answer will win the prize

If yes, (a large number of) problems in the same class can be solved efficiently.

Page 31: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Part 2

Page 32: A Closer Look of the Internetpkc/cs4hs/million/rankingPagesTSP.pdf · A Closer Look at Computing: The Million-Dollar Algorithms . PHILIP CHAN Ranking Web Pages . Basic Problem

Thank You

cs.fit.edu/~pkc/cs4hs Summer Camps

July

8pm, astronomy lecture, Olin Engineering, Rm 118 Across the courtyard

Between this building and the parking lot

9pm, 32-inch telescope

Questions?