Skip to content

Instantly share code, notes, and snippets.

@jdalbey
Created November 22, 2014 05:23
Show Gist options
  • Save jdalbey/18c9a3726916a9e14e11 to your computer and use it in GitHub Desktop.
Save jdalbey/18c9a3726916a9e14e11 to your computer and use it in GitHub Desktop.
Kevin Bacon Game Problem

14.26 The object of the Kevin Bacon Game is to link a movie actor to Kevin Bacon via shared movie roles. The minimum number of links is an actor’s Bacon number. For instance, Tom Hanks has a Bacon number of 1. He was in Apollo 13 with Kevin Bacon. Sally Field has a Bacon number of 2 because she was in Forest Gump with Tom Hanks, who was in Apollo 13 with Kevin Bacon. Almost all well-known actors have a Bacon number of 1 or 2. Assume that you have a comprehensive list of actors, with roles, and do the following. a. Explain how to find an actor’s Bacon number. b. Explain how to find the actor with the highest Bacon number. c. Explain how to find the minimum number of links between two arbitrary actors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment