Random Walk Kernel¶
The most well-studied family of graph kernels is probably the random walk kernels which quantify the similarity between a pair of graphs based on the number of common walks in the two graphs [], [], [], [], [], [SB15].
Kernels belonging to this family have concentrated mainly on counting matching walks in the two input graphs. There are several variations of random walk kernels. The \(k\)-step random walk kernel compares random walks up to length \(k\) in the two graphs. The most widely-used kernel from this family is the geometric random walk kernel [] which compares walks up to infinity assigning a weight \(\lambda^k\) (\(\lambda < 1\)) to walks of length \(k\) in order to ensure convergence of the corresponding geometric series. We next give the formal definition of the geometric random walk kernel. Given two node-labeled graphs \(G_i=(V_i,E_i)\) and \(G_j=(V_j,E_j)\), their direct product \(G_\times=(V_\times,E_\times)\) is a graph with vertex set:
and edge set:
Performing a random walk on \(G_{\times}\) is equivalent to performing a simultaneous random walk on \(G_i\) and \(G_j\). The geometric random walk kernel counts common walks (of potentially infinite length) in two graphs and is defined as follows.
Definition: Geometric Random Walk Kernel¶
Let \(G_i\) and \(G_j\) be two graphs, let \(A_\times\) denote the adjacency matrix of their product graph \(G_\times\), and let \(V_\times\) denote the vertex set of the product graph \(G_\times\).
Then, the geometric random walk kernel is defined as
where \(I\) is the identity matrix, \(e\) is the all-ones vector, and \(\lambda\) is a positive, real-valued weight. The geometric random walk kernel converges only if \(\lambda < \frac{1}{\lambda_\times}\) where \(\lambda_\times\) is the largest eigenvalue of \(A_{\times}\).
Direct computation of the geometric random walk kernel requires \(\mathcal{O}(n^6)\) time. The computational complexity of the method severely limits its applicability to real-world applications. To account for this, Vishwanathan et al. proposed in [] four efficient methods to compute random walk graph kernels which generally reduce the computational complexity from \(\mathcal{O}(n^6)\) to \(\mathcal{O}(n^3)\). Mahé et al. proposed in [] some other extensions of random walk kernels. Specifically, they proposed a label enrichment approach which increases specificity and in most cases also reduces computational complexity. They also employed a second order Markov random walk to deal with the problem of “tottering”. Sugiyama and Borgwardt focused in [SB15] on a different problem of random walk kernels, a phenomenon referred to as “halting”.
Next follow two implementations of this kernel (one for unlabeled graphs and one for graphs with discrete node labels)
|
The random walk kernel class. |
|
The labeled random walk kernel class. |