Stochastic Graphlet Embedding

Anjan Dutta, Hichem Sahbi

Abstract

Graphs are a fundamental representation for structured data, yet they pose significant challenges for machine learning due to the NP-hard nature of subgraph isomorphism. This paper presents Stochastic Graphlet Embedding (SGE), a novel framework that maps graphs of arbitrary size to fixed-length feature vectors. SGE utilizes a stochastic depth-first search to sample high-order graphlets and employs an efficient topological hashing mechanism to group isomorphic structures. This approach avoids the computational bottleneck of exact graph matching while capturing complex structural dependencies. Evaluation on diverse benchmarks shows that SGE provides substantial speedups—up to three orders of magnitude—and superior classification accuracy compared to state-of-the-art graph kernels.

Introduction

Representing structured data such as chemical compounds, social networks, or image skeletons as graphs is natural and expressive. However, the non-Euclidean nature of graphs makes them difficult to integrate with standard machine learning algorithms like Support Vector Machines (SVMs) or neural networks, which typically require fixed-length vector inputs.

To bridge this gap, researchers have developed graph kernels and graph embeddings. A primary challenge in these methods is the subgraph isomorphism problem: determining whether a specific pattern (graphlet) exists within a larger graph. Because this problem is NP-complete, most existing methods are restricted to very small graphlets (e.g., 3-5 nodes) or suffer from prohibitive computational costs as the complexity of the patterns increases.

Methodology

The proposed Stochastic Graphlet Embedding (SGE) framework addresses these challenges through a two-stage process: stochastic parsing and topological hashing.

Overview of the SGE pipeline from graph sampling to vector embedding

Stochastic Depth-First Search Parsing

Rather than exhaustively searching for all possible subgraphs, SGE uses a "random walk with restarts" strategy. The algorithm samples $M$ graphlets, each consisting of up to $T$ edges. This stochastic approach allows the method to capture "high-order" structural information—complex interactions involving many nodes—that fixed-dictionary methods often overlook. The number of samples $M$ is determined using a statistical bound to ensure the resulting vector accurately reflects the graph's true structural distribution.

Topological Hashing

To avoid the expensive task of checking for graph isomorphism, SGE uses hash functions based on topological properties such as node degree and betweenness centrality. Isomorphic graphs are guaranteed to produce identical hash codes. While non-isomorphic graphs could theoretically collide, the authors demonstrate that using betweenness centrality makes the probability of such collisions extremely low in practice.

Isomorphic graphs and their corresponding topological hash codes

The final embedding is a histogram of these hash codes, providing a robust, fixed-length representation of the graph's topology.

Experimental Evaluation

The researchers evaluated SGE across a wide range of datasets, including bioinformatics (MUTAG, ENZYMES, NCI1), computer vision (COIL, MNIST skeletons), and document analysis (AMA Dental Forms). These datasets test the method's ability to handle different types of structural information and noise levels.

Results and Discussion

SGE demonstrates significant advantages in both efficiency and accuracy:

  • Computational Efficiency: On the MUTAG dataset, the hashing-based approach was 121x to 371x faster than methods requiring exact graph isomorphism. The complexity of SGE depends on the sampling parameters ($M$ and $T$) rather than the total graph size, ensuring high scalability.
  • Classification Accuracy: SGE consistently outperformed state-of-the-art kernels. For instance, on the ENZYMES dataset, SGE achieved approximately 40% accuracy, a dramatic improvement over the 15% achieved by the Random Walk (RW) kernel.
  • Robustness: The method proved resilient to structural noise, such as the random addition or deletion of edges, which is common in real-world data extraction.

Conclusion

Stochastic Graphlet Embedding offers a practical and scalable solution for graph-based machine learning. By bypassing the NP-hard bottleneck of subgraph isomorphism through stochastic sampling and topological hashing, it enables the use of high-order structural features that were previously computationally inaccessible. Future work may focus on refining the hash functions to further minimize collisions and integrating continuous node attributes into the embedding process.

Summary updated

BibTeX
@article{dutta2019stochastic,
  author = {Anjan Dutta and Hichem Sahbi},
  title = {{Stochastic Graphlet Embedding}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2019},
  doi = {10.1109/tnnls.2018.2884700},
}
Figure