CMSC 132A Lecture Notes - Lecture 27: Delimiter, Six Degrees Of Kevin Bacon, Ed Asner

56 views3 pages
CMSC132A Lecture 27: Six Degrees of Kevin Bacon fun
Last time we created a book class but we didn’t exactly finish the method called
isConnected() which tells us which books are connected to which authors. In a way, it is
related to the “Six Degrees of Kevin Bacon” parlor game which goes like this:
The Bacon number of an actor or actress is the number of degrees of separation he or
she has from Bacon, as defined by the game. This is an application of the Erdős
number concept to the Hollywood movie industry. The higher the Bacon number, the
farther away from Kevin Bacon the actor is.
The computation of a Bacon number for actor X is a "shortest path" algorithm, applied to
the co-stardom network:
Kevin Bacon himself has a Bacon number of 0.
Those actors who have worked directly with Kevin Bacon have a Bacon number
of 1.
If the lowest Bacon number of any actor with whom X has appeared in any movie
is N, X's Bacon number is N+1.
Take for example Elvis Presley
Elvis was in Change of Habit (1969)
with Edward Asner
Edward Asner was in JFK (1991)
with Kevin Bacon
Therefore Edward Asner has a Bacon number of 1 and Elvis Presley has a Bacon
number of 2.
How does this have anything to do with our library class? Well, we are essentially
finding a path to any given author based on the collaboration that author had with other
authors. Remember this code?
Boolean isConnected(AuthorN a){
If (this.equals(a)){
Return true;
}
Else{
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents