← All projectsCOSC 10 / Software

The Bacon Game

Finding connections between actors through the films they share.

Bacon Game graph-search output
Actual output from the interactive game. View full size (new tab): Bacon Game graph-search output

Building the co-star graph

The game reads actor, movie, and movie-actor files into maps. It then compares each pair of actors' movie sets and adds an undirected edge when they share at least one title; the edge label stores the shared film or films.

Finding paths to the center

A breadth-first search tree is rooted at the selected center of the acting universe. Asking for a path walks that tree back toward the root, which gives the actor's separation and the films along the connection.

Graph reports

The command loop can change the center, list actors by degree or separation, report actors outside the current connected component, and rank centers by average separation. The captured startup graph connected 7,493 of 9,234 other actors to Kevin Bacon with an average separation of about 3.28.

Mithun RameshkumarDartmouth College