Skip to main content
Log in

On linear algebraic algorithms for the subgraph matching problem and its variants

  • Original Paper
  • Published:
Optimization Letters Aims and scope Submit manuscript

Abstract

For a given simple data graph G and a simple query graph H, the subgraph matching problem is to find all the subgraphs of G, each isomorphic to H. There are many combinatorial algorithms for it and its counting version, which are predominantly based on backtracking with several pruning techniques. Much less is known about linear algebraic (LA, for short), i.e., adjacency matrix algebra, algorithms for this problem. Revisiting old ideas of J. Nešetřil and S. Poljak, which reduce the general case to the case of clique-queries, and updating them, we present the first LA algorithm for the subgraph matching/counting problem. For the k-clique matching/counting problem, we present static and dynamic LA algorithms, which may be of independent interest. For the k-clique counting problem, we also provide results of computational experiments of our solver with some large graphs and several k, which speed up results of several recent solvers for it.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Ahmed, N., et al.: Graphlet decomposition: framework, algorithms, and applications. Knowl. Inf. Syst. 50(3), 689–722 (2017)

    Article  Google Scholar 

  2. Alon, N., et al.: Biomolecular network motif counting and discovery by color coding. Bioinformatics 24(13), 241–249 (2008)

    Article  Google Scholar 

  3. Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17, 209–223 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  4. Bonne, M., Censor-Hillel, K.: Distributed detection of cliques in dynamic networks. In: Baier, C., Chatzigiannakis, I., Flocchini, P., Leonardi, S. (eds.) Proceedings of International Colloquium on Automata, Languages, and Programming, pp 132:1–132:15. Dagstuhl Publishing (2019)

  5. Chakaravarthy, V., et al.: Subgraph counting: Color coding beyond trees. In: O’Conner, L. (ed.) International Symposium on Parallel and Distributed Processing Symposium Proceedings, pp 2–11. Piscataway, IEEE (2016)

  6. Chen, L., et al.: A GraphBLAS approach for subgraph counting. ArXiv, https://doi.org/10.48550/arXiv.1903.04395.

  7. Chiba, N., Nishizeki, T.: Arboricity and subgraph listing algorithms. SIAM J. Comput. 14(1), 210–223 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  8. Danisch, M., Balalau, O., Sozio, M.: Listing \(k\)-cliques in sparse real-world graphs. In: Champin, P.-A. et al. (eds.) Proceedings of International Conference on World Wide Web, pp 589–598. International WWW Conference Committee (2018)

  9. Dave, V., Ahmed, N., Hasan, M.: PE-CLoG: Counting edge-centric local graphlets. In: Nie, J-Y et al. (eds.) Proceedings of International Conference on Big Data, pp 586–595. IEEE, Piscataway (2017)

  10. Dhulipala, L., Liu, Q., Shun, J., Yu, S.: Parallel batch-dynamic \(k\)-clique counting. In: Shapira, M. (ed.) Proceedings of Symposium on Algorithmic Principles of Computer Science, pp. 129–143. SIAM, Philadelphia (2021)

  11. Dvorak, Z., Tuma, V.: A dynamic data structure for counting subgraphs in sparse graphs. In: Dehne, F., Solis-Oba, R., Sack, J.-R. (eds.) Proceedings of Workshop on Algorithms and Data Structures, pp. 304–315. Springer-Verlag, Berlin (2013)

  12. Eisenbrand, F., Grandoni, F.: On the complexity of fixed parameter clique and dominating set. Theoret. Comput. Sci. 326(1–3), 57–67 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  13. Eppstein, D.: Arboricity and bipartite subgraph listing algorithms. Inf. Process. Lett. 51(4), 207–211 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  14. Eppstein, D., Goodrich, M., Strash, D., Trott, L.: Extended dynamic subgraph statistics using h-index parameterized data structures. Theoret. Comput. Sci. 447, 44–52 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  15. Eppstein, D., Spiro, E.: The h-index of a graph and its application to dynamic subgraph statistics. In: Dehne, F., Gavrilova, M., Sack, J., Tóth, C. (eds.) Proceedings of Workshop on Algorithms and Data Structures, pp 278–289. Springer-Verlag, Berlin (2009)

  16. Finocchi, F., Finocchi, M., Fusco, E.: Clique counting in MapReduce: algorithms and experiments. J. Experimen. Algorithmics 20, 1.7:1-1.7:20 (2015)

    MathSciNet  MATH  Google Scholar 

  17. Goodrich, M., Pszona, P.: External-memory network analysis algorithms for naturally sparse graphs. In: Demetrescu, C., Halldórsson, M (eds.) Proceedings of European Symposium on Algorithms, pp 664–676. 2011. Springer-Verlag, Berlin (2011)

  18. Greyser, V., Soszynski, A., Kao, E.: Leveraging linear algebra to count and enumerate simple subgraphs. In: Proceedings of High Performance Extreme Computing Conference, pp. 1-8. IEEE, Piscataway (2020)

  19. Jain, S., Seshadhri., C.: The power of pivoting for exact clique counting. In: Caveree, J., Hu, B., Lalmas, M., Wang, W. (eds.) Proceedings of the 13th International Conference on Web Search and Data Mining, pp. 268–277. Association for Computing Machinery, New York (2020)

  20. Kara, A., et al.: Counting triangles under updates in worst-case optimal time. In: Barcelo, P., Calautti, M. (eds.) Proceedings of International Conference on Database Theory, pp 4:1–4:18. Dagstuhl Publishing (2019)

  21. Kepner, J., Gilbert, J.: Graph algorithms in the language of linear algebra. SIAM, Philadelphia (2011)

    Book  MATH  Google Scholar 

  22. Kloks, T., Kratsch, D., Müller, H.: Finding and counting small induced subgraphs efficiently. Inform. Process. Lett. 74(3–4), 115–121 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  23. Lai, L., et al.: Distributed subgraph matching on timely dataflow. Proc. VLDB Endow. 12(10), 1099–1112 (2019)

    Article  Google Scholar 

  24. Latapy, M.: Main-memory triangle computations for very large (sparse (power-law)) graphs. Theoret. Comput. Sci. 407(1–3), 458–473 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  25. Leskovec, J., Krevl, A.: SNAP Datasets: Stanford Large Network Dataset Collection.http://snap.stanford.edu/data (2022). Accessed 30 December 2022

  26. López-Presa, J., Chiroque, L., Anta, A.: Novel techniques to speed up the computation of the automorphism group of a graph. J. Appl. Math. 2014(934637), 15 (2014)

    MathSciNet  MATH  Google Scholar 

  27. Makkar, D., Bader, D., Green, O.: Exact and parallel triangle counting in dynamic graphs. In: Smari, W. (ed.) Proceedings of International Conference on High Performance Computing and Simulation, pp 2–12. IEEE, Piscataway (2017)

  28. McCay, B., Piperno, A.: Practical graph isomorphism, II. J. Symb. Comput. 60, 94–112 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  29. Mhedhbi, A., Salihoglu, S.: Optimizing subgraph queries by combining binary and worst-case optimal joins. Proc. VLDB Endow. 12(11), 1692–1704 (2019)

    Article  Google Scholar 

  30. Nešetřil, J., Poljak, S.: On the complexity of the subgraph problem. Comment. Math. Univ. Carol. 26(2), 415–419 (1985)

    MathSciNet  MATH  Google Scholar 

  31. Papadimitriou, C., Yannakakis, M.: The clique problem for planar graphs. Inf. Process. Lett. 13, 131–133 (1981)

    Article  MathSciNet  Google Scholar 

  32. Pinar, A., Seshadhri,C., Vishal, V.: ESCAPE: Efficiently counting all 5-vertex subgraphs. In: Barrett, R., Cummings, R. (eds.) Proceedings of International Conference on World Wide Web, pp. 1431–1440. International WWW Conference Committee (2017)

  33. Shi, J., Dhulipala, L., Shun, J.: Parallel clique counting and peeling algorithms. In: Bender, M., Gilbert, J., Hendrickson, B., Sullivan, B. (eds.) Proceedings of the 2021 SIAM Conference on Applied and Computational Discrete Algorithms, pp. SIAM, Philadelphia (2021)

  34. Stoichev, S.: New exact and heuristic algorithms for graph automorphism group and graph isomorphism. ACM J. Experimen. Algorithmics 24(1.15), 1–27 (2019)

    MathSciNet  Google Scholar 

  35. Sun, Z., et al.: Efficient subgraph matching on billion node graphs. Proc. VLDB Endow. 5(9), 788–799 (2012)

    Article  Google Scholar 

  36. Vassilevska, V.: Efficient algorithms for clique problems. Inf. Process. Lett. 109(4), 254–257 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  37. Watts, D., Strogatz, S.: Collective dynamics of small-world networks. Nature 393, 440–442 (1998)

    Article  MATH  Google Scholar 

Download references

Acknowledgements

The work of Malyshev D.S. was conducted within the framework of the Basic Research Program at the National Research University Higher School of Economics (HSE).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dmitry S. Malyshev.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Emelin, M.D., Khlystov, I.A., Malyshev, D.S. et al. On linear algebraic algorithms for the subgraph matching problem and its variants. Optim Lett 17, 1533–1549 (2023). https://doi.org/10.1007/s11590-023-02001-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11590-023-02001-z

Keywords

Navigation