六程度的凯文培根

这里

照片由sagindie。这项工作分布在a下面创造性的公共许可证

What do Leonard Nimoy, Stana Katic, and Robert Downey Jr. have in common? They all have a Bacon number of 2. The Six Degrees of Kevin Bacon, a game created early in 1994 by three Albright College students, is a classic problem in graph theory. The object of the game is to find the shortest path between a given actor and Kevin Bacon, where an intermediary connection can only be made between actors who have appeared together in a movie. For example, Stana Katic was inS.tilettoW.一世TH.Kelly Hu, who was in我呼吸的空气与凯文培根。虽然只有一个患有培根0(凯文培根本人)的人,但大多数涉及好莱坞电影业的个人都有6或更少的培根数。截至2013年4月28日,培根的甲骨文computed that of the actors listed on the互联网电影数据库,1,605,485中只有329个培根数为7或更高:

培根数 人们#
0. 1
1 2769
2 305215.
3. 1021901
4. 253177
5. 20.0.6.0.
6. 20.3.3.
7. 297.
8. 25.
9. 7.

In fact, using this table, we find that the average Bacon number is 2.994.

But why use Kevin Bacon as the “center” of the Hollywood universe? It all started when three college friends, Brian Turtle, Mike Ginelli, and Craig Fass, were snowed in one night watching movies on TV.FootlooseW.as followed by水银那W.一世TH.a commercial for a third Kevin Bacon movie coming on between the other two. This impromptu Kevin Bacon marathon caused the three friends to remark on the multitude of movies which included Bacon. It seemed like he was in everything! This prompted the question: Had Bacon ever worked with Robert De Niro? This was before the movie枕木已被释放,所以答案是否定的。然而,德尼罗在铁面无私与凯文·斯托克人在一起JFK.有培根。所以比赛六程度凯文培根出生。

Turtle, Ginelli, and Fass wrote a letter to Jon Stewart, explaining the game and how “Kevin Bacon was the center of the entertainment universe.” In the months that followed, they appeared onThe Jon Stewart Show霍华德斯特恩秀解释游戏并最终发布一本书,六程度的凯文培根。今天,游戏是众所周知的,既是与朋友一起玩的有趣游戏,以及许多计算机科学课程中的经典作业问题。

六程度的凯文培根比赛实际上是图形理论的问题。每个actor都被分配给顶点,如果在电影中出现在两个演员之间,则在两个演员之间添加边缘。然后,将给定的演员连接到凯文培根的问题在最少的步骤中成为传统的图形理论问题 - 找到两个顶点之间的最短路径。有许多最短的路径算法可以应用于这个问题。例如,可以使用Dijkstra的算法,其解决积极加权的最短路径问题。在运行Dijkstra的算法之后,我们将在给定的源顶点(即,与我们的应用程序对应的顶点相对应的顶点)和所有其他顶点之间具有最低成本(即最短路径)的路径。但是,在此上下文中使用Dijkstra的算法过多。Dijkstra的算法最适合每个边缘具有相关的非环境长度/重量的情况,并且目标是找到最小化总长度的路径。对于六程度的凯文培根比赛,我们只关注在所使用的连接电影(边缘)的数量方面找到最短的路径,因此每个边缘都可以被认为是重量1.因此,我们想使用TH.e breadth-first search algorithm, which will solve the problem and be more time efficient than Dijkstra’s algorithm.

The breadth-first search (BFS) algorithm operates by processing vertices in layers: Those closest to the source vertex are evaluated first, and those most distant are evaluated last. The algorithm uses a “roving eyeball” approach, where the eyeball moves from vertex to vertex, starting at the source (Kevin Bacon). Associated with each vertex is a numberD_i,这是从源顶点到顶点的成本一世。在我们的申请中,费用D_i运行BFS算法是与顶点相关联的actor的培根数一世。如果S.是源顶点,我们初始化成本d_s = 0.d_i = \ infty对所有人一世\neq S。算法如下所示,眼球从源顶点开始:

1.如果V.是眼球目前正在上的顶点,然后,所有W.邻近V., 我们设置D_w = D_v + 1一世fd_w = \ infty

2.将眼球移动到另一个顶点你(which has not already been visited by the eyeball) such thatD_u \equiv D_v。如果是不可能的话,我们搬到了一个你满足D_u = D_v + 1。如果TH.at is not possible, we are done.

该算法使用队列数据结构将中间结果存储在图中的眼球移动。当顶点的距离降低(只能发生一次)时,它被放置在队列中,以便眼球将来可以访问它。当距离初始化为零时,源顶点放置在队列中。

在BFS算法中,除了被指定为源顶点的事实之外,与Kevin Bacon相关联的顶点没有特别的特别之处。我们可以像一个不同的演员那样容易地开始,这将给我们一个新的“中心”的好莱坞宇宙。但我们可以比凯文培根更好吗?根据这一点培根的甲骨文,答案是肯定的!通过比较平均人格数(例如,对于Kevin Bacon我们将使用所有“培根数”的加权平均值,而对于Sean Connery,我们将使用所有“Connery Number”的加权平均值,即可排名。截至2013年4月28日,Kevin Bacon是370TH.best center, where actors are compared based on their average number. Can you guess who is the best “center” of the Hollywood universe? Head on over the the list of1000个最佳中心和find out!

来源:

头像

关于Stephanie Blanda.

斯蒂芬妮是数学博士学位。宾夕法尼亚州立大学的计算科学中有一个未成年人的学生。她获得了B.S.来自黎巴嫩山谷学院,在那里她在数学和计算机科学中双重主修。目前,Stephanie正在研究两个粘性流体的界面在剪切流量下,具体与风发海浪的应用。
This entry was posted in数学游戏Math in Pop Culture。Bookmark thepermalink

1回应六程度的凯文培根

  1. 头像 凯文培根 说:

    好的文章
    这是一篇非常丰富的文章。

Leave a Reply to凯文培根取消回复

Your email address will not be published.必需的地方已做标记*

不允许HTML标记。