Generalized Shortest Path Kernel on Graphs

Linus Hermansson, Fredrik D. Johansson, Osamu Watanabe

TL;DR

This paper introduces a new graph kernel, the Generalized Shortest Path (GSP) kernel, which improves graph classification accuracy by considering not only the length but also the number of shortest paths between node pairs. Empirically and theoretically, the GSP kernel shows superior performance over the standard Shortest Path (SP) kernel, particularly in distinguishing graphs with different cluster structures.

What Problem Does This Paper Address?

Classifying graphs based on their structural properties is a crucial task in many domains, from predicting chemical toxicity to analyzing biological networks. Graph kernels, often used with Support Vector Machines (SVMs), are a powerful tool for this, but their effectiveness varies greatly depending on the graph types and the kernel's design. Existing graph kernels often focus on specific graph properties, like shortest path lengths. However, the authors identify a limitation in kernels that solely rely on shortest path lengths, arguing that the number of such paths also carries significant structural information. They aim to bridge this gap by developing a kernel that leverages both aspects.

Methods

The core contribution is the Generalized Shortest Path (GSP) kernel. This kernel extends the traditional Shortest Path (SP) kernel by incorporating the count of shortest paths between node pairs, in addition to their lengths.

  • Shortest Path (SP) Kernel: This kernel compares graphs based on the distribution of shortest path lengths between all node pairs. It can be represented by a feature vector where each dimension corresponds to the count of node pairs at a specific shortest path distance.
  • Generalized Shortest Path (GSP) Kernel: This novel kernel enhances the feature vector by adding dimensions that represent the count of node pairs having a specific shortest path length and a specific number of shortest paths. Essentially, it provides a more granular description of the graph's connectivity.
  • Theoretical Analysis: The authors provide a theoretical framework to explain their empirical findings. They estimate the expected feature vectors for both the SP and GSP kernels under specific random graph models. This analysis helps to understand why the GSP kernel offers better discriminative power.

Datasets

The paper uses synthetic datasets generated from two well-known random graph models:

  • Erdős-Rényi (G(n, p)) model: Used to generate "one-cluster" graphs.
  • Planted Partition model (G(n/2, n/2, p, q)): Used to generate "two-cluster" graphs, where nodes are divided into two partitions, and edges are more likely to form within partitions than between them.

The task is to classify whether a given graph belongs to the one-cluster or two-cluster family. Datasets were generated with varying graph sizes ($n \in \{200, 400, 600, 800, 1000\}$) and different parameters for the planted partition model ($p_2$ relative to $p_1$), creating varying degrees of separability between the two graph classes.

Key Insights and Ideas

  • Number of shortest paths matters: The core insight is that simply counting shortest path lengths is insufficient for certain graph classification tasks. The number of ways to achieve a shortest path provides crucial discriminatory information.
  • GSP kernel's discriminative power: The GSP kernel creates feature vectors that are more distinct between graphs with different cluster structures compared to the SP kernel. This enhanced separability directly translates to better classification performance.
  • Theoretical justification for empirical results: The paper doesn't just present empirical evidence; it offers a theoretical analysis that explains why the GSP kernel works better. This involves analyzing the expected feature vectors and demonstrating how their distributions differ for the two graph classes.
  • Approximation for analysis: The authors develop and utilize a "relative closeness" approximation ($\approx_{rel}$) to simplify theoretical analysis, particularly for large graphs, while still capturing essential asymptotic behavior.

Key Results

  • Empirical Performance: The GSP kernel consistently outperforms the SP kernel on the task of classifying one-cluster versus two-cluster graphs. The improvement is particularly significant when the two-cluster graphs are more distinct from the one-cluster graphs (i.e., when $p_2$ is substantially larger than $p_1$). For instance, in some cases with $p_2 = 1.4p_1$, the GSP kernel achieved an accuracy increase of over 20%, and for $n=200$, it was over 40%.
  • Theoretical Findings: The theoretical analysis supports the empirical results by showing that the expected SPI feature vectors for the two graph classes are relatively similar, while the expected GSP feature vectors exhibit more significant differences, particularly in their distribution shapes (e.g., a double-peak structure for two-cluster graphs versus a single peak for one-cluster graphs).

Limitations and Future Work

  • Limitations:
    • The theoretical analysis relies on approximations, particularly the assumption of path independence in the inclusion-exclusion principle, which is more accurate for short path lengths and large graphs.
  • The current experimental and theoretical analysis focuses on graphs with one or two clusters.
  • Future Work:
    • Extend the analysis to random graphs with more than two clusters.
  • Investigate the GSP kernel's performance on real-world datasets beyond synthetic ones.
  • Explore guarantees for the GSP kernel's discriminative power when the number of clusters increases.
  • Potentially refine the approximation methods for more precise theoretical analysis, especially for smaller graphs.

Summary updated

Abstract

We consider the problem of classifying graphs using graph kernels. We define a new graph kernel, called the generalized shortest path kernel, based on the number and length of shortest paths between nodes. For our example classification problem, we consider the task of classifying random graphs from two well-known families, by the number of clusters they contain. We verify empirically that the generalized shortest path kernel outperforms the original shortest path kernel on a number of datasets. We give a theoretical analysis for explaining our experimental results. In particular, we estimate distributions of the expected feature vectors for the shortest path kernel and the generalized shortest path kernel, and we show some evidence explaining why our graph kernel outperforms the shortest path kernel for our graph classification problem.
BibTeX
@inproceedings{hermansson2015generalized,
  author = {Linus Hermansson and Fredrik D. Johansson and Osamu Watanabe},
  title = {{Generalized Shortest Path Kernel on Graphs}},
  booktitle = {Discovery Science},
  year = {2015},
  url = {https://openreview.net/forum?id=Lv9dAF06FXc},
}
Figure