arXiv:2610.11385cs.DSOct 2026

Manuscript Offprint

arXiv:2610.11385

Tight bounds and output sensitive algorithms for maximal clique enumeration in link streams

George Manoussakis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Given a link stream, we are interested in the question of finding all its maximal cliques. A link stream is a set of interactions between pairs of vertices, each one lasting during some time interval, and a clique of a link stream is a set of vertices together with a time interval during which all of them interact. A clique is maximal if neither its vertex set nor its interval can be enlarged. This question models the detection of groups in temporal data and has been studied for about ten years, and several algorithms list maximal cliques efficiently in practice. All known algorithms may however spend time exponential in the size of a clique for each clique they output, and the best known bounds on the number of maximal cliques carry a factor exponential in the degeneracy of the instantaneous graphs that is larger than in static graphs. Here, we approach the question under the light of two parameters of the instantaneous graphs of the stream, their maximum degree Δ\Delta and their degeneracy kk. We first prove that a link stream with mm links has O(mΔ23Δ/3)O(m\Delta^{2}3^{\Delta/3}) maximal cliques, and that a link stream with nn vertices and ∣T∣|\mathcal{T}| distinct end times has O(n∣T∣k23k/3)O(n|\mathcal{T}|k^{2}3^{k/3}) maximal cliques. Both bounds are tight up to a factor polynomial in Δ\Delta and kk respectively, and the second one improves the factor 2k2^k of previous bounds to 3k/33^{k/3}. We also show that no bound of the form m⋅f(k)m \cdot f(k) can hold. Then we present two output sensitive algorithms. The first one has setup time O(mlog⁡m)O(m\log m) and polynomial time delay poly( Δ\Delta) log⁡m\log m. The second one has setup time O(mlog⁡m+mk2log⁡3n)O(m\log m + mk^2\log^3 n) and polynomial time delay poly( kk) log⁡m\log m, and does not depend on the maximum degree. To the best of our knowledge, these are the first algorithms with polynomial time delay for this problem, in general link streams with durations and with both the vertex set and the interval maximal. Finally, we show that an online version of the second algorithm outputs every maximal clique at its end time in total time O(mlog⁡m+mklog⁡3n)+αpoly(k)log⁡nO(m\log m + mk\log^3 n) + \alpha\text{poly}(k)\log n, where α\alpha is the number of maximal cliques, and that all our results apply to the Δ\Delta-cliques of temporal graphs. Our tools are a threshold characterization of maximal cliques, the decomposition by degeneracy orderings used for static graphs, a suffix argument that decides maximality without inspecting the neighborhood of a vertex, and dynamic orientations of graphs of bounded arboricity.

Keywords: enumeration, algorithms, maximal cliques, link streams, temporal graphs, k-degenerate graphs.

1 Introduction

Many data sets record interactions between entities together with the moment at which they happen and the time during which they last. For instance, phone calls, face-to-face contacts measured by sensors, messages, or co-presence in a place. Such data are naturally modeled by link streams, also called temporal graphs or temporal networks [39, 19, 50, 43]. Some of these formalisms use discrete time steps and instantaneous interactions, others continuous time and interactions with durations. Many problems which are polynomial on static graphs become NP-hard in the temporal setting, even on very restricted inputs, and the thesis of Molter [51] gives a parameterized overview. We use link streams with durations [43, 65, 7], which contain the Δ\Delta-cliques of discrete temporal graphs as a special case (Section 6). In a link stream, a link (b,e,u,v)(b, e, u, v) says that the vertices u and v interact during the time interval [b,e][b, e]. At every time t, the links present at t form a static graph called the instantaneous graph at time t. Real link streams are often sparse in the sense that their instantaneous graphs have small maximum degree or small degeneracy, which is the smallest integer k such that every subgraph contains a vertex of degree at most k. For instance, Bentert et al. [9] measured a temporal version of the degeneracy on many real-world temporal graphs and observed that it is small, and Baudin et al. [7] observed that the maximum degree of the instantaneous graphs varies in a much smaller range than the number of vertices and links.

Groups of entities that all interact with each other during some period are a basic object of study in these data. Viard, Latapy and Magnien introduced the corresponding notion of clique [63, 64]. A clique of a link stream is a pair (C,[t0,t1])(C, [t_0, t_1]) where CC is a set of at least two vertices and every pair of vertices of CC interacts during the whole interval [t0,t1][t_0, t_1]. It is maximal if no vertex can be added to CC and if the interval cannot be extended. Maximal cliques have been used to reveal contact patterns among high-school students [63] and to define communities in link streams [6]. It thus seems interesting both from a practical and theoretical point of view to study the enumeration of maximal cliques in link streams, and to take into account the sparsity of their instantaneous graphs.

Maximal cliques in static graphs For static graphs, the question has been extensively studied and we can essentially distinguish between two families of algorithms. On one side, worst-case output size algorithms have been proposed. Their complexities match the maximum number of maximal cliques one can find in the considered graphs. For instance, Tomita et al. [60] propose an algorithm enumerating all maximal cliques of an n-order graph in time O(3n/3)O(3^{n/3}), which is optimal since the Moon–Moser graphs have 3n/33^{n/3} maximal cliques [54]. Similarly, for k-degenerate graphs, Eppstein et al. [32] prove an O((n−k)3k/3)O((n-k)3^{k/3}) bound on the number of maximal cliques, which is attained, and give an algorithm running in time O(k(n−k)3k/3)O(k(n-k)3^{k/3}), which is fast on large real-world graphs [33]. Both algorithms are based on the Bron–Kerbosch algorithm [15]. On the other side, output sensitive algorithms bound the time spent for each maximal clique by a polynomial in the parameters of the graph, and many of them have polynomial time delay, that is, the wait between the output of two maximal cliques is polynomial. Tsukiyama et al. [61] gave the first such algorithm, with delay O(nm)O(nm), and Johnson et al. [41] showed how to list the maximal cliques in lexicographic order with polynomial delay. Chiba and Nishizeki [22] listed them in time O(am)O(am) per clique, where a is the arboricity. Makino and Uno [46] obtained a delay of order the fourth power of the maximum degree and, with fast matrix multiplication, O(nω)O(n^{\omega}); Comin and Rizzi [25] improved the latter with rectangular matrix multiplication. Chang et al. [21] gave an output sensitive algorithm for sparse graphs analysed with the h-index of the graph, and Conte et al. [26] obtained a delay depending on the degeneracy, the maximum degree and the maximum clique size, in space linear in the graph. Conte and Tomita showed that the delay of the Bron–Kerbosch algorithm with pivoting can be exponential [27]. The author proposed a decomposition of a k-degenerate graph into n subgraphs of at most k+1k+1 vertices which yields an enumeration time depending only on the degeneracy [47]. A clique which is maximal in a subgraph but not in the graph is a proper suffix of a maximal clique found before, so that such cliques can be rejected with a generalized suffix tree; we use the same observation in Section 5. A delay depending only on the degeneracy can then be obtained by buffering the solutions [48]. Several of these algorithms, and ours, first guarantee a bound on the time needed to produce the first i solutions, for every i, and then turn it into a delay bound by buffering solutions in a queue. This technique goes back to Uno [62]. Capelli and Strozecki analysed it and gave a geometric amortization scheme which achieves a similar delay, up to a logarithmic factor, in polynomial space [17, 18]. Related enumeration problems include k-plexes [11, 40] and k-defective cliques [28, 40].

Maximal cliques in link streams The known results are summarized in Tables 1 and 2, and we present them in chronological order. Viard, Latapy and Magnien first defined Δ\Delta-cliques in link streams in which interactions are instantaneous [63, 64]. In a Δ\Delta-clique (X,[a,b])(X, [a, b]), every pair of vertices of X interacts at least once in every subinterval of [a,b][a, b] of length Δ\Delta. We keep the name Δ\Delta-clique used in the literature, but we denote by θ\theta the length of these subintervals, since Δ\Delta denotes the maximum degree in this paper. Viard et al. gave an algorithm which grows cliques in time and in vertices from each link, in time exponential in nn [64], and they then extended it to links with durations [65].

Himmel et al. [37, 38] adapted the Bron–Kerbosch algorithm with pivoting to Δ\Delta-cliques. They introduced the Δ\Delta-slice degeneracy, which is the largest degeneracy of the graphs formed by the interactions of a window of length θ\theta, and showed that the problem is fixed-parameter tractable with respect to this parameter. The running time of their algorithm is bounded in terms of the number of time-maximal cliques, which are the cliques whose interval cannot be extended but whose vertex set might be. The effect of pivoting on the worst-case running time was left open. Bentert et al. [8, 9] extended this algorithm to Δ\Delta-k-plexes. For cliques, they bounded the number of time-maximal cliques by n2k+1min⁡(m,∣T∣)n2^{k+1} \min(m, |T|), where kk is the Δ\Delta-slice degeneracy and ∣T∣|T| the number of time steps. We use the letter kk for the Δ\Delta-slice degeneracy since, by Section 6, it is the largest degeneracy of the instantaneous graphs of a link stream associated with the temporal graph. This improves the bound 3k/32k+1n∣T∣3^{k/3}2^{k+1}n|T| of [38]. These results are presented together in the thesis of Molter [51]. Molter et al. studied isolated temporal cliques, which have few links to the rest of the stream, and gave fixed-parameter algorithms with respect to the isolation parameter [52, 53]. They note that their algorithm is not output sensitive.

Banerjee and Pal required every pair to interact at least γ\gamma times in every window of length θ\theta. They gave an algorithm listing the maximal (Δ,γ)(\Delta, \gamma)-cliques in time O(2nn2m3+2nn3m2)O(2^n n^2 m^3 + 2^n n^3 m^2) [1], then a two-phase algorithm which first stretches cliques of two vertices in time and then adds vertices [2, 4], and an incremental algorithm [3]. Pal adapted the algorithm of Himmel et al. to (Δ,γ)(\Delta, \gamma)-cliques, with running time O(2k3k/3n∣T∣m+n2∣T∣2)O(2^k 3^{k/3} n |T| m + n^2 |T|^2), where nn and mm are the numbers of vertices and edges and kk is the Δ\Delta-slice degeneracy, which ignores γ\gamma [56]. Boekhout and Takes extended the two-phase approach to weighted temporal networks, in which γ\gamma bounds the total weight of the interactions of a pair in a window [13]. They perform the first phase in time O(m)O(m) instead of O(γm)O(\gamma m), and their algorithm is much faster in practice. They also require the interval of a clique to start and end with an interaction between two of its vertices, which changes the set of maximal cliques.

Baudin et al. [7, 5] gave an algorithm which, for every time tt at which a link starts, lists the cliques of the instantaneous graph at tt which contain this link, and keeps those which are vertex-maximal. It handles link streams with more than 10810^8 links. Its running time is O(m3Δ/32qΔ2)O(m3^{\Delta/3}2^q\Delta^2), where Δ\Delta and qq are the largest maximum degree and clique size of an instantaneous graph. Its output sensitive running time is O(1rΔ2qα)O(\frac{1}{r}\Delta^2q\alpha), where α\alpha is the number of maximal cliques and rr the proportion of leaves of the search tree which output a maximal clique. The authors show that 1≤1r≤2q1 \leq \frac{1}{r} \leq 2^q and that 1r=2q−1−1\frac{1}{r} = 2^{q-1} - 1 can occur without pivoting, while with their pivot 1r\frac{1}{r} is below 2 in their experiments. The thesis of Baudin [5] states the understanding of this factor as a perspective.

Davot et al. [30] consider the same maximal Δ\Delta-cliques as we do, in temporal graphs which satisfy two assumptions. The first one is a temporal version of the closure of static graphs: two vertices with at least ρ\rho common neighbors during a short interval of time are adjacent around that time. The second one is that the neighborhood of every vertex changes by at most η\eta vertices between two consecutive time steps. They prove that the number of maximal Δ\Delta-cliques is then at most 3⋅2ρ−1+2η(θ+1−θ1)n2∣T∣3 \cdot 2^{\rho-1+2\eta(\theta+1-\theta_1)}n^2|T|, where θ1≤θ\theta_1 \leq \theta is the length of the short intervals, and they list them with the algorithm of [38]. Their parameters and the degeneracy are incomparable. For instance, a complete graph present at every time step has closure number 1 and degeneracy

n−1n-1, while K2,NK_{2,N} has degeneracy 2 and closure number N+1N+1. Observe that their bound also bounds the number of maximal cliques output by our algorithms on these temporal graphs. Finally, a bound in terms of the vertex deletion distance to order preservation is implicit in the work of Hermelin et al. [36], as observed in [30].

To summarize, the analyses of [38, 9, 7] bound the work by the number of time-maximal cliques, and this number can exceed the number of maximal cliques by a factor exponential in the size of a clique. As a consequence, none of these algorithms is known to spend time polynomial in the input for each maximal clique it outputs. Moreover, the best known bound on the number of maximal cliques [9] carries a factor 2k2^k, while in static graphs the corresponding factor is 3k/33^{k/3} [32].

Cliques maximal over the whole lifespan Brunelli et al. [16] recently gave an output sensitive algorithm for another notion of maximal clique. For them, a temporal clique is a set of vertices which is a clique of some instantaneous graph, and it is maximal if no strict superset of it is a clique of some instantaneous graph. Their solutions are thus vertex sets, without time interval. This family of sets is hereditary, which allows them to use the framework of Cohen et al. [23]. They consider single-interval temporal graphs, in which every pair interacts during at most one interval of time. In such a graph with nn vertices and mm edges, they list the α′\alpha' maximal temporal cliques in time O(α′2nq(q3+Δ))O(\alpha'^{2}nq(q^{3}+\Delta)) and space O(mn)O(mn), where qq is the maximum size of a temporal clique and Δ\Delta the maximum degree of the graph of all the pairs which interact. They also list the first ii of them in time O(i2q(q3+Δ))O(i^{2}q(q^{3}+\Delta)), using space O(mn+qi)O(mn+qi).

The two problems are related as follows. If SS is a solution of [16], then SS together with the interval during which it is a clique is a maximal clique in our sense. Thus α′≤α\alpha' \leq \alpha. The converse does not hold. For instance, in Figure 1, ({a,b},[1,8])(\{a, b\}, [1, 8]) is a maximal clique although {a,b}\{a, b\} is contained in the clique {a,b,c}\{a, b, c\}. Moreover, α\alpha can be exponentially larger than α′\alpha'. Let p≥2p \geq 2 and consider the complete pp-partite graph whose parts have three vertices each. Give every edge of this graph the link (0,2,u,v)(0, 2, u, v), and every pair inside a part the link (1,2,u,v)(1, 2, u, v). Then the only solution of [16] is the whole vertex set, while the link stream has 3p+13^p + 1 maximal cliques. This example is the one used in [16] to compare their solutions with the maximal cliques of the instantaneous graphs. Therefore neither result implies the other. Observe also that, in our sense, the maximality of a clique only depends on the links present during its interval. On the contrary, a set of vertices which interacts during a long period is not a solution of [16] as soon as a larger set interacts once at some other time. Finally, the reduction from Δ\Delta-cliques given in [16] produces temporal graphs in which a pair may interact during several intervals, to which their algorithm does not directly apply.

Other dense structures have been studied in temporal graphs. Qin et al. studied periodic cliques, whose edges reappear at regular intervals [57], and Zhu et al. listed sets of k time intervals that pairwise overlap within a query window, which they call temporal k-cliques [68]. Temporal cores [66], span-cores [34], persistent communities [44] and bursting cores [58] have also been considered, and Zhao et al. listed the maximal Δ\Delta-bicliques of temporal bipartite graphs [67]. The name temporal clique is also used for a temporal graph whose underlying graph is complete, in the study of temporal spanners [20], which is a different object.

Related questions A different problem is to maintain the set of maximal cliques of a graph under edge insertions and deletions. Stix [59] and Ottosen and Vomlel [55] gave update algorithms, and Das et al. gave the first change-sensitive algorithms, whose time is proportional to the number of maximal cliques that appear or disappear, together with nearly tight bounds on this number [29]. Baudin et al. note that this approach can be adapted to link streams [7]. Observe however that the maximal cliques of a link stream are not the maximal cliques of its instantaneous graphs, since a vertex adjacent to all the vertices of a clique during part of its interval does not extend it. Inside one end time, our algorithms solve a problem of this incre-mental kind on a graph with O(k)O(k) or O(Δ)O(\Delta) vertices. We will also need to maintain orientations of the instantaneous graphs. An orientation has out-degree at most c if every vertex has at most c out-neighbors, and an acyclic orientation of out-degree at most k exists if and only if the degeneracy is at most k. Brodal and Fagerberg maintained an orientation of out-degree O(a)O(a) under edge insertions and deletions, where a bounds the arboricity [14], Kopelowitz et al. obtained worst-case update times [42], and Christiansen and Rotenberg obtained out-degree a+2a+2 [24]. These orientations need not be acyclic. The level data structures of Bhattacharya et al. [12] and Henzinger et al. [35] give acyclic orientations of out-degree O(a)O(a), where a is the current arboricity, with polylogarithmic amortized update time; Liu et al. stated this orientation explicitly [45].

Our contributions Let L\mathcal{L} be a link stream with nn vertices and mm links, let T\mathcal{T} be the set of distinct end times of its links, and let Δ\Delta, kk and qq be the largest maximum degree, the largest degeneracy and the largest clique size of an instantaneous graph. We first prove that a maximal clique ending at time ee is determined by its start time τ\tau and by a maximal clique of a static graph G[τ,e]G_{[\tau,e]} whose edges are the pairs that interact throughout [τ,e][\tau,e]. As τ\tau increases, these graphs only gain edges. Therefore, all maximal cliques ending at ee can be found by sweeping τ\tau over the start times of the links present at ee, and by listing only maximal cliques of static graphs. This is what removes the factor exponential in the clique size of the previous algorithms.

Using this observation, we present a first output sensitive algorithm, which anchors every maximal clique at one of its links that ends at the end time of the clique. It has setup time O(mlog⁡m)O(m \log m), amortized time delay O(q2Δ2(Δlog⁡m+Δ2+λ(Δ)))O(q^2 \Delta^2 (\Delta \log m + \Delta^2 + \lambda(\Delta))), where λ(h)\lambda(h) is the delay of maximal clique enumeration in an h-order graph, and polynomial time delay O(Δ4(Δlog⁡m+Δ2+λ(Δ)))O(\Delta^4 (\Delta \log m + \Delta^2 + \lambda(\Delta))). For example, using the algorithm of Tsukiyama et al. [61], the delay is O(Δ7+Δ5log⁡m)O(\Delta^7 + \Delta^5 \log m). As a by-product, we prove that a link stream has O(mΔ23Δ/3)O(m \Delta^2 3^{\Delta/3}) maximal cliques, and that this bound is tight up to a factor O(Δ2)O(\Delta^2). An online version of the algorithm outputs every maximal clique at its end time.

In a second part, we consider the degeneracy. We first observe that the number of maximal cliques cannot be bounded by mm times a function of kk, since it can be quadratic in mm when k=2k = 2. We then prove that a link stream has O(n∣T∣k23k/3)O(n|\mathcal{T}|k^{2}3^{k/3}) maximal cliques and that this is tight up to a factor polynomial in kk. This improves the factor 2k2^k of the bound of [9], and the factor 3k/32k3^{k/3}2^k of the bound of [38], to 3k/33^{k/3}, which cannot be improved. We then present a second output sensitive algorithm, which anchors every maximal clique at its end time and at its first vertex in an ordering of the instantaneous graph in which every vertex has few later neighbors, as in the decomposition of [47]. A candidate found in the neighborhood of an anchor may fail to be maximal because of a vertex that comes earlier in the ordering. We show that such a candidate is a proper suffix of a maximal clique that has already been output, so that it can be rejected by a dictionary lookup, without inspecting the neighborhood of the anchor. Finally, we maintain the orderings over time with the level data structures of [12, 35]. The resulting algorithm has setup time O(mlog⁡m+mk2log⁡3n)O(m\log m + mk^2\log^3 n) and polynomial time delay O(k5(k2log⁡m+λ(k)))O(k^5(k^2\log m + \lambda(k))), which does not depend on the maximum degree. It can also be run online, in which case it outputs every maximal clique at its end time in total time O(mlog⁡m+mklog⁡3n)+αO(k5(k2log⁡n+λ(k)))O(m\log m + mk\log^3 n) + \alpha O(k^5(k^2\log n + \lambda(k))), where α\alpha is the number of maximal cliques. When the output dominates the setup phase, its worst-case running time matches the largest possible number of maximal cliques up to a factor poly(k)log⁡m(k)\log m. All our results apply to the Δ\Delta-cliques of temporal graphs, with kk equal to their Δ\Delta-slice degeneracy. To the best of our knowledge, these are the first algorithms with polynomial time delay for listing the maximal cliques of link streams, in which both the vertex set and the interval are maximal. This problem differs from the enumeration of the vertex sets which are maximal over all times [16], and from enumeration under closure and stability assumptions [30].

The organization of the document is as follows. In Section 2, we introduce some notations and definitions. In Section 3, we prove basic results. These results are used in Sections 4 and 5.

for the proofs of the main contributions of the paper. The first algorithm and the bounds in terms of the maximum degree are presented in Theorems 1, 2 and 3. The bounds in terms of the degeneracy are proved in Theorem 6, and the second algorithm in Theorems 4, 5, 7 and 8. In Section 6, we apply our results to Δ\Delta-cliques. We conclude in Section 7.

References (40)