zoukankan      html  css  js  c++  java
  • What’s up with the Graph Laplacian

    What’s up with the Graph Laplacian?

    来源

    作者:Jeremy Kun

    blog: Math ∩ Programming

    在数学上图和与图关联的某些矩阵的代数性质有很深的联系。

    这儿有一个这种现象的最简单的例子。一个无向图(G=(V,E)) 并且(A=(a_{i,j}))是它的的邻接矩阵。一个显著的事实是矩阵(A^k)的(i, j)项就是从i到j的长度为k的路径的数目。

    数学中在图的邻接矩阵上做线性代数研究的领域叫做 spectral graph theory。然而另一个和图相关的矩阵和邻接矩阵一样有用并且在谱图理论中受到很大的关注:图拉普拉斯矩阵。

    如果你是物理学家,电子工程师,或者应用数学专家,你会从偏微分方程中识别出拉普拉斯算子并且用自然的方式将它离散化,但是我不会假设你对那些学科相当熟悉。事实上,如果你不想考虑偏微分方程的连续系统,你仍然可以欣赏到图拉普拉斯算子的美妙。

    这儿有一个方法来研究它。(G=(V,E))是无向图,有(n=|V|)个节点。(f : V ightarrow R) 是图节点的函数。如果图节点是定义有序的(整篇博客都隐含这一点),那么(f) 可以被表示成一个实数向量。一个(f)的导数的自然的概念就是查看(f)的值沿着每条边的变化值。

    Definition: The graph gradient of (f) is the vector ( abla f = (f(v) - f(w))_{(v, w) in E})

    graph-gradient.png

    An example of the graph gradient.

    一个理解梯度值的方法是:(f)在某个顶点沿着某条边的方向的导数就是这条边上两个端点的值的变化量。这非常像是一个图版本的 discrete calculus

    但是不像离散微积分,图梯度不是一个非常优雅的对象。特别是差分算子(difference operator)暗含了一个在边上的方向,但是没有一个自然的方式来选择一个。我们可以任意挑选一个方向,但是那么做的话,梯度的一些 numerical properties 将不是清楚定义的(well-defined)。你也可以固定你的参考点作为一个单一的顶点,但是那样你就仅仅只能得到那个顶点延生的边上的方向。

    然而,一个不依赖方向选择的属性是 (squared) Euclidean norm of the gradient, (sum_{(v,w) in E} (f(v) - f(w))^2) . 事实上,符号改变后,平方的数值不会改变。

    也可以把 squared Euclidean norm 看作是 quadratic form, 它是一个有许多变量的多项式并且所有项的次数是2。 这些多项式总是可以写成矩阵的形式 (x^T A x) , 其中(x)是变量的向量,(A)是一个对称的标量的方形矩阵。

    我们特殊的 squared-gradient quadratic form 的矩阵部分就叫做 graph Laplacian, 并且我们可以用一个优雅的公式表示它。

    Definition: (G) be a graph with adjacency matrix (A). The (combinatorial) graph Laplacian $L(G) $ is the matrix (D-A), where (D) is the diagonal matrix whose ((i,i))-entry is the degree of vertex (i).

    laplacian-example.png

    An example of the combinatorial graph laplacian

    如果你喜欢前面梯度的思考方式,你应该把 graph Laplacian 看做是一个矩阵(编码成计算在图上的梯度和任意函数的gradient-norms的过程)。作为一个运算符,(L(G)) 将一个函数(f)映射成一个函数(g) 使得(g(i) = sum_{j : (i,j) in E} f(j) - f(i)) 。所以拉普拉斯算子(Laplacian)在顶点上强加了一个离开顶点的方向,并且 计算向外的导数的和。

    这应该足以激励人们研究拉普拉斯算子。并且这将会给予很大的回报。发掘出的主要的洞见是:Laplacian的eigenvalue和eigenvector可以提供有用的关于图结构的信息。

    Fourier transforms, for comparison

    人们可能想知道为什么你希望从graph Laplacian的特征值和特征向量中提取信息。所以我想简单地提一下,这是连续情况的直接类比:傅里叶分析。

    一个思考傅里叶分析的简洁的方式是从Laplace operator (Delta) 开始。

    (displaystyle Delta(f) = sum_{i=1}^n frac{partial^2 f}{partial x_i^2}.)

    这是一个在向量空间中至少两次可微函数的线性映射。一旦你爱上线性代数,你注定会问什么是(Delta) 的特征向量?答案就是它们是复指数,

    (f_s(t) = e^{2 pi i s t},)

    其中(t)是一个实数变量,s是一个固定的实数(频率)。一旦你理解了这些,傅里叶分析就是求不同的函数看起来是什么样子的当你在这个规则下将他们展开后,并且你可以从这些系数中推导出什么性质。对应特征向量 (f_s)的值 s 被解释成频率;一个函数(g) 在频率 s 下的系数就是内积(langle g, f_s(t) angle), 它对应复值函数是一个确定的整数,我不会现在把它写下来 (可以看这里

    对于graph Laplacian也是相同的原理,但是其傅里叶分析会更简单一点(特征向量不会依赖于任意所研究的图(the "graph" is just R))

    事实上,虽然我们不会详细地讨论它在这个博客中,你可以在图上做傅里叶分析用同样地方式,并且把图上的函数看作是“信号”,做低阶过滤等等。看这篇论文来了解更多信息。A taste: 一旦你写出 graph Laplacian(依赖于图) 的特征向量,你可以做相同的展开来获得一个图傅里叶变换。

    (GFT(f)(i) = langle f, v_i angle = sum_{j=1}^n f(j) v_i(j))

    这里的“函数”仅仅是向量,所以 inner product 是 normal dot product。抛开傅里叶分析,让我们深入研究 Laplacian的特征值和特征向量。

    Eigenvectors of the Laplacian

    先前我们定义了 Laplacian :(L=D-A)。但是如果你使用这个定义,你最终会得到一个额外的因子 deg(v) 。这在数学上没关系,但是会弄乱我们的公式。所以,让我们用一个归一化因子来重新定义 Laplacian 来保持整洁 (以防当你对在离散傅里叶变换时做归一化操作感到惊讶)。因为我们将会除以度,所以假设没有节点的度为零。

    Definition: Let (G) be a graph with adjacency matrix (A). The combinatorial graph Laplacian (L(G)) is the matrix (D-A) , where (D) is the diagonal matrix whose ((i,i)) entry is the degree of vertex (i). The graph Laplacian (mathscr{L}(G)) is the matrix whose ((i,j)) entry is:

    [mathscr{L}(G)(i,j) = egin{cases} 1 & { if } space i=j \ -1/sqrt{ {deg}(i) {deg}(j)} & { if } space i eq j space { and } space (i,j) in E \ 0 & { otherwise} end{cases}. ]

    Let’s update our example from earlier:

    normalized-laplacian-example.png

    The graph Laplacian (with truncated real-valued entries)

    现在 quadratic form 也被归一化了,归一化的方法是通过节点度加权。

    $ f^T mathscr{L} f = frac{sum_{(u,v)} (f(u) - f(v))^2}{sum_v f(v)^2 {deg}(v)} $

    有些作者把这叫做归一化 graph Laplacian。你可以下面的公式(mathscr{L} = D^{-1/2}LD^{-1/2}) 。大多数属性在两种类型的拉普拉斯算子之间来回平滑地转换。

    例如,最简单的 L 的特征向量是全1向量,其特征值为0。同样地,向量

    ((frac{1}{sqrt{{deg}(v)}})_{v in V} = D^{-1/2} mathbf{1})

    (mathscr{L})特征值为0的特征向量。这是“平凡的”特征向量,并不能给我们关于图的任何信息。

    It also happens that the eigenvectors minimize the quadratic form (x^T mathscr{L} x) (see here for a proof)。回顾一下,这是很明显的因为最小的特征值是零,并且这个 quadratic form 是平方和(非负的)。把0对应的特征向量称为平凡特征向量(v_0).

    下一个最小的特征值(lambda_1) ,并且它对应的特征向量(v_1),是非常重要的。(v_1)使得quadratic form 在所有 (v_0) 正交的向量中最小化。

    $lambda_1 = inf_{v perp v_0} v^T mathscr{L} v $

    (lambda_1) 提供了关于图 G 连通性 (connectedness)的信息。

    Theorem:(lambda_1 > 0) if and only if (G) is connected.

    Proof sketch: If (G) is disconnected, you can write the matrix for $mathscr{L} $ as two blocks with zeros elsewhere, meaning there are two linearly independent eigenvectors (those with all 1s on a block and zeros elsewhere). On the other hand, if (G) is connected and (x) is an eigenvector with eigenvalue zero, then the quadratic form (x^T L x = 0 = sum_{(u,v)} (x(u) - x(v))^2) (note I’m using the combinatorial Laplacian for simplicity). This implies all (x(u) - x(v) = 0) for every edge, but there is a path connecting any two pair of vertices, so all (x(u)) are equal.

    更重要的是,(lambda_1)随着 G 变得更加连通而增长!下面的图展示了(lambda_1)是如何增长的当你向图添加边时。注意开始时只有100个节点的环,然后打乱剩下的边并且随机向图中添加。

    increasing_eigenvalue.png

    The growth rate of the second smallest eigenvalue as the density of the graph increases.

    最右端的图是当加入所有的边( G此时是完全图)的情况,这是(lambda_1=1) (这是一个可以证明的定理)。

    所有这些都大致告诉我们(lambda_1)表示了一种对图的“连通性度量”。更好的是,对应的特征向量通过下面的定理提炼了这种度量。

    Theorem (informal): Let (G) be a graph and $L(G) $ its normalized graph Laplacian. Let (v_1) be the eigenvector of (L(G)) corresponding to the second smallest eigenvalue of (L(G)). Sorting the vertices in (G) according to the corresponding values of (v_1) approximates the sparsest cut of (G).

    未完待续

  • 相关阅读:
    ‘Host’ is not allowed to connect to this mysql server
    centos7安装mysql
    further configuration avilable 不见了
    Dynamic Web Module 3.0 requires Java 1.6 or newer
    hadoop启动 datanode的live node为0
    ssh远程访问失败 Centos7
    Linux 下的各种环境安装
    Centos7 安装 python2.7
    安装scala
    Centos7 安装 jdk 1.8
  • 原文地址:https://www.cnblogs.com/ZeroTensor/p/10234953.html
Copyright © 2011-2022 走看看