参考文章:Introduction to Spectral Graph Theory and Graph Clustering
作者:Chengming Jiang,ECS 231 Spring 2016 University of California, Davis
本文的目的是进行计算机图像分割:

图1 图像分割
一、预备知识
关于图(G)、度矩阵(D)、邻接矩阵(A)皆在上一篇理解中交代过,现补充一些新的定义:
1、权重矩阵
A weighted graph is a pair G=(V,W) where
-
V={vi} is a set of vertices and ∣V∣=n;
-
W∈Rn×n is called weight matrix with
wij={wij≥00if i̸=ji=j
W是权重矩阵,V是顶点,它们构成对G=(V,W),即是权重图G。
The underlying graph of G is G^=(V,E) with
E={{vi,vj}∣wij>0}
- If wij∈{0,1},W=A, the adjacency matrix of G^
- Since wii=0, there is no self-loops in G^
W是对A的一个扩展,当wij∈{0,1},W即是A。定义W后,需要重新定义顶点的度(degree of a vertex)和度矩阵(degree matrix):
d(vi)=j=1∑nwijdegree of vi
Let d(vi)=diD=D(G)=diag(d(v1),⋯,d(vn))=diag(d1,⋯,dn)
2、A的体积(Volume)
对于V的一个子集A(A⊆V),定义A的体积(Volume):
vol(A)=vi∈A∑d(vi)=vi∈A∑j=1∑nwij
即A中所有顶点的度和,若A中所有顶点都是孤立的(isolated),则vol(A)=0,举例如下:

图2 vol(A)的计算方法
3、顶点集间的连接(links)
Given two subsets of vertices A,B⊆V, we define the links links(A,B) by
links(A,B)=∑vi∈A,vj∈Bwij
Remarks:
- A and B are not necessarily distinct;
- Since W is symmetric, links(A,B)=links(B,A)
-
vol(A)=links(A,V)
有了连接(links)定义,就可以定义分割(cut),它的定义如下:
cut(A)=links(A,V−A)
在连接(links)基础上,还可以定义一个量assoc,如下:
assoc(A)=links(A,A)
即A中顶点自己的连接。cut是A和外部的links,assoc是A与内部的links。因此有:cut(A)+assoc(A)=vol(A)
4、Graph Laplacian
对于权重图 G=(V,W),the (graph) Laplacian L of G is defined by
L=D−W
Laplacian具有以下的属性:
-
xTLx=21∑i,j=1nwij(xi−xj)2 for ∀x∈Rn,这是一个二次型
-
L≥0 if wij≥0 for all i,j;
- L⋅1=0
- If the underlying graph of G is connected, then
0=λ1≤λ2≤λ3⋯≤λn
- If the underlying graph of G is connected, then the dimension of the nullspace of L is 1.
图的聚类(Graph clustering)
1、k-way partitioning
给定一个权重图 G=(V,W),要找到一个对V的分割,使以下条件得到满足:
- A1∪A2⋯∪Ak=V
- A1∩A2⋯∩Ak=∅
- for any i and j, the edges between (Ai,Aj) have low weight and the edges within Ai have high weight.
要使分割后各子集之间的edges的权重最小,对于2-way分割有:
cut(A)=links(A,Aˉ)=vi∈A,vj∈Aˉ∑wij, where Aˉ=V−A
分割问题转化成了优化问题:mincut(A)=minvi∈A,vj∈Aˉ∑wij

图3 通常最小化分割会得到不平衡的分割
通常最小化分割会得到不平衡的分割,因而引入“Normalized cut”,定义如下:
Ncut(A)=vol(A)cut(A)+vol(Aˉ)cut(Aˉ)
对图3采用归一化分割会得到:

图4 采用Normailized cut
定义一个示性矢量(indicator vector)x=(x1,x2,⋯,xn),有:
xi={1−1if vi∈Aif vi∈Aˉ
则有:
- (1+x)TD(1+x)=4∑vi∈Adi=4⋅vol(A)
- (1+x)TW(1+x)=4∑vi∈A,vj∈Awij=4⋅assoc(A)
-
(1+x)TL(1+x)=4⋅(vol(A)−assoc(A))=4⋅cut(A)
以下是处理(1-x)与上对应
- (1−x)TD(1−x)=4∑vi∈Aˉdi=4⋅vol(Aˉ)
- (1−x)TW(1−x)=4∑vi∈Aˉ,vj∈Aˉwij=4⋅assoc(Aˉ)
-
(1−x)TL(1−x)=4⋅(vol(Aˉ)−assoc(Aˉ))=4⋅cut(Aˉ)
于是Ncut(A) 可以被写成(公式的书写太繁琐了,我直接贴了过来):



要求解这个最优问题,需引入变分原则(Variational principle):


由此,我们可以通过迭代的方法,求得由小到大排列的特征值和它对应的特征矢量。每个特征矢量就是一个分割。
《Normalized cuts and image segmentation》的例子:

图5 原图
将原图看成是graph,并定义权重:


图6 权重图G=(V,W)
求Normailized cut 的第二个特征矢量,及对应分割:
