• 图数据挖掘:小世界网络模型和分散式搜索


    1 六度分隔理论

    先来看两个有趣的例子。我们建立一个好莱坞演员的网络,如果两个演员在电影中合作或就将他们链接起来。我们定义一个演员的贝肯数(bacon number)是他们与演员凯文·贝肯有多少步的距离,贝肯数越高,演员离凯文·贝肯越远。研究发现,直到2007年12月,最高(有限)的贝肯数仅为8" role="presentation">8,且大约只有12%的演员没有路径链接到凯文·贝肯。

    此外,在学术合作中,埃尔德什数(Erdős number)被用来描述数学论文中一个作者与Pual Erdős的“合作距离”(Pual Erdős就是我们在博客《图数据挖掘:Erdos-Renyi随机图的生成方式及其特性》中提到的那位巨佬)。菲尔茨奖获得者的埃尔德什数中位数最低时为3,CS224W讲师Jure Leskovec(也是一位图数据挖掘大佬)的埃尔德什数为3.

    看完这两个例子我们不禁会思考,两个人之间的典型最短路径长度是多少呢?事实上,哈佛大学心理学教授斯坦利·米尔格拉(Stanley Milgram)早在1967年就做过一次连锁实验[1],他将一些信件交给自愿的参加者,要求他们通过自己的熟人将信传到信封上指明的收信人手里。他发现,296封信件中有64封最终送到了目标人物手中。而在成功传递的信件中,平均只需要5次转发,就能够到达目标。也就是说,在社会网络中,任意两个人之间的“距离”是6。这就是所谓的六度分隔理论,也称小世界现象。尽管他的实验有不少缺陷,但这个现象引起了学界的注意。

    2 小世界网络模型

    六度分隔理论令人吃惊的地方其实还不在于其任意两个人之间的路径可以如此之短,而是在保证路径如此之短的情况下还保证了高的聚集性。

    短路径从直觉上可以理解,因为每个人认识了超过100" role="presentation">100个能直呼其名的朋友,而你的每个朋友除你之外也至少有100" role="presentation">100个朋友,原则上只有两步之遥你就可以接近超过100×100=10000" role="presentation">100×100=10000个人。然而问题在于,社会网络呈三角形态,即三个人相互认识,也就是说你的100" role="presentation">100个朋友中,许多人也都相互认识。因此,当考虑沿着朋友关系构成的边到达的节点时,很多情况是从一个朋友到另一个朋友,而不是到其它节点。前面的数字10000" role="presentation">10000是假设你的100" role="presentation">100个朋友连接到100" role="presentation">100个新朋友,如果不是这样则经过两步你能达到的朋友数将大大减小。

    由此看来,小世界现象从局部角度看社会网络的个体被高度聚集,却还能保证任意两个人之间的路径如此之短,确实令人吃惊。

    2.1 权衡聚类系数和图的直径

    正如我们前面所说,聚类系数与图任意两点间的最短路径(可以通过图的直径来体现)有着矛盾的关系。比如在下面所示的这个网络虽然直径小,但聚类系数低:

    而下图这个具有“局部”结构的网络聚类系数虽高(即满足三元闭包,我朋友的朋友也是我朋友),但其网络直径大:

    我们是否可以同时拥有高的聚类系数与小的直径呢?直觉上,我们发现聚集性体现着边的局部性(locality),而随机产生的边会产生一些捷径(shortcuts),如下图所示:

    这样,我们在保持边聚集性的条件下,随机地添加一些边,那么就能够完成要求了。根据这个思想,人们提出了许多小世界模型,我们接下来介绍Watts-Strogatz模型。

    2.2 Watts-Strogatz模型

    Watts-Strogatz提出的小世界模型[2]包含两个部分:

    (1) 低维的正则网格(lattice)
    首先需要一个低维的正则网格模型来满足高的聚类系数。在下面的例子中我们使用一维的环状网络(ring)作为网格。

    (2) 重新排布边(rewire)
    接着在网格的基础上添加/移除随机边来创造捷径,以连接网格的远程部分。每条边有概率为p" role="presentation">p被随机地重新排布(将其一端点连接到一个随机节点)。

    如下就是一个小世界网络的例子:

    边的重新排布允许我们在正则网格和随机图之间形成一种“插值”:

    如下图所示,我们直观地发现如果想破坏聚类结构需要大量的随机性注入(即边随机重排的概率大),然而只需要少量的随机性注入就可以产生捷径。

    接下来我们来根据一个实例分析其聚类系数和直径。我们基础网格模型选用方格,每个节点有一个随机产生的长距离边(long-range edge),如下图所示:

    对于正中央的那个节点,我们有其聚类系数

    Ci=2eiki(ki1)=212980.33" role="presentation">Ci=2eiki(ki1)=212980.33

    我们接下来来证明其直径是O(logn)" role="presentation">O(logn)的。

    我们将每个2×2" role="presentation">2×2都子图合并为一个超节点,以形成一个超图,如下图所示:

    每个超节点有4条边伸出去,这是一个4-正则随机图。我们在每条长距离边上添加最多两步(必须遍历内部节点) 将每个超节点之间的最短路径转变为真实图中的路径。
    于是我们得到该模型的直径为O(2logn)" role="presentation">O(2logn)

    3 分散式搜索

    接下来我们考虑另外一个问题:即如何找到到指定目标节点的最短路径,即对网络进行导航(navigation)。

    3.1 问题定义

    我们设开始节点为s" role="presentation">s,目标节点为t" role="presentation">t。消息要从节点s" role="presentation">s开始,沿着网络中的边最终被传递到目标节点t" role="presentation">t。的起初节点s" role="presentation">s只知道其朋友的位置和目标的位置,且除了自己的链接之外,并不知道其它节点的链接情况。路径上每个中间节点也都仅具有这种局部信息,而且它们必须选择某个邻居转发该消息。这些选择相当于寻找一条从s" role="presentation">st" role="presentation">t的路径。我们将搜索时间(search time)T" role="presentation">T定义为消息从s" role="presentation">s转发到t" role="presentation">t所需要的步数。

    3.2 Watts-Stogatz模型中的搜索

    Watts-Stogatz模型即我们前面提到的,每个节点都有一条随机边的二维网格:

    由于是小世界网络,其直径为O(logn)" role="presentation">O(logn)

    然而令人遗憾的是,尽管存在长度仅为O(logn)" role="presentation">O(logn)步的路径,但Watts-Stogatz模型中的去中心化搜索算法在期望上需要n2/3" role="presentation">n2/3步来到达目标节点t" role="presentation">t,这也就意味着Watts-Stogatz模型是不可搜索的(is not searchable)。

    证明

    我们先来证明一维的情况。我们想要证明Watts-Stogatz是不可搜索的,则需要为其搜索时间证明一个下界(lower bound)。

    我们设置n" role="presentation">n个节点在一个环状网络(ring)上,且每个节点都有一个有向随机边。如下图所示:

    我们接下来会证明对环状网络(一维网格),搜索时间TO(n)" role="presentation">TO(n)

    我们采用的证明策略为延期决定原则(principle of defered decision),即我们假设仅在到达某个节点后才碰到随机长距离链接。

    我们设Ei" role="presentation">Ei是一个随机事件,表示从节点i" role="presentation">i发出的长距离链接指向某个在t" role="presentation">t周围间隔I" role="presentation">I中的节点(间隔宽度为2x" role="presentation">2x个节点),如下图所示:

    接着我们有

    P(Ei)=2xn12xn(n)" role="presentation">P(Ei)=2xn12xn(n)

    设随机事件E" role="presentation">E为算法访问的前k" role="presentation">k个节点中,有一个拥有到I" role="presentation">I的链接(任意一个节点都行),如下图所示:

    P(E)=P(ikEi)ikP(Ei)=k2xn" role="presentation">P(E)=P(ikEi)ikP(Ei)=k2xn

    我们选择k=x=12n" role="presentation">k=x=12n,则:

    P(E)2(12n)2n=12" role="presentation">P(E)2(12n)2n=12

    这实际上也就意味着在12n" role="presentation">12n步可以跳到t" role="presentation">t周围12n" role="presentation">12n步内的概率12" role="presentation">12

    假设初始点s" role="presentation">sI" role="presentation">I之外,且事件E" role="presentation">E没有发生(最先访问的k" role="presentation">k个节点都没有链接指向I" role="presentation">I),则搜索算法必须要花费Tmin(k,x)" role="presentation">Tmin(k,x)步来到达t" role="presentation">t。这两个下界分别对应以下两种情况:
    Case 1 恰好在我们访问k" role="presentation">k个节点后,就碰到了一个很好的远程链接,此时共花费k" role="presentation">k步。
    Case 2 x" role="presentation">xk" role="presentation">k重叠了,由于E" role="presentation">E没有发生,我们必须至少要走x" role="presentation">x步。

    这两种情况分别如下图所示:

    再加上根据前文的推论,我们有

    TP(E)(# steps )+P( not E)min{x,k}" role="presentation">TP(E)(# steps )+P( not E)min{x,k}

    而我们前面已经说明了当x=k=12n" role="presentation">x=k=12n时,E" role="presentation">E12" role="presentation">12的概率不发生。如果E" role="presentation">E不发生,则我们必须再走12n" role="presentation">12n的步数才能到达t" role="presentation">t,如下图所示:

    则到达t" role="presentation">t的期望时间

    TP(notE)min{x,k}=1212n=14n" role="presentation">TP(notE)min{x,k}=1212n=14n

    得证。

    同理我们可以证明对d" role="presentation">d维网格,有TO(nd/(d+1))" role="presentation">TO(nd/(d+1))

    既然Watts-Stogatz模型是不可搜索的,我们如何构建一个可搜索的小世界图呢?接下来我们来介绍Watts-Stogatz模型的扩展版——Kleinberg模型。该模型同时具备我们所需要的两种性质:网络包含短路径,且通过分散搜索在可接受时间内发现这些短路径。

    3.3 Kleinberg模型中的搜索

    Kleinberg模型[3]基于以下直觉:长距离链接(long range links)并不是随机的,它们是根据节点的地理位置分布来的,因此我们可以使每个节点之间的随机边以距离衰减的方式生成。

    八卦:Kleinberg也是个大牛,在ICM上做了题为“ Complex networks and decentralized search algorithms”的45分钟报告。

    该模型仍然是基于网格的,且每个节点有一个长距离链接,不过该模型创新性地定义了节点u" role="presentation">u长距离链接到v" role="presentation">v的概率为:

    P(uv)=d(u,v)αwu d(u,w)α" role="presentation">P(uv)=d(u,v)αwu d(u,w)α

    这里d(u,v)" role="presentation">d(u,v)u" role="presentation">uv" role="presentation">v之间的网格距离(即一个节点沿着到相邻节点的边到另一节点的步数),α0" role="presentation">α0。分母wu d(u,w)α" role="presentation">wu d(u,w)α实际上是一个和d" role="presentation">d无关的归一化常数(后面我们会详细讨论),用于表示u" role="presentation">u到所有其它节点的距离和,因此我们实际上有:

    P(uv)d(u,v)α" role="presentation">P(uv)d(u,v)α

    在不同α" role="presentation">α的设置下,P(uv)" role="presentation">P(uv)随着d" role="presentation">d变化示意图如下:

    α=0" role="presentation">α=0时,P(uv)" role="presentation">P(uv)服从均匀分布,即节点之间的边完全随机产生,此时Kleinberg模型退化到Watts-Stogatz模型。

    接下来我们介绍如何在Kleinberg模型中做搜索。我们接下来会证明在一维情况下,当α=1" role="presentation">α=1时,从s" role="presentation">st" role="presentation">t的期望步数为O(log(n)2)" role="presentation">O(log(n)2)

    我们假设某个节点v" role="presentation">v满足d(v,t)=d" role="presentation">d(v,t)=d,并设置间隔I=d" role="presentation">I=d

    则我们可以证明从v" role="presentation">vI" role="presentation">I中的某节点存在长距离链接的概率满足

    P( Long range  link from v points to a  node in I)=O(1lnn)" role="presentation">P( Long range  link from v points to a  node in I)=O(1lnn)

    这个定理非常酷,这是因为当d" role="presentation">d增大时,I" role="presentation">I会变得宽,但是该概率却和d" role="presentation">d是独立的。

    下面我们来看该定理的证明。

    首先我们有

    P(vw)=d(v,w)1uv d(v,u)1" role="presentation">P(vw)=d(v,w)1uv d(v,u)1

    这里w" role="presentation">w为区间I" role="presentation">I中的一个点,归一化常数

    uvd(v,w)1= all possible  distancess dfrom 1n/221d=2d=1n/21d2lnn" role="presentation">uvd(v,w)1= all possible  distancess dfrom 1n/221d=2d=1n/21d2lnn

    这里第一个等式成立是因为每个可能的距离d" role="presentation">d都对应两个节点,而从每个点产生链接的概率都为1d" role="presentation">1d。最后一个不等式成立是因为d=1n/21d1+1n/2dxx=1+ln(n2)=lnn" role="presentation">d=1n/21d1+1n/2dxx=1+ln(n2)=lnn,即用y=1x" role="presentation">y=1x 下方的面积来确定调和级数的上界,如下图所示:

    因此,我们从有v" role="presentation">v链接到间隔I" role="presentation">I的概率

    P(v points to I)=wIP(vw)wId(v,w)12lnn=12lnnwI1d(v,w)12lnnd23d=13lnn=O(1lnn)" role="presentation">P(v points to I)=wIP(vw)wId(v,w)12lnn=12lnnwI1d(v,w)12lnnd23d=13lnn=O(1lnn)

    其中对wI1d(v,w)" role="presentation">wI1d(v,w),我们考虑到所有项都有1d(v,w)23d" role="presentation">1d(v,w)23d,故在此基础上进行放缩。

    因此,我们有v" role="presentation">v链接到t" role="presentation">t周围I" role="presentation">I间隔(宽度为d2" role="presentation">d2)内的概率为(这里d=d(v,t)" role="presentation">d=d(v,t)

    P(v points to I)=O(1lnn)" role="presentation">P(v points to I)=O(1lnn)

    得证。

    这实际上就意味着在期望上我们只需要步数stepln(n)" role="presentation">stepln(n)就能到达间隔I" role="presentation">I,因此就将到t" role="presentation">t的距离削减了一半。而距离被减半最多log2(n)" role="presentation">log2(n)次,故到达t" role="presentation">t的期望时间为O(log2(n)2)" role="presentation">O(log2(n)2)

    注: 事实上在2D网格的情况下,我们有距离目标距离在d/2" role="presentation">d/2以内的节点数语d2" role="presentation">d2成比例,即nodes(I)d2" role="presentation">nodes(I)d2。这表明要获得和一维情况下同样的“抵消”效果,需要v" role="presentation">v连接到每个其它节点w" role="presentation">w的概率应该与d(v,w)2" role="presentation">d(v,w)2成比例,这样我们也有结论P(v points to I)>lnn" role="presentation">P(v points to I)>lnn

    3.4 多种模型的搜索时间对比和反思

    总结一下,不可搜索的模型对应的搜索时间为O(nλ)" role="presentation">O(nλ),其代表为Watts-Stogatz网络(O(n23)" role="presentation">O(n23))、Erdős-Rényi网络(O(n)" role="presentation">O(n));可搜索模型对应的搜索时间为O((logn)γ)" role="presentation">O((logn)γ),其代表为Kleinberg模型(O(log2(n)2)" role="presentation">O(log2(n)2))。

    由于小世界图的直径为O(logn)" role="presentation">O(logn),故Kleinberg模型的搜索时间关于logn" role="presentation">logn是多项式阶增长的,然而Watts-Stogatz模型关于logn" role="presentation">logn是指数阶增长的。

    前面我们已经证明,在一维情况下当距离节点距离项d(u,v)α" role="presentation">d(u,v)α中的α=0" role="presentation">α=0时(也即Watts-Strogatz模型),我们需要On" role="presentation">On步,当α=1" role="presentation">α=1时,我们需要O(log(n)2)" role="presentation">O(log(n)2)步。事实上,我们有搜索时间和指数α" role="presentation">α的关系如下:

    可见当α=2" role="presentation">α=2时分散搜索最有效(此时随机链接遵循反平方分布)。

    过小和过大的α" role="presentation">α形象化的展示如下图所示:

    可接过小的α" role="presentation">α意味着有太多的长距离链接,过大的α" role="presentation">α则意味着又太多的短距离链接。

    最后,让我们来思考一下为什么P(uv)d(u,v)dim" role="presentation">P(uv)d(u,v)dim会如此有效呢?因为该分布在所有“分辨率尺度”上都是近似均匀的,和u" role="presentation">u之间距离为d" role="presentation">d的节点数量会以ddim" role="presentation">ddim倍率增长,而这会产生一种抵消作用,导致每条边产生链接的概率值和d" role="presentation">d独立(正如我们前面分析二维情况时所说)。如下图所示:

    参考

    [1] Milgram S. The small world problem[J]. Psychology today, 1967, 2(1): 60-67.
    [2] Watts D J, Strogatz S H. Collective dynamics of ‘small-world’networks[J]. nature, 1998, 393(6684): 440-442.
    [3] Kleinberg J. The small-world phenomenon: An algorithmic perspective[C]//Proceedings of the thirty-second annual ACM symposium on Theory of computing. 2000: 163-170.
    [4] http://web.stanford.edu/class/cs224w/
    [5] Easley D, Kleinberg J. Networks, crowds, and markets: Reasoning about a highly connected world[M]. Cambridge university press, 2010.
    [6] Barabási A L. Network science[J]. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 2013, 371(1987): 20120375.


    __EOF__

  • 本文作者: 猎户座
  • 本文链接: https://www.cnblogs.com/orion-orion/p/16854012.html
  • 关于博主: 研究生小菜一枚,机器学习半吊子,并行计算混子。
  • 版权声明: 欢迎您对我的文章进行转载,但请务必保留原始出处哦(*^▽^*)。
  • 声援博主: 如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。
  • 相关阅读:
    并发中级(第二篇)
    高云FPGA系列教程(8):ARM串口数据接收(中断和轮询方式)
    LVS负载均衡集群
    Oracle数据泵跨大版本迁移数据库
    电子数据取证-流程与技术
    SQL注入
    金仓数据库KingbaseES客户端编程接口指南-JDBC(4. JDBC 创建语句对象)
    C4D vs Blender:哪个更适合你的需求?
    AI 换装之OOTDiffusion
    如何进行复盘?
  • 原文地址:https://www.cnblogs.com/orion-orion/p/16854012.html