Adapting the Bron–Kerbosch algorithm for enumerating maximal cliques in temporal graphs

  • Anne-Sophie Himmel
  • Hendrik Molter
  • Rolf Niedermeier
  • Manuel Sorge
Original Article


Dynamics of interactions play an increasingly important role in the analysis of complex networks. A modeling framework to capture this is temporal graphs which consist of a set of vertices (entities in the network) and a set of time-stamped binary interactions between the vertices. We focus on enumerating Δ-cliques, an extension of the concept of cliques to temporal graphs: for a given time period Δ, a Δ-clique in a temporal graph is a set of vertices and a time interval such that all vertices interact with each other at least after every Δ time steps within the time interval. Viard, Latapy, and Magnien (ASONAM 2015, TCS 2016) proposed a greedy algorithm for enumerating all maximal Δ-cliques in temporal graphs. In contrast to this approach, we adapt the Bron–Kerbosch algorithm—an efficient, recursive backtracking algorithm which enumerates all maximal cliques in static graphs—to the temporal setting. We obtain encouraging results both in theory (concerning worst-case running time analysis based on the parameter “Δ-slice degeneracy” of the underlying graph) as well as in practice with experiments on real-world data. The latter culminates in an improvement for most interesting Δ-values concerning running time in comparison with the algorithm of Viard, Latapy, and Magnien.


Data science Time-varying networks Δ-clique Community detection Degeneracy Fixed-parameter tractability Experimental analysis 



Anne-Sophie Himmel, Hendrik Molter and Manuel Sorge were partially supported by DFG, Project DAPA (NI 369/12). Manuel Sorge gratefully acknowledges support by the People Programme (Marie Curie Actions) of the European Union’s Seventh Framework Programme (FP7/2007–2013) under REA grant Agreement Number 631163.11 and by the Israel Science Foundation (Grant No. 551145/14). We are grateful to two anonymous SNAM reviewers whose feedback helped to significantly improve the presentation and to eliminate some bugs and inconsistencies.


  1. Barrat A, Fournet J (2014) Contact patterns among high school students. PLoS ONE 9(9):e107,878CrossRefGoogle Scholar
  2. Boccaletti S, Bianconi G, Criado R, Del Genio CI, Gómez-Gardeñes J, Romance M, Sendiña-Nadal I, Wang Z, Zanin M (2014) The structure and dynamics of multilayer networks. Physics Reports 544(1):1–122MathSciNetCrossRefGoogle Scholar
  3. Bron C, Kerbosch J (1973) Algorithm 457: finding all cliques of an undirected graph. Communications of the ACM 16(9):575–577CrossRefzbMATHGoogle Scholar
  4. Eppstein D, Läffler M, Strash D (2013) Listing all maximal cliques in large sparse real-world graphs in near-optimal time. ACM Journal of Experimental Algorithmics 18(3):3.1:1–3.1:21zbMATHGoogle Scholar
  5. Erlebach T, Hoffmann M, Kammer F (2015) On temporal graph exploration. In: Proceedings of the 42nd International Colloquium on Automata, Languages, and Programming (ICALP 2015), Springer, LNCS, vol 9134, pp 444–455Google Scholar
  6. Gemmetto V, Barrat A, Cattuto C (2014) Mitigation of infectious disease at school: targeted class closure vs school closure. BMC Infectious Diseases 14(1):1CrossRefGoogle Scholar
  7. Goerke R (2011) Email network of KIT informatics.
  8. Hagberg AA, Schult DA, Swart PJ (2008) Exploring network structure, dynamics, and function using NetworkX. In: Proceedings of the 7th Python in Science Conference (SciPy 2008), pp 11–15Google Scholar
  9. Himmel AS (2016) Enumerating maximal cliques in temporal graphs. Bachelorthesis, TU Berlin, URL, bachelor thesis
  10. Holme P, Saramäki J (2012) Temporal networks. Physics Reports 519(3):97–125CrossRefGoogle Scholar
  11. Hüffner F, Komusiewicz C, Moser H, Niedermeier R (2009) Isolation concepts for clique enumeration: Comparison and computational experiments. Theoretical Computer Science 410(52):5384–5397MathSciNetCrossRefzbMATHGoogle Scholar
  12. Isella L, Stehlé J, Barrat A, Cattuto C, Pinton JF, Van den Broeck W (2011) What’s in a crowd? Analysis of face-to-face behavioral networks. Journal of Theoretical Biology 271(1):166–180MathSciNetCrossRefGoogle Scholar
  13. Ito H, Iwama K (2009) Enumeration of isolated cliques and pseudo-cliques. ACM Transactions on Algorithms 5(4):40MathSciNetCrossRefzbMATHGoogle Scholar
  14. Kleinberg J, Tardos É (2006) Algorithm Design. Pearson Education, LondonGoogle Scholar
  15. Komusiewicz C, Hüffner F, Moser H, Niedermeier R (2009) Isolation concepts for efficiently enumerating dense subgraphs. Theoretical Computer Science 410(38):3640–3654MathSciNetCrossRefzbMATHGoogle Scholar
  16. Lahiri M, Berger-Wolf TY (2010) Periodic subgraph mining in dynamic networks. Knowledge and Information Systems 24(3):467–497CrossRefGoogle Scholar
  17. Leskovec J, Kleinberg J, Faloutsos C (2005) Graphs over time: densification laws, shrinking diameters and possible explanations. In: Proceedings of the eleventh ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, ACM, pp 177–187Google Scholar
  18. Michail O (2016) An introduction to temporal graphs: An algorithmic perspective. Internet Mathematics 12(4):239–280MathSciNetCrossRefGoogle Scholar
  19. Michail O, Spirakis PG (2016) Traveling salesman problems in temporal graphs. Theoretical Computer Science 634:1–23MathSciNetCrossRefzbMATHGoogle Scholar
  20. Naudé KA (2016) Refined pivot selection for maximal clique enumeration in graphs. Theoretical Computer Science 613:28–37MathSciNetCrossRefzbMATHGoogle Scholar
  21. Nicosia V, Tang J, Mascolo C, Musolesi M, Russo G, Latora V (2013) Graph metrics for temporal networks. In: Holme P, Saramäki J (eds) Temporal Networks. Springer, Berlin Heidelberg, pp 15–40CrossRefGoogle Scholar
  22. Opsahl T, Panzarasa P (2009) Clustering in weighted networks. Social Networks 31(2):155–163CrossRefGoogle Scholar
  23. Stehlé J, Voirin N, Barrat A, Cattuto C, Isella L, Pinton JF, Quaggiotto M, Van den Broeck W, Régis C, Lina B et al (2011) High-resolution measurements of face-to-face contact patterns in a primary school. PLoS ONE 6(8):e23,176CrossRefGoogle Scholar
  24. Tomita E, Tanaka A, Takahashi H (2006) The worst-case time complexity for generating all maximal cliques and computational experiments. Theoretical Computer Science 363(1):28–42MathSciNetCrossRefzbMATHGoogle Scholar
  25. Uno T, Uno Y (2016) Mining preserving structures in a graph sequence. Theoretical Computer Science 654:155–163MathSciNetCrossRefzbMATHGoogle Scholar
  26. Vanhems P, Barrat A, Cattuto C, Pinton JF, Khanafer N, Régis C, Ba Kim, Comte B, Voirin N (2013) Estimating potential infection transmission routes in hospital wards using wearable proximity sensors. PLoS ONE 8(9):e73,970CrossRefGoogle Scholar
  27. Viard J, Latapy M, Magnien C (2015) Revealing contact patterns among high-school students using maximal cliques in link streams. In: Proceedings of the 2015 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, ACM, pp 1517–1522Google Scholar
  28. Viard T, Latapy M, Magnien C (2016) Computing maximal cliques in link streams. Theoretical Computer Science 609:245–252MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag GmbH Austria 2017

Authors and Affiliations

  • Anne-Sophie Himmel
    • 1
  • Hendrik Molter
    • 1
  • Rolf Niedermeier
    • 1
  • Manuel Sorge
    • 1
    • 2
  1. 1.Institut für Softwaretechnik und Theoretische InformatikTU BerlinBerlinGermany
  2. 2.Department of Industrial Engineering and ManagementBen Gurion University of the NegevBe’er ShevaIsrael

Personalised recommendations