A fast MATLAB implementation of the one-dimensional Weisfeiler--Lehman graph transformation and associated kernel.
For more details about the fast hashing-based algorithm used, see the following paper:
Kersting, K., Mladenov, M., Garnett, R., and Grohe, M. Power Iterated Color Refinement. (2014). AAAI Conference on Artificial Intelligence (AAAI 2014).
For more details about the Weisfeiler--Lehman graph kernel, see the following paper:
Shervashidze, N., Schweitzer, P. van Leeuwen, E.J., Mehlhorn, K., and Borgward, K.M. Weisfeiler--Lehman graph kernels. (2010). Journal of Machine Learning Research 12(Sep):2539--2561.
This implementation uses a fast perfect hash for performing the transformation. Consider a node , and let and represent the label of and neighborhood of , respectively. Let represent the ith prime. The hash for is given by
It can be easily shown that, given two nodes , if and only if:
that is, gives unique values to unique WL signatures. The use of is much faster than the typical string hashes used for completing the WL transformation.
See the help for wl_transformation.m
for usage information.