 # Topology Based Scalable Graph Kernels

We propose a new graph kernel for graph classification and comparison using Ollivier Ricci curvature. The Ricci curvature of an edge in a graph describes the connectivity in the local neighborhood. An edge in a densely connected neighborhood has positive curvature and an edge serving as a local bridge has negative curvature. We use the edge curvature distribution to form a graph kernel which is then used to compare and cluster graphs. The curvature kernel uses purely the graph topology and thereby works for settings when node attributes are not available.

This looks very promising thanks to Chien-Chun's referral -  I wanted to ask if the python code is shared or available on github? Thanks in advance, Warren

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

We propose a new graph kernel for graph classification and comparison using Ollivier Ricci curvature. The Ricci curvature of an edge in a graph describes the connectivity in the local neighborhood. An edge in a densely connected neighborhood has positive curvature and an edge serving as a local bridge has negative curvature. We use the edge curvature distribution to form a graph kernel which is then used to compare and cluster graphs. The curvature kernel uses purely the graph topology and thereby works for settings when node attributes are not available. The computation of the curvature for an edge uses only information within two hops from the edge and a random sample of edges in a large graph can produce a good approximation to the curvature distribution with error bounded by

with probability at least

. Thus, one can compute the graph kernel for really large graphs that some other graph kernels cannot handle. This Ricci curvature kernel is extensively tested on graphs generated by different generative models as well as standard benchmark datasets from bioinformatics and Internet AS network topologies.

Graph classification and comparison are widely applied in bioinformatics, vision and social network analysis. One of the most popular approaches in practice is using graph kernels which compute the similarity of two graphs in terms of subgraph structures. Many graph kernels have been developed, which differ by the subgraph structures they focus on, such as random walks , shortest paths , subtrees , and cycles . Graph kernels have been extensively tested on benchmark datasets from bioinformatics to chemistry [1, 4].

In our work, we focus on the setting of unlabeled graphs and propose a new graph kernel based on discrete Ricci curvature which takes only the network topology as an input. Our work is motivated by the use of curvature related kernels in shape matching. Curvature on a smooth surface defines the amount by which a geometric object deviates from being flat or straight. It is a local measure at each point but nevertheless has deep connections to global topology and structures. Despite the success in shape matching, curvature has not been used much for comparing graphs. In this paper, we propose to use curvature distribution of graphs to build new graph kernels. The goal is to demonstrate that the Ricci curvature distribution and kernels can be efficiently computed and capture interesting graph properties. They add to the family of graph features and kernels, could be combined with other attributes, and used for other classifiers. Figure 1: The 2D Ricci Curvature histogram of MUTAG graphs which describes the curvature distribution for pairs of neighboring edges. A suitable choice of mass distribution on the neighborhood results in curvature always ranging between [−1,1]. Graphs in the same class tend to have similar histogram distributions. Here MUTAG:22 and MUTAG:24 belong to the same class, while MUTAG:182 and MUTAG:183 belong to another class.

## 2 Discrete Ricci Curvature

For an edge , define a distribution on the neighborhood of respectively (such as uniform and ). Now compute the Earth Mover Distance from to , where the cost of moving mass from a neighbor of to a neighbor of is the shortest path distance in the graph. Here the edges are unweighted unless they inherit weights arising from the application domain, such as tie strength or distances. For example, will be upper bounded by 2 for unweighted graph if we allocate 50% mass to the node’s neighbor. The Ollivier-Ricci curvature is defined as , where is the length of edge . Intuitively the curvature captures the structural properties of the local neighborhood. If stays in a well connected, dense neighborhood, the curvature is positive; if is locally a bridge, its curvature is negative.

## 3 Ricci Curvature Graph Kernel

We define the Ricci Curvature Kernel as the following. Denote the curvature distribution of all edges in by and that of by . We use the standard Gaussian RBF kernel: where is the

norm of two vectors

, . Since the kernel depends on the curvature distribution, the distribution is less robust statistically for small graphs. We could boost up the kernel by considering the curvature distribution for pairs of neighboring edges . It appears to be more effective in practice. See Figure 1 for an example. When the graph is really large, computing the curvature distribution might be costly ( where is the size of concerned neighborhood). Random sampling can be used to approximate the curvature distribution. Taking edges uniformly at random from the graph , it can be shown that , the curvature distribution on the sampled edges, is a good approximation of with error bound with probability . Notice that the running time does not even depend on the size of the graph .

## References

•  Borgwardt, K.M., Kriegel, H.P.: Shortest-path kernels on graphs. In: Proceedings of the Fifth IEEE International Conference on Data Mining (ICDM 2005). pp. 74–81. IEEE Computer Society, Washington, DC, USA (2005), http://dx.doi.org/10.1109/ICDM.2005.132
• 

Gärtner, T., Flach, P., Wrobel, S.: On graph kernels: Hardness results and efficient alternatives. In: Schölkopf, B., Warmuth, M.K. (eds.) Computational Learning Theory and Kernel Machines — Proceedings of the 16th Annual Conference on Computational Learning Theory and 7th Kernel Workshop (COLT/Kernel 2003) August 24-27, 2003, Washington, DC, USA. Lecture Notes in Computer Science, vol. 2777, pp. 129–143. Springer, Berlin–Heidelberg, Germany (August 2003)

•  Horváth, T., Gärtner, T., Wrobel, S.: Cyclic pattern kernels for predictive graph mining. In: Kim, W., Kohavi, R., Gehrke, J., DuMouchel, W. (eds.) Proceedings of the 10t ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2004), August 22-25, 2004, Seattle, WA, USA. pp. 158–167. ACM Press, New York, NY, USA (2004), http://doi.acm.org/10.1145/1014052.1014072
•  Ralaivola, L., Swamidass, S.J., Saigo, H., Baldi, P.: Graph kernels for chemical informatics. Neural Netw. 18(8), 1093–1110 (2005), http://dx.doi.org/10.1016/j.neunet.2005.07.009
• 

Ramon, J., Gärtner, T.: Expressivity versus efficiency of graph kernels. In: Raedt, L.D., Washio, T. (eds.) Proceedings of the First International Workshop on Mining Graphs, Trees and Sequences (MGTS 2003) at the 14th European Conference on Machine Learning and 7th European Conference on Principles and Practice of Knowledge Discovery in Databases (ECML/PKDD 2003), September 22 and 23, 2003, Cavtat-Dubrovnik, Croatia. pp. 65–74 (2003)