The Oracle of Bacon
Six Degrees of Kevin Bacon
• Link people to Kevin Bacon based on movies they have been in together
Morgan Freeman was in Se7en with Brad Pitt Brad Pitt was in Sleepers with Kevin Bacon
• Morgan Freeman has a Bacon number of 2 • Who has a Bacon number of 4 or more?
Centers of the Hollywood Universe
• 739,979 people can be connected to Bacon • Is he the center of the Hollywood Universe?
– No! – Who is? – Who are other good centers? – What makes them good centers?
The Oracle of Bacon
Internet Movie Database
Web server oracleofbacon.org
Linking Engine
• Linking Engine:
– Is written in C – Stores all movie data in memory – Answers link, number, and center queries – Doesn’t actually use Oracle™
Inside the Linking Engine
• All three types of queries use breadth-first search
BN = 1
Sean Penn Tim Robbins Tom Hanks Bill Paxton Sarah Jessica Parker John Lithgow
BN = 0
Kevin Bacon
Mystic River Apollo 13 Footloose
Inside the Linking Engine
• All three types of queries use breadth-first search
BN = 2
Woody Allen
BN = 1
Sean Penn
Sweet and Lowdown Fast Times at Ridgemont High War of the Worlds The Shawshank Redemption Cast Away Forrest Gump Tombstone A Simple Plan
Judge Reinhold Miranda Otto Morgan Freeman Helen Hunt Sally Field Val Kilmer Billy Bob Thornton
BN = 0
Kevin Bacon
Mystic River Apollo 13 Footloose
Tim Robbins Tom Hanks Bill Paxton Sarah Jessica Parker John Lithgow
Inside the Linking Engine
• Link Val Kilmer to Kevin Bacon
BN = 2
Woody Allen
BN = 1
Sean Penn
Sweet and Lowdown Fast Times at Ridgemont High War of the Worlds The Shawshank Redemption Cast Away Forrest Gump Tombstone A Simple Plan
Judge Reinhold Miranda Otto Morgan Freeman Helen Hunt Sally Field Val Kilmer Billy Bob Thornton
BN = 0
Kevin Bacon
Mystic River Apollo 13 Footloose
Tim Robbins Tom Hanks Bill Paxton Sarah Jessica Parker John Lithgow
Inside the Linking Engine
• How good a center is Kevin Bacon?
– Average everyone’s Bacon number – Currently 2.963, ranked 1222nd
• Who is exactly 2 hops away from Kevin Bacon?
– This whole column – Currently 163,002 people
Woody Allen Sean Penn Tim Robbins Tom Hanks Bill Paxton Sarah Jessica Parker John Lithgow Sweet and Lowdown Fast Times at Ridgemont High War of the Worlds The Shawshank Redemption Cast Away Forrest Gump Tombstone A Simple Plan Judge Reinhold Miranda Otto Morgan Freeman Helen Hunt Sally Field Val Kilmer Billy Bob Thornton
Mystic River Kevin Bacon Apollo 13 Footloose
Caching
• Keep whole BFS trees for common queries
– Takes about 4MB of memory each
• Perform 75-85% fewer BFS calculations
– Faster website response time
Spel Cheking
• Oracle of Bacon users can’t spell
– Dan Ackroyd Dan Aykroyd – Mike Meyers Mike Myers – Sally Fields Sally Field
• Show everyone with an edit distance of 3 or fewer
Jake Jillenhall XX X Gy a
A little bit of history
• Craig Fass, Mike Ginelli, and Brian Turtle invented it as a drinking game at Albright College • Brett Tjaden and Glenn Wasson put it on the web at UVA in 1995 • I have run it since 1999
– Full rewrite, with caching and spell check
• Oracles of Baseball, TV stars, and corporate executives
Emails I get
• • • • Journalists Actors and actress (and one porn star) “Help me write an Oracle of such-and-such” “Why isn’t so-and-so in your database?”
= “I can’t spell” = “I don’t know the difference between actors and characters (and animals and muppets)”
• “Why do you link through documentaries?” • “Please tell me who has a Bacon number of 8”