arXiv:2610.29776cs.DSOct 2026

Manuscript Offprint

arXiv:2610.29776

Fully Dynamic Triangle and 4-Vertex Subgraph Counting: From Theory to Practice and Back Again

Kathrin Hanauer, Sophia Heck, Monika Henzinger, Leonhard Sidl

Kathrin Hanauer ∗^{*} †^{\dagger}

Sophia Heck ∗^{*} ‡^{\ddagger}

Monika Henzinger §^{\S}

Leonhard Sidl ∗^{*} ^{\P}

Abstract. Counting small patterns is a core primitive in large-scale graph analytics, with numerous applications in data management and network analysis. As modern graphs are massive and continuously evolving, maintaining such counts efficiently under updates is essential. Although specialized dynamic algorithms for patterns with up to four vertices exist, they remain largely theoretical; practitioners instead rely on general-purpose or approximate methods.

We present an in-depth study of two dynamic approaches by Eppstein et al. and Hanauer et al. for maintaining counts of triangles and all connected four-vertex subgraph patterns, both based on variants of heavy-light vertex partitioning. We introduce theoretical and practical optimizations and develop hybrid variants that combine complementary strengths of both approaches.

Experiments on 56 large real-world and synthetic dynamic graphs show that our optimized algorithms outperform the original methods and strong static and dynamic baselines on nearly all instances, both in total running time and worst-case update time, with speedups of up to several orders of magnitude. We further provide practical guidelines for algorithm selection and tuning. To the best of our knowledge, this is the first comprehensive empirical study of heavy-light partitioning for dynamic subgraph counting, and our findings may inform other algorithms based on this technique.

1 Introduction Subgraph counting is a fundamental problem in network analysis. The frequency with which a (smaller) pattern graph occurs as a subgraph in a larger data graph captures essential information about local structures and serves as a fundamental graph statistic with numerous applications: For example, the clustering coefficient, which relates the number of triangles in a graph to the number of length-2 paths, measures transitivity [78]. In databases, the number of embeddings of a fixed pattern graph corresponds to the result size of the respective conjunctive join query. Motifs, i.e., (small) patterns that occur significantly more often than expected under an appropriate random model, are at the core of social network analysis [42], recommendation systems [18], recognition of hidden structures in complex networks [54], bot identification [41], fraud detection in financial networks [66], and cyber security [10].

In practice, data very often is not static. Instead, it is updated continuously, giving rise to dynamic algorithms that maintain subgraph counts under edge insertions or deletions. Dynamic algorithms with strong theoretical guarantees are known for triangles [35, 15] as well as for all connected four-vertex patterns [23, 14]; all of them are based on variants of heavy-light partitioning, which exploits that the degree distribution in many real-world graphs is highly skewed.

Despite their relevance, maintaining the exact frequencies of triangles and four-vertex patterns in a dynamically evolving graph with both edge insertions and deletions has not received much attention in empirical research so far. Previous work has either focused on approximate (often triangle) counting [7, 73, 19, 50, 3, 58], considers a more general approach for counting or enumerating arbitrary patterns [3, 58, 6, 16, 36, 56], and/or is restricted to cliques [52, 12]. To the best of our knowledge, only Schiller et al. [71] empirically study four-vertex subgraph counting in the dynamic setting, however without considering sophisticated approaches with strong theoretical guarantees, such as those based on vertex partitioning. Furthermore, they only consider induced subgraph counts, where also non-edges must be preserved in the data graph. Non-induced counts, in contrast, allow additional edges and admit faster algorithms. The two are mutually convertible via formulas, which however require several other pattern counts, in-

*Faculty of Computer Science, University of Vienna, Vienna, Austria; Email: kathrin.hanauer@univie.ac.at, sophia.heck@univie.ac.at, leonhard.paul.sidl@univie.ac.at

†^{\dagger}Research Network Data Science, University of Vienna, Vienna, Austria

‡^{\ddagger}Doctoral School Computer Science DoCS, University of Vienna, Vienna, Austria

§^{§}Institute of Science and Technology Austria (ISTA), Klosterneuburg, Austria; Email: monika.henzinger@ista.ac.at.

1^{1}Department of Theoretical Chemistry, University of Vienna, Vienna, Austria; and Vienna Doctoral School in Chemistry, University of Vienna, Vienna, Austria

Extended author version of the ALENEX 2027 proceedings paper [21] (to appear).

including the computationally more expensive cliques [23].

In this paper, we close the gap between theory and practice. We implement and further optimize the non-induced four-vertex subgraph counting algorithms by Hanauer et al. [23] and Eppstein et al. [14, 15], along with the triangle counting algorithms based on their respective frameworks, which, in case of Hanauer et al. [23], is conceptually similar to the algorithm of Kara et al. [35]. As both can count 4-cliques, they can also report induced counts. We consider triangles as well as all connected four-vertex pattern graphs. Specifically, we make the following contributions:

  1. We identify and correct errors and omissions in the description of these algorithms.

  2. We optimize auxiliary data structures used internally by the algorithms to achieve speedups in practice, while retaining or even improving the theoretical guarantees.

  3. We describe and experiment with new ways to maintain a vertex partitioning under edge updates.

  4. We cross-combine the algorithm by Eppstein et al. with the partitioning scheme by Hanauer et al. and vice-versa and analyze the resulting running times theoretically.

  5. In an extensive experimental evaluation on 56 large instances, our optimized algorithms achieve mean speedups of up to four orders of magnitude over static recomputation, up to three orders over the only dynamic counting baseline, and up to 26×26 \times over state-of-the-art continuous matching algorithms.

2 Related Work The high relevance and ubiquity of subgraph counting and matching in diverse areas have given rise to a large body of work on general and specialized algorithms as well as theoretical results. Here, we restrict ourselves to results closest to ours and refer the reader to section A.1 as well as the detailed surveys on static [67] and dynamic [26] subgraph counting for a broader overview.

In the static setting, counting for arbitrary patterns generalizes the NP\mathcal{NP}-hard subgraph isomorphism problem. For patterns on up to five vertices, efficient specialized algorithms exist [37, 29, 59, 63], alongside a large body of work on the identification of motifs [54, 32, 79, 48, 77, 68], and on approximate and streaming algorithms, especially for triangles [33, 8, 50, 49, 53, 38, 62].

In the dynamic setting, Eppstein and Spiro [15] maintain the triangle count in O(h)\mathcal{O}(h) amortized update time, where the hh-Index hh is the largest integer such that the graph has hh vertices of degree at least hh. Note that h∈O(m)h \in \mathcal{O}(\sqrt{m}). Eppstein et al. [14] extend this approach to non-induced subgraphs of size four with an amortized update time of O(h2)\mathcal{O}(h^2). We refer to this algorithm as EGST and provide a more detailed description in section 4.3. Kara et al. [35] show how to count triangles in O(m)\mathcal{O}(\sqrt{m}) amortized update time based on a heavy-light vertex partitioning. Using a similar partitioning, Hanauer et al. [23] give improved algorithms to count non-induced 4-vertex patterns in amortized time O(m23)\mathcal{O}(m^{\frac{2}{3}}) except for the clique and the path, which take O(m)\mathcal{O}(m) and O(m)\mathcal{O}(\sqrt{m}) update time, respectively. We later refer to this algorithm as HHH and also include their triangle counting algorithm, which is conceptually very similar to that by Kara et al. [35] and has the same guarantees. Hanauer et al. further show that, conditioned on the combinatorial k-clique conjecture [1] and the OMv conjecture [27], respectively, substantially faster fully dynamic algorithms for induced and non-induced connected 4-vertex patterns do not exist. Further theoretical results tighten these bounds for triangles [51] and 4-cycles [4]. The only prior empirical study of dynamic four-vertex subgraph counting is by Schiller et al. [71], who maintain induced counts via neighborhood scanning in O(D2)\mathcal{O}(D^2) update time, where DD denotes the maximum vertex degree. Finally, there also exists a large body of empirical work on continuous subgraph matching (CSM) for arbitrary patterns [16, 36, 56, 34, 30, 31, 75], from which frequencies can be extracted straightforwardly. Sun et al. [76] provide an extensive survey and experimental study of these algorithms.

3 Preliminaries Let G=(V,E)G = (V, E) be a simple undirected graph with n=∣V∣n = |V| and m=∣E∣m = |E|. The degree deg⁡(v)\deg(v) of a vertex vv is the number of incident edges of vv, and D:=max⁡v∈Vdeg⁡(v)D := \max_{v \in V} \deg(v). Let N(v):={u∣{u,v}∈E}N(v) := \{u \mid \{u, v\} \in E\} denote the neighborhood of vv. We define Nu‾(v):=N(v)∖{u}N_{\overline{u}}(v) := N(v) \setminus \{u\} and deg⁡u‾(v):=∣Nu‾(v)∣\deg_{\overline{u}}(v) := |N_{\overline{u}}(v)|. For a set of vertices X⊆VX \subseteq V and some vertex v∈Vv \in V, we use NX(v):=N(v)∩XN_X(v) := N(v) \cap X, deg⁡X(v):=∣NX(v)∣\deg_X(v) := |N_X(v)|, NX,u‾(v):=NX(v)∖{u}N_{X,\overline{u}}(v) := N_X(v) \setminus \{u\}, and DX:=max⁡v∈Xdeg⁡(v)D_X := \max_{v \in X} \deg(v).

A graph G′=(V′,E′)G' = (V', E') is a (non-induced) subgraph of GG if V′⊆VV' \subseteq V and E′⊆EE' \subseteq E, and an induced subgraph if E′={{u,v}∈E∣u,v∈V′}E' = \{\{u, v\} \in E \mid u, v \in V'\}. A pattern is a (small) graph that we are interested in finding in a larger graph. Given a pattern PP, its induced or non-induced count equals the number of induced or non-induced subgraphs in GG, respectively, that are isomorphic to PP, divided by the number of automorphisms of PP. We consider the following patterns (see also Figure 4.1): triangle, 3-path, claw, paw, 4-cycle, diamond, and 4-clique.

A dynamic graph is a (possibly empty) initial graph along with a sequence of edge insertions and deletions, also called updates, which are applied to the graph in order. These updates are unknown to a dynamic graph algorithm beforehand. When considering a dynamic graph, n and m always refer to the current number of vertices and edges, respectively, i.e., some updates may already have been applied. For the sake of simplicity, we do not explicitly consider node updates. They can be handled straightforwardly.

A (heavy-light) vertex partition P=(H,L)\mathcal{P} = (\mathcal{H}, \mathcal{L}) partitions the vertex set VV into two disjoint subsets, where vertices with high degree (for some notion of high degree) are in H\mathcal{H} and all others are in L\mathcal{L}. All partitions in the following can be maintained in amortized constant time per update. We denote by #H\#_{\mathbb{H}} the amortized number of vertices changing partition per update.

4 Triangle and 4-Vertex Subgraph Counting We provide an overview of the only two algorithms we are aware of for counting all connected non-induced four-vertex subgraphs in dynamic graphs, EGST [14] and HHH [23]. Both can also be extended to count triangles [15]. We introduce several variants and optimizations targeted at improving their practical performance. As claws can be counted in worst-case constant time [23], we do not discuss them further in this section.

4.1 Common Overall Architecture Despite significant differences in their detailed strategies, EGST and HHH share the same overarching design:

Vertex Partitioning maintains disjoint high- and low-degree vertex sets, H and L.

Auxiliary Counts record occurrences of restricted patterns indexed by up to three anchor vertices. Restrictions specify whether vertices belong to H or L.

Final Pattern Counts are obtained from a combination of auxiliary counts and neighborhood scanning.

Upon an edge insertion both algorithms perform the three steps in the order stated above. After an edge deletion, the order of auxiliary structure updates and final pattern counts is swapped. Below, we provide a brief overview of each element and refer to [23] and [14] for a complete description. We assume that auxiliary counts are stored using fast hash maps with expected O(1)\mathcal{O}(1) access and modification time.

4.2 HHH Algorithm and ε\varepsilon-Partition We briefly review the ε\varepsilon-Partition as well as the HHH algorithm [23] and describe a correction. We then discuss several practical optimization strategies.

4.2.1 ε\varepsilon-Partition HHH uses an ε\varepsilon-Partition to define H\mathcal{H} and L=V∖H\mathcal{L} = \mathcal{V} \setminus \mathcal{H}. The partitioning scheme depends on a parameter ε∈[0,1]\varepsilon \in [0,1], which is chosen such that the desired objective (running time or space) is minimized, and the partition is re-initialized whenever the graph has grown or shrunken (w.r.t. mm) substantially. We refer to the time between two re-initializations as an epoch. More precisely, for the ith epoch, we set a degree threshold θi:=(2mi)ε\theta_i := (2m_i)^\varepsilon, where mim_i is the number of edges in the graph at the beginning of the epoch, and assign a vertex vv to H\mathcal{H} if deg⁡(v)≥θi\deg(v) \geq \theta_i and to L\mathcal{L} otherwise. Afterwards, during the same epoch, vv changes partitions only if deg⁡(v)≥32θi\deg(v) \geq \frac{3}{2}\theta_i or deg⁡(v)<12θi\deg(v) < \frac{1}{2}\theta_i. We call such a change a vertex partition update (VPU) and refer to [23] for details. The next epoch i+1i+1 starts as soon as the current number of edges mm no longer satisfies ⌊mi2⌋≤m<2mi\lfloor \frac{m_i}{2} \rfloor \leq m < 2m_i. The transition between two epochs requires a major rebalancing (MR) step, where all vertices are re-classified according to the new threshold θi+1\theta_{i+1}. There are Ω(m)\Omega(m) graph updates (insertions or deletions) in each epoch and at most two VPUs per graph update, i.e., the number of changes per graph update #H\#_{\mathbb{H}} is in O(m−ε)\mathcal{O}(m^{-\varepsilon}). The ε\varepsilon-Partition further guarantees that ∣H∣∈O(m1−ε)|\mathcal{H}| \in \mathcal{O}(m^{1-\varepsilon}) and DL∈O(mε)D_{\mathcal{L}} \in \mathcal{O}(m^{\varepsilon}) at all times [23].

4.2.2 HHH Algorithm HHH explicitly maintains the counts of triangles and 4-vertex subgraphs after each edge update. Depending on the pattern(s) to count, it selects a set of auxiliary structures from the top row of Figure 4.1 and maintains their counts. As for the patterns, the auxiliary counts refer to non-induced subgraph counts, i.e., additional edges may exist. With a slight abuse of notation we use the structure name to denote its count, i.e., vLV[v] denotes the number of vLV structures with anchor vertex v. Whenever an auxiliary structure appears or disappears, i.e., after a VPU or after an edge change in the graph, HHH updates the corresponding auxiliary counts for all affected anchor vertices. During an MR step, all auxiliary structures are recomputed from scratch by simulating edge insertions for all existing edges. After a change in the graph, HHH additionally updates the pattern counts based on auxiliary counts. This results in an amortized update time of O(m1/2)\mathcal{O}(m^{1/2}) for triangles and 3-paths and O(m2/3)\mathcal{O}(m^{2/3}) for all remaining connected four-vertex non-induced subgraphs except the 4-clique. The latter 1^{1} can be directly maintained in O(m)\mathcal{O}(m) worst-case update time without any auxiliary counts by iterating over all edges and checking adjacencies [23].

4.2.3 Corrections For 3-paths containing a fixed edge e={u,v}e = \{u, v\}, the original paper [23] incorrectly states the count for the subcase where ee is a terminal edge and the first adjacent inner vertex has low degree as vLV[v]−deg⁡v‾(u)+vLV[u]−deg⁡u‾(v)\text{vLV}[v] - \deg_{\overline{v}}(u) + \text{vLV}[u] - \deg_{\overline{u}}(v). The correct count is obtained by applying the following lemma (proof in section A.2) twice, once with the roles of uu and vv swapped.

LEMMA 4.1. Assume that the auxiliary structures vLV and uLv are maintained with anchors of any degree. Let {v,u}\{v, u\} be an edge. Then, the number of 3-paths of the

1^{1}This also works for the other four-vertex patterns, but with worse amortized update times.

Figure

• low-degree ○ high-degree ● arbitrary-degree

☺ arbitrary-degree (original), high-degree (this work) ▲ anchor

Figure 4.1: Dependencies between the patterns (center) and auxiliary structures in HHH (top) and EGST (bottom). For each pattern, arcs show the structure(s) used to maintain it, where solid arcs follow the original descriptions of HHH [23] and EGST [14] and dashed ones represent dependencies added in this work. The arcs are colored to improve readability.

form v−u−x−yv-u-x-y, where x∈Lx \in \mathcal{L} is vLV[u]−Av−uLv[u,v]\mathrm{vLV}[u] - A_v - \mathrm{uLv}[u, v], where Av=deg⁡u‾(v)A_v = \deg_{\overline{u}}(v) if v∈Lv \in \mathcal{L} and 00 otherwise.

4.2.4 Optimizations Whereas algorithm design choices are often optimized for simplicity of presentation or proofs and focus on worst-case or amortized analysis, additional criteria become relevant for practical performance. In the following, we describe several modifications of HHH and the ε\varepsilon-Partition that focus strongly on the latter.

(O-LP) Lower-Degree Vertex Prioritization. Whenever we can choose whether we iterate over the neighbors of one end vertex of an edge or the other, we prioritize the lower-degree vertex.

(O-NP) Neighborhood Partitioning. An often-used strategy of HHH is to iterate over all high-degree vertices to check adjacency to some vertex x, taking O(∣H∣)\mathcal{O}(|\mathcal{H}|) time. We replace this by iterating over the high-degree neighbors of x in O(deg⁡H(x))\mathcal{O}(\deg_{\mathcal{H}}(x)) time, requiring maintenance of each vertex's neighborhood partitioned into high- and low-degree neighbors, which is implementable with constant overhead.

(O-H HHH_{HHH}) High-Degree Anchors Only. Allowing low-degree anchors can produce large auxiliary maps, increasing storage and maintenance costs. We therefore restrict all anchors to high-degree vertices (Figure 4.1). We can accomplish this without worsening asymptotic update bounds. See section A.3 for details.

(O-A) Extra Use of Auxiliary Structures. We can use extra auxiliary structures (dashed arcs in Figure 4.1) for triangle and 4-clique counting without changing asymptotic running time (see section A.4).

(O- ερ\varepsilon\rho) Tuning ε\varepsilon and the MR Frequency ρ\rho.

Recall that ε\varepsilon controls the size of H\mathcal{H}, with ∣H∣∈O(m1−ε)|\mathcal{H}| \in \mathcal{O}(m^{1-\varepsilon}). Larger ε\varepsilon reduces the number of high-degree vertices, yielding fewer anchors for auxiliary structures but more low-degree vertices as non-anchors, and shifts the trade-off between traversing H\mathcal{H} and processing neighbors of low-degree vertices. While a theoretically optimal ε\varepsilon exists for each pattern, tuning it in practice yields significant runtime improvements.

An MR is triggered when mm leaves the range ⌊mi2⌋≤m<2mi\lfloor \frac{m_i}{2} \rfloor \leq m < 2m_i. This is generalized with a rebalance factor ρ>1\rho > 1: an MR occurs only when mm exits ⌊miρ⌋≤m<ρmi\lfloor \frac{m_i}{\rho} \rfloor \leq m < \rho m_i, setting mi+1=mm_{i+1} = m and θi+1=(ρmi+1)ε\theta_{i+1} = (\rho m_{i+1})^\varepsilon. Larger ρ\rho yields longer epochs and fewer MRs without affecting asymptotic running times for constant ρ\rho.

(O-SLL) Soft, Lazy, or Late Rebalancing. Even though we can reduce the frequency of MR events (cf. (O- ερ\varepsilon\rho)), each of them still triggers expensive update steps when it occurs, as all auxiliary structures are recomputed from scratch by simulating edge insertions (cf. section 4.2.2). We here suggest three alternatives and refer to the original one as orig.

Let TauxT_{aux} be the time needed to update all auxiliary structures for a single (simulated) edge insertion or deletion. In orig, an MR results in mm edge updates to the auxiliary structures and hence incurs a total cost of O(m⋅Taux)\mathcal{O}(m \cdot T_{aux}) and an amortized cost of O(m⋅Taux⋅m−1)=O(Taux)\mathcal{O}(m \cdot T_{aux} \cdot m^{-1}) = \mathcal{O}(T_{aux}) for each update since the last MR. The time for a single VPU, i.e., for performing the partition change and updating all affected auxiliary structures, is TVPU∈O(DL⋅Taux)T_{VPU} \in \mathcal{O}(D_{\mathcal{L}} \cdot T_{aux}) [23]. The proof is in section A.5.

LEMMA 4.2. The number of vertices that are reclassified by an MR is in O(m1−ε)\mathcal{O}(m^{1-\varepsilon}).

soft A straightforward approach is to run the VPU procedure for each vertex that is incorrectly partitioned after the MR rather than deleting all auxiliary structure counts and recomputing them from scratch. In practice, this performs well if few vertices are affected. We refer to this strategy as soft. See section A.6 for the proof.

LEMMA 4.3. MR via individual VPUs (soft rebalancing) has the same total cost of O(m⋅Taux)\mathcal{O}(m \cdot T_{aux}) as the original version.

lazy. To entirely avoid a large and time-consuming operation in a single step, we consider a lazy variation to distribute the partition updates of an MR over multiple future edge updates, aiming for more stable update times. Here, we define θi+1\theta_{i+1} and a new range for mm as usual, but don't perform any partition or auxiliary structure changes except, if necessary, for the end vertices of the edge that triggered the MR. Every other vertex vv that is now wrongly partitioned w.r.t. θi+1\theta_{i+1}, i.e., deg⁡(v)<12θi+1\deg(v) < \frac{1}{2}\theta_{i+1} if v∈Hv \in \mathcal{H} or deg⁡(v)≥32θi+1\deg(v) \geq \frac{3}{2}\theta_{i+1} if v∈Lv \in \mathcal{L}, is only reassigned via a VPU when one of its incident edges is part of an update. As a consequence, if the graph grows, vertices without any incident edge updates may become stale and get stuck in H\mathcal{H}, and symmetrically for vertices in L\mathcal{L} if the graph shrinks. This may violate the bound on DLD_{\mathcal{L}} (proof in section A.7) and hence waive the amortized update time guarantee under an adversarial update sequence.

LEMMA 4.4. Rebalancing with the lazy strategy may result in DL∈Θ(m)D_{\mathcal{L}} \in \Theta(m).

late. To spread rebalancing costs without sacrificing guarantees, late combines soft's selective updates with gradual processing. Unlike lazy, it completes reclassification before the next MR, preserving the degree bounds. Recall that an epoch has length Ω(m)\Omega(m), in particular it covers at least (ρ−1)mi/ρ(\rho - 1)m_i/\rho updates. Checking both endpoints of ⌈ρ/(ρ−1)⌉\lceil \rho/(\rho - 1) \rceil edges per update therefore processes all mim_i initial edges within that interval. This distribution of work also has a positive effect on the worst-case time for maintaining the ε\varepsilon-Partition (proof in section A.8):

LEMMA 4.5. MR via individual VPUs over the first (ρ−1)ρ−1mi(\rho - 1)\rho^{-1}m_i updates of the new epoch (late rebalancing) (1) has the same total cost of O(m⋅Taux)\mathcal{O}(m \cdot T_{aux}) for the MR as the original version and (2) a constant number of VPUs per update and only on vertices of degree in O(DL)=O(mε)\mathcal{O}(D_{\mathcal{L}}) = \mathcal{O}(m^\varepsilon).

Worst-Case Update Times. We finally analyze the worst-case update times for each of the four variants. See section A.9 for the derivations.

LEMMA 4.6. The worst-case update times for HHH using different variants of the ε\varepsilon-Partition are as shown in Table 4.1. In particular, late has the same amortized update times as orig, but improves the worst-case update times by factors in [m,m][\sqrt{m}, m].

4.3 EGST Algorithm and hh-Index We next introduce the hh-Index as well as the EGST [14] algorithm along with some clarifications that do not appear in the original work. The section ends again with practical optimization strategies.

4.3.1 hh-Index Partition The hh-Index vertex partition is based on the Hirsch index (hh-Index) concept from bibliometrics [28] and transferred to graphs. The hh-Index of a graph is the largest integer hh such that there are hh vertices with degree ≥h\geq h. On an empty graph,

Table 4.1: Worst-case update times (in O\mathcal{O}) to count subgraphs with HHH using different ε\varepsilon-Partitions and the theoretically optimal ε∗\varepsilon^{*} (for the amortized time). Recall that direct scanning has O(m)\mathcal{O}(m) worst-case update time.

Subgraph ε\varepsilonworst-caseamortized
orig/softlazylateorig/softlatelazy
triangle △1/2\triangle^{1/2}m3/2m^{3/2}mm1/2m^{1/2}m1/2m^{1/2}m
3-paths ⊓1/2\sqcap^{1/2}m3/2m^{3/2}m2m^{2}mm1/2m^{1/2}m
paw ⊑1/3\sqsubseteq^{1/3}m5/3m^{5/3}m2m^{2}m2/3m^{2/3}m2/3m^{2/3}m2m^{2}
4-cycle □1/3\square^{1/3}m5/3m^{5/3}m3m^{3}mm2/3m^{2/3}m2m^{2}
diamond ⊠1/3\boxtimes^{1/3}m5/3m^{5/3}m3m^{3}mm2/3m^{2/3}m2m^{2}

L=V\mathcal{L} = V. A vertex vv swaps from L→H\mathcal{L} \to \mathcal{H} once it reaches deg⁡(v)≥2h\deg(v) \geq 2h and from H→L\mathcal{H} \to \mathcal{L} if deg⁡(v)<h\deg(v) < h. There are no major rebalances. With the hh-Index partition, ∣H∣∈O(h)|\mathcal{H}| \in \mathcal{O}(h), and DL∈O(h)D_{\mathcal{L}} \in \mathcal{O}(h), with #H∈O(1/h)\#_{\mathbb{H}} \in \mathcal{O}(1/h) amortized changes to the partition per update [15].

4.3.2 EGST algorithm The EGST algorithm uses the vertex partition (H,L)(\mathcal{H}, \mathcal{L}) given by the hh-Index. Similar to HHH, EGST also maintains per-vertex auxiliary counts that record in how many auxiliary structures a vertex participates as an anchor. Many structures tracked by EGST (see Figure 4.1) are similar to those of HHH, with one key difference being that EGST requires all anchor vertices to be high-degree, except for S3\mathrm{S}_3.

As in HHH, after every update all auxiliary and pattern counts are adjusted, however with other dependencies (see Figure 4.1). In contrast to the ε\varepsilon-Partition, where ∣H∣∈O(m1−ε)|\mathcal{H}| \in \mathcal{O}(m^{1 - \varepsilon}) and DL∈O(mε)D_{\mathcal{L}} \in \mathcal{O}(m^{\varepsilon}), both values are bounded by O(h)\mathcal{O}(h) here. This results in an amortized update time of O(h2)\mathcal{O}(h^2) [14].

4.3.3 Corrections and Completions Certain details regarding count updates were either omitted or stated ambiguously in [14], which we address in the following. Let e={u,v}e = \{u, v\} be an updated edge.

(1) Update rules for S2⊗/S3⊗\mathrm{S}_2 \otimes / \mathrm{S}_3 \otimes: No explicit update rules are given when u∈Lu \in \mathcal{L}, v∈Hv \in \mathcal{H} (or swapped), we add all missing cases. S3\mathrm{S}_3 was defined with arbitrary anchors for u,v∈Lu, v \in \mathcal{L} updates, and we applied this to the missing cases as well. S2\mathrm{S}_2 is used with mixed-degree anchors in S5/S6\mathrm{S}_5 / \mathrm{S}_6 updates but exclusively with high-degree ones in subgraph counting. Since high-degree anchors suffice for counting, we only maintain those, reducing memory.

(2) Update rules for S5⊗/S6⊗\mathrm{S}_5 \otimes / \mathrm{S}_6 \otimes: The update rules are ambiguous when u∈Lu \in \mathcal{L}, v∈Hv \in \mathcal{H} (or swapped). The paper states that S2⊗\mathrm{S}_2 \otimes is used in S5/S6\mathrm{S}_5 / \mathrm{S}_6 edge updates. However, for S6\mathrm{S}_6 this is not possible, as the low-degree vertices must be adjacent, which cannot be tested using the S2\mathrm{S}_2 count. For S5\mathrm{S}_5, this would require maintaining S2\mathrm{S}_2 with mixed-degree anchors which we decided not

Copyright © 2027 to do (see above). To preserve asymptotic bounds, we propose: When u,v∈Lu, v \in \mathcal{L}, increment S5[h1,h2]\mathrm{S}_5[h_1, h_2] for each h1∈NH(u)h_1 \in \mathrm{N}_{\mathcal{H}}(u), h2∈NH(v)h_2 \in \mathrm{N}_{\mathcal{H}}(v), h1≠h2h_1 \neq h_2, where {h1,v}∈E\{h_1, v\} \in E or {h2,u}∈E\{h_2, u\} \in E. If v∈Hv \in \mathcal{H}, increment S5[v,h]\mathrm{S}_5[v, h] for each h∈NH,v‾(u)h \in \mathrm{N}_{\mathcal{H}, \overline{v}}(u), ℓ∈NL(u)\ell \in \mathrm{N}_{\mathcal{L}}(u), where {ℓ,h}∈E\{\ell, h\} \in E or {ℓ,v}∈E\{\ell, v\} \in E. S6\mathrm{S}_6 updates are identical but require both edges present.

(3) Update rules for 3-paths ⊓\sqcap: [14] omits several cases for 3-path updates depending on the position of ee in the path. When ee is the central edge, the count is adjusted by (deg⁡(u)−1)⋅(deg⁡(v)−1)(\deg(u) - 1) \cdot (\deg(v) - 1), which overcounts by including triangles containing ee: a vertex xx adjacent to both uu and vv does not form a valid 3-path. We correct this by finding all such xx using S2\mathrm{S}_2 for x∈Lx \in \mathcal{L} and adjacency tests for x∈Hx \in \mathcal{H} when u,v∈Hu, v \in \mathcal{H}, or iterating over the low-degree endpoint's neighbors otherwise. When ee is non-central, say the 3-path is v−u−x−yv - u - x - y (symmetrical for swapped roles of uu and vv), [14] covers u∈Lu \in \mathcal{L} with x∈H∪Lx \in \mathcal{H} \cup \mathcal{L}, and u,x∈Hu, x \in \mathcal{H}, but omits u∈Hu \in \mathcal{H} with x∈Lx \in \mathcal{L}. We fill this gap in Lemma A.10 (proof in section A.10), which counts such paths using S0\mathrm{S}_0 and S2\mathrm{S}_2 with triangle corrections.

4.3.4 Optimizations This subsection presents variants designed with practical improvements to enhance the efficiency of EGST and the hh-Index. We use (O-LP) and (O-NP) as described in section 4.2.4.

(O−HEGST)(O-H_{EGST}) High-Degree Anchors Only. For the same reasons as in (O−HHHH)(O-H_{HHH}), having high-degree anchors only is desirable also for EGST. Here, this only requires a modification of S3S_3 (all other auxiliary structures have high anchors already): For edge insertions/deletions with e={u,v}e = \{u, v\}, if u,v∈Lu, v \in \mathcal{L} we update S3[h1,h2]S_3[h_1, h_2] by one for all distinct pairs {h1,h2}\{h_1, h_2\} with h1∈NH(u)h_1 \in \mathrm{N}_{\mathcal{H}}(u) and h2∈NH(v)h_2 \in \mathrm{N}_{\mathcal{H}}(v) in O(h2)\mathcal{O}(h^2) time. If, w.l.o.g., v∈Hv \in \mathcal{H} and u∈Lu \in \mathcal{L}, we update S3[y,v]S_3[y, v] by one for all y∈NH(x)y \in \mathrm{N}_{\mathcal{H}}(x) with x∈NL(u)x \in \mathrm{N}_{\mathcal{L}}(u) in O(h2)\mathcal{O}(h^2) time. In consequence, we update 4-cycle counts by iterating over low-degree neighbors instead of using S3\mathrm{S}_3. The new procedure takes time O(h2)\mathcal{O}(h^2) and does not affect the asymptotic running time.

(O−D)(O-D) Direct Partition Swap. When a vertex changes partition, the auxiliary counts need to be updated accordingly. This can be done by examining all edges adjacent to the updated vertex one by one and following the procedure for edge updates, described in [14] and (O−HEGST)(\mathrm{O-H}_{\mathrm{EGST}}), twice: Once to subtract counts of now-invalid structures and once to add newly formed structures. However, the partition swap can also be performed directly by scanning the 2-hop neighborhood in the same running time bounds (see section A.11).

(O−GF)(O-GF) Tuning the Gradual Factor of the hh-Index Partition. In [15], a vertex vv is placed in H\mathcal{H} only when deg⁡(v)≥2h\deg(v) \geq 2h, which in practice often yields very few high-degree vertices. We introduce a gradual factor cc, placing vv in H\mathcal{H} when deg⁡(v)≥c⋅h\deg(v) \geq c \cdot h. We prove that the running time bounds remain the same in section A.12.

Table 4.2: Amortized update times (in O\mathcal{O}) for subgraph counts using HHH or EGST combined with an abstract partition P\mathcal{P}, the ε\varepsilon-Partition, or the hh-Index. Shaded terms only apply to the high-anchors-only optimization.

NameP\mathcal{P}ε\varepsilon-Partitionhh-Index
HHH with (O-HHH)
triangle∣H∣+DL+DL2⋅#♯|\mathcal{H}| + D_{\mathcal{L}} + D_{\mathcal{L}}^{2} \cdot \#_{\sharp}mmax⁡(1−ε,ε)≥mm^{\max(1-\varepsilon,\varepsilon)} \geq \sqrt{m}hh
3-path∣H∣+DL+DL2⋅#♯|\mathcal{H}| + D_{\mathcal{L}} + D_{\mathcal{L}}^{2} \cdot \#_{\sharp}mmax⁡(1−ε,ε)≥mm^{\max(1-\varepsilon,\varepsilon)} \geq \sqrt{m}hh
paw∣H∣+DL2+DL2⋅#♯|\mathcal{H}| + D_{\mathcal{L}}^{2} + D_{\mathcal{L}}^{2} \cdot \#_{\sharp}mmax⁡(1−ε,2ε)≥m2/3m^{\max(1-\varepsilon,2\varepsilon)} \geq m^{2/3}h2h^{2}
4-cycle∣H∣+DL2+(DL3+DL∣H∣)#♯|\mathcal{H}| + D_{\mathcal{L}}^{2} + (D_{\mathcal{L}}^{3} + D_{\mathcal{L}}|\mathcal{H}|)\#_{\sharp}mmax⁡(1−ε,2ε)≥m2/3m^{\max(1-\varepsilon,2\varepsilon)} \geq m^{2/3}h2h^{2}
diamond∣H∣+DL2+(DL3+DL∣H∣)#♯|\mathcal{H}| + D_{\mathcal{L}}^{2} + (D_{\mathcal{L}}^{3} + D_{\mathcal{L}}|\mathcal{H}|)\#_{\sharp}mmax⁡(1−ε,2ε)≥m2/3m^{\max(1-\varepsilon,2\varepsilon)} \geq m^{2/3}h2h^{2}
4-cliquemmmmmm
EGST with (O-EGST)
triangle∣H∣+DL+DL2⋅#♯|\mathcal{H}| + D_{\mathcal{L}} + D_{\mathcal{L}}^{2} \cdot \#_{\sharp}mmax⁡(1−ε,ε)≥mm^{\max(1-\varepsilon,\varepsilon)} \geq \sqrt{m}hh
3-path∣H∣+DL+DL2⋅#♯|\mathcal{H}| + D_{\mathcal{L}} + D_{\mathcal{L}}^{2} \cdot \#_{\sharp}mmax⁡(1−ε,ε)≥mm^{\max(1-\varepsilon,\varepsilon)} \geq \sqrt{m}hh
paw∣H∣2+DL2+DL3⋅#♯|\mathcal{H}|^{2} + D_{\mathcal{L}}^{2} + D_{\mathcal{L}}^{3} \cdot \#_{\sharp}mmax⁡(2−2ε,2ε)≥mm^{\max(2-2\varepsilon,2\varepsilon)} \geq mh2h^{2}
4-cycle∣H∣⋅DL+∣H∣2+DL2+DL3⋅#♯|\mathcal{H}| \cdot D_{\mathcal{L}} + |\mathcal{H}|^{2} + D_{\mathcal{L}}^{2} + D_{\mathcal{L}}^{3} \cdot \#_{\sharp}mmax⁡(1−2ε,2−2ε,2ε)≥mm^{\max(1-2\varepsilon,2-2\varepsilon,2\varepsilon)} \geq mh2h^{2}
diamond∣H∣2+DL2+DL3⋅#♯|\mathcal{H}|^{2} + D_{\mathcal{L}}^{2} + D_{\mathcal{L}}^{3} \cdot \#_{\sharp}mmax⁡(2−2ε,2ε)≥mm^{\max(2-2\varepsilon,2\varepsilon)} \geq mh2h^{2}
4-clique∣H∣2+DL2+DL3⋅#♯|\mathcal{H}|^{2} + D_{\mathcal{L}}^{2} + D_{\mathcal{L}}^{3} \cdot \#_{\sharp}mmax⁡(2−2ε,2ε)≥mm^{\max(2-2\varepsilon,2\varepsilon)} \geq mh2h^{2}

4.4 Separating Algorithms and Partitioning Both HHH and EGST operate on any vertex partition. We therefore decouple the algorithms from their specific partitions, derive update times for an abstract partition P\mathcal{P}, and analyze cross-combinations.

Table 4.2 states the amortized update times for both algorithms under P\mathcal{P}. For derivations, see section A.13 for EGST, [22] for HHH, and section A.3 for (O−HHHH)(\mathrm{O - H}_{\mathrm{HHH}}). The table also shows the cross-combination bounds, which (in all cases) preserve or worsen the amortized update time, especially for EGST with ε\varepsilon-Partition. Notably, HHH with hh-Index matches EGST with hh-Index for all patterns except the 4-clique: HHH uses a naive O(m)\mathcal{O}(m) routine, while EGST achieves O(h2)\mathcal{O}(h^2) via S6\mathrm{S}_6 and S7\mathrm{S}_7, exploiting ∣H∣,DL∈O(h)|\mathcal{H}|, D_{\mathcal{L}} \in \mathcal{O}(h) under hh-Index. With ε\varepsilon-Partition, where O(∣H∣)≠O(DL)\mathcal{O}(|\mathcal{H}|) \neq \mathcal{O}(D_{\mathcal{L}}), EGST's 4-clique time becomes O(mmax⁡(2−2ε,2ε))=O(m)\mathcal{O}(m^{\max(2 - 2\varepsilon, 2\varepsilon)}) = \mathcal{O}(m) at ε=0.5\varepsilon = 0.5, matching the trivial bound without partitioning.

Our analysis also reveals that HHH and EGST have identical complexity for triangles and 3-paths. They differ for paw, 4-cycle, and diamond: EGST's update time scales quadratically with ∣H∣|\mathcal{H}| for these patterns, as its auxiliary structures only involve low-degree vertices besides the anchors. Patterns where both non-anchor vertices are in H\mathcal{H} require enumerating all pairs in H\mathcal{H}.

5 Experimental Evaluation We experimentally evaluate the algorithms, their proposed optimizations, and cross-combinations against several baselines on a diverse set of graphs.

Copyright © 2027

5.1 Methodology We implemented our algorithms [20] in C++20 (g++ -03). For anchor-to-count mappings we used boost::unordered_flat_map [5], which outperformed alternatives in preliminary tests. We always apply (O-LP) and (O-NP), as they consistently improve performance and denote these base versions HHH* and EGST*. Further variants layer additional optimizations: HHH*-H adds high-degree anchors (O-HHHH_{HHH}), HHH*-A adds auxiliary counting structures (O-A), and HHH*-HA combines both. Analogously, EGST*-H uses high-degree anchors (O-HEGST_{EGST}), EGST*-D uses direct partition swaps (O-D), and EGST*-HD combines both. We evaluate ε\varepsilon-Partition variants orig, soft, lazy, and late, where the ε\varepsilon value is indicated as a suffix, e.g., soft.5 for ε=0.5\varepsilon = 0.5. The hh-Index partition with gradual factor cc is written h(c). We denote algorithm A with partition P as A|P, e.g., EGST*|h(2) or HHH*-A|soft.5.

We compare against all available state-of-the-art algorithms capable of counting both triangles and four-vertex subgraphs. The only fully-dynamic subgraph counter we are aware of is DNA [71], which we extended to provide a runner and result extraction [70]. We evaluate against the continuous subgraph matching (CSM) algorithms RapidFlow [75, 74], Graphflow [34], TurboFlux [36], IEDyn [30, 31], and SymBi [56]. The latter four are implemented and benchmarked by Sun et al. [76, 74]. Following their recommendations, we use Graphflow and SymBi for all patterns, and additionally include TurboFlux and IEDyn for tree-structured (3-path) queries. We also compare against recomputing counts from scratch after each update using two static algorithms: OB [59, 60] and ESCAPE [63, 64]. For the latter we applied a memory leak patch [20].

Experiments ran on Ubuntu 24.04.1 LTS with a dual-socket AMD EPYC 9534 (128 cores, 3.72 GHz max) and 1.48 TB RAM, each experiment pinned to a single core without overlapping caches. We report medians over three runs and use geometric means across instances. A speedup of q×q \times for AA over BB means q=T(B)/T(A)q = T(B) / T(A) where T(⋅)T(\cdot) can refer to total runtime (sum of update times), maximum update time, and memory usage. Unless stated otherwise, all seven patterns are maintained simultaneously. We validated our implementations by verifying the counts manually on small instances and by cross-checking them with the counts reported by the static baselines OB and ESCAPE after each update.

We use real-world and synthetic datasets from various domains (Table 5.1), partitioned into four groups: WIKI [40]: Wikipedia hyperlink networks with real insertions and deletions. TMP [9, 55, 2, 47]: timestamped real-world graphs [46, 69] where edges are inserted at their timestamp and removed two weeks later [9]. KRONc and KRONG [24]: synthetic dynamic Kronecker graphs [43] derived from snapshot differences, with constant or growing vertex counts respectively. All instances were preprocessed by removing multi-edges, self-loops, directions, and deletions of non-existing edges. Beyond the full dataset (FS), we use a balanced engineering subset (ES) of the first two million updates from six graphs per group (highlighted in Table 5.1; details in Table A.4). We will finally use FS to validate our parameter choices made on ES.

Table 5.1: Full Data Set (FS) with #updates ( δ\delta ), and max. #edges ( m^\widehat{m} ). Shaded cells indicate membership to the engineering dataset ES. Full statistics in Table A.3.

WIKI [40, 65]TMP
IDGraphδm^\widehat{m}IDGraphδm^\widehat{m}
Asimple wiki1.6M690.7KAreality-call [69, 13]7.2K3.6K
Bnl wiki18.9M9.6MBwiki-elec [69, 44]201.5K100.8K
Cpl_wiki23.6M11.4MCtech-as-topology [69]215.4K107.7K
Dit_wiki33.1M15.7MDreddit-body [46, 39]433.5K4K
Efr_wiki56.3M22.3MEmathoverflow [46, 61, 72]458K2.5K
Fde_wiki82M28.1MFenron [69, 11]594.9K297.5K
Greddit-title [46, 39]824.7K7.8K
Haskubuntu [46, 61, 72]952.4K6.1K
Isuperuser [46, 61, 72]1.5M7.3K
Jwiki-talk [46, 61, 45]6.3M102K
Kyoutube-growth [69, 57]18.8M9.4M
Lstackoverflow [46, 61, 72]59.4M277.9K
KRONc [24, 25]KRONg [24, 25]
IDGraphδm^\widehat{m}IDGraphδm^\widehat{m}
Ac answers2.6M185.5KAg answers538.3K184.9K
Bc delicious3.2M225.9KBg delicious646K225.3K
Cc epinions5.9M413.7KCg epinions1.1M413K
Dc flickr4.3M305.5KDg flickr853.4K304.7K
Ec blog-nat05-6m18.7M1.3MEg blog-nat05-6m3.3M1.3M
Fc blog-nat06all22.3M1.6MFg blog-nat06all3.9M1.6M
Gc cit-hep-ph22.2M1.6MGg cit-hep-ph3.9M1.6M
Hc cit-hep-th29.8M1.6MHg cit-hep-th3.9M1.6M
Ic ca-dblp8.5M597.3KIg ca-dblp1.6M596K
Jc ca-gr-qc7.9M559.2KJg ca-gr-qc1.5M558.4K
Kc ca-hep-th5.3M374.1KKg ca-hep-ph5.3M2.1M
Lc ca-hep-ph30.4M2.1MLg ca-hep-th1M373.2K
Mc web-notredame4.1M288.7KMg web-notredame811.6K288.1K
Nc as-newman6.9M487.6KNg as-newman1.3M486K
Oc as-routeviews7.9M556.9KOg as-routeviews1.5M555.3K
Pc gnutella-302.9M203.4KPg gnutella-25722.1K253.2K
Qc gnutella-253.6M254.1KQg gnutella-30587.7K202.7K
Rc atp-gr-qc1.3M90.9KRg atp-gr-qc277.3K90.5K
Sc bio-proteins9.5M667.5KSg bio-proteins1.8M666.3K

5.2 HHH and ε\varepsilon -Partition Optimizations We first evaluate HHH* with optimizations on the original ε\varepsilon -Partition, followed by a parameter study for ε\varepsilon and ρ\rho . Finally, we consider the best variant of HHH* in combination with different partitions, i.e. ε\varepsilon -Partition variants soft, lazy and late as well as the h-Index.

5.2.1 Proposed Optimizations We start by evaluating (O-HHHH_{HHH}), where all anchors have high degree, on the ES graphs. For this experiment, we set ε=0.417\varepsilon = 0.417 as a compromise between the optimum of 12\frac{1}{2} for triangles and 3-paths and 13\frac{1}{3} for all other patterns (except for 4-clique/claw, which don't use the partition), i.e., we compare HHH*-H|orig.417 to HHH*|orig.417. As HHH*-H restricts what vertices can serve as anchors to those with high degree, fewer counts need to be stored at the expense of more iterations over neighborhood sets. Despite this, HHH*-H achieves a 21.9×21.9\times speedup in total time, a 116.1×116.1\times speedup in the maximum update time, and reduces memory usage by a factor of 49.0×49.0\times over HHH*. These results showcase the impressive efficiency

Copyright © 2027

Figure

Figure 5.1: Effects of the ε\varepsilon parameter on the runtime of HHH∗−HAHHH^{*}-HA orig using dataset ES (counting all patterns). Note the logarithmic y-axis.

Figure

Figure 5.2: Performance of HHH∗HHH^{*}-HA for different vertex partitions w.r.t. ε\varepsilon on ES data (counting all patterns).

of (O−HHHH)(O-H_{HHH}) and demonstrate that the typical memory-runtime tradeoff, i.e., storing more to save computation time, can reach the point where finding, storing and accessing the auxiliary counts outweigh the benefits of reduced traversals in the subgraph counting step.

Another proposed optimization, (O-A), uses additional auxiliary structures where possible; however, preliminary experiments showed this is only slightly beneficial if all patterns are counted.

We use HHH∗−HAHHH^{*}-HA in experiments where all patterns are counted and HHH∗−HHHH^{*}-H otherwise.

5.2.2 Analysis of ε\varepsilon for the ε\varepsilon-Partition In Figure 5.1 we decompose runtime into partition maintenance, auxiliary-structure maintenance, and pattern counting, which directly correlate with the number of partition changes, structure updates and traversals of the neighborhood or the H set, respectively. We use orig on ES; the effects are identical for other variants. Increasing ε\varepsilon reduces the high-degree set and generally lowers partition and structure time, but increases counting time, which dominates overall runtime. We observe that counting all patterns simultaneously is fastest at ε=0.2\varepsilon = 0.2, below the theoretical optima of 1/3 or 1/2. Two effects contribute to this difference. First, neighborhood partitioning replaces full high-degree set scans with high-degree-neighbor scans, reducing the penalty for a larger H. Second, simultaneous counting shares auxiliary structures across patterns, reducing their relative maintenance overhead. Thus, the optimal ε\varepsilon for counting all patterns simultaneously cannot be derived by simply averaging the individual optima per pattern. In practice, ε\varepsilon should be chosen smaller than the theoretical optimum.

5.2.3 Best Partitions for HHH We compare all partitions studied in this work using HHH∗HHH^{*}-HA on ES. For the h-Index, we vary the gradual factor c∈{1+12x∣x=0,…,10}c \in \{1 + \frac{1}{2^x} \mid x = 0, \ldots, 10\}; for the ε\varepsilon-Partition, we compare orig, soft, late, and lazy with ε∈{0.1+i30∣i=0,…,9}\varepsilon \in \{0.1 + \frac{i}{30} \mid i = 0, \ldots, 9\} rounded to three digits. Figure 5.2 reports overall running time, maximum update time, and memory usage. To increase readability, we show only h(2) (the original choice) and h( 1716\frac{17}{16}) (the best in our experiments).

Total runtime. All ε\varepsilon-Partition variants perform best at ε=0.2\varepsilon = 0.2. Among variants preserving amortized guarantees, late.2 is fastest, 1.10×1.10 \times faster than orig.2 and 1.01×1.01 \times than soft.2. lazy is another 1.2% faster but lacks these guarantees. For h-Index partitions, h(17/16) achieves a 1.39×1.39 \times speedup over h(2), though late.2 remains 2.5×2.5 \times faster.

Maximum update time. Maximum update time generally decreases with ε\varepsilon, as the high-degree set shrinks and partition changes become fewer. By replacing reconstruction with individual VPUs, soft improves on orig by factors of 4.3–13.3. late further limits VPUs per update, yielding improvements of 9.6–42.6, including 16.2×16.2 \times at ε=0.2\varepsilon = 0.2. lazy, with at most two VPUs per update, is only 1.3% faster than late. With a smaller high-degree set and fewer partition changes, h(17/16) achieves 4.6×4.6 \times faster maximum updates than late.2, at the expense of total runtime.

Memory. Fewer high-degree vertices mean fewer potential anchors and generally smaller auxiliary maps. orig and soft use similar memory because their partitions are identical after each update. At ε=0.2\varepsilon = 0.2, late and lazy use 93.1% of orig's memory on average, though differences vary across instances. With an even smaller high-degree set, h(17/16) uses only 61.7% of late.2's memory.

We studied the rebalance factor ρ\rho (see section A.15) and found the optimal choice to be highly graph-dependent. We fix ρ=2\rho = 2 as a good compromise.

Finally, we also briefly evaluate HHH∗−H∣lateHHH^{*}-H|late for single patterns instead of all simultaneously (cf. section A.17). Also here, ε\varepsilon should be chosen smaller than its theoretically optimal value: For diamonds, paws and 4-cycles, ε=0.233\varepsilon = 0.233 yields the best results in practice with speedups of 1.2×1.2\times, 1.6×1.6\times, 1.4×1.4\times, respectively, over the theoretically best ε=13\varepsilon = \frac{1}{3}. The deviation in running time from ε=0.2\varepsilon = 0.2, the best choice for “all”, is within 10% in the geometric mean. For counting all patterns simultaneously, a slightly smaller ε\varepsilon is faster in practice since auxiliary structures can be used for multiple patterns without increasing structure time (see Section 5.2.2). For 3-paths, ε=0.333\varepsilon = 0.333 is 1.5×1.5\times faster than the theoretical optimum of ε=12\varepsilon = \frac{1}{2}, and almost twice as fast as ε=0.2\varepsilon = 0.2. Clever neighborhood scanning without

Figure

Figure 5.3: Performance of EGST*-HD for different vertex partitions w.r.t. ε\varepsilon on ES data (counting all patterns).

any auxiliary structures works best for triangles and 4-cliques and obliterates the need for a partition, yielding speedups of 1.9×1.9\times and 1.5×1.5\times over late.2 respectively.

late.2 and h(17/16) are the fastest ε\varepsilon-Partition and h-Index variants, respectively, offering different tradeoffs: late is 2.5×2.5\times faster in total runtime, while h(17/16) has 4.6×4.6\times faster maximum updates and uses 38.4% less memory. lazy.2 (without preserving theoretical bounds) is ≈1%\approx1\% faster than late.2. ρ=2\rho = 2 is a good default for all ε\varepsilon-Partitions.

5.3 Optimizing EGST Performance We compare the four combinations of proposed EGST optimizations: high-degree anchors (EGST*-H), direct partition swaps (EGST*-D), and their combination (EGST*-HD) on ES using h(2). EGST*-HD achieves a 4.3×4.3\times faster total runtime and 132.9×132.9\times faster maximum update time over base EGST, with high-degree anchors contributing most of the gain; full results are in section A.16.

5.3.1 Different Partitions for EGST Using EGST*-HD as best-performing EGST variant, we evaluate vertex partitions on ES. We vary c∈{1+12x∣x=0,…,10}c \in \{1 + \frac{1}{2^x} \mid x = 0, \ldots, 10\} for h-Index and ε∈{0.3+i30∣i=0,…,5}\varepsilon \in \{0.3 + \frac{i}{30} \mid i = 0, \ldots, 5\} (rounded to three digits) for lazy and late, the best ε\varepsilon-Partition variants from section 5.2.3. Figure 5.3 reports total runtime, maximum update time, and memory. As in section 5.2.3, we only include h(2) and h(17/16), where the latter achieves 1.3×1.3 \times faster total runtime, 1.1×1.1 \times faster updates, and only 4% more memory.

The effects of ε\varepsilon-Partition in section 5.2.2 also favor ε\varepsilon below the theoretical optimum of 1/2 for EGST. late.367, lazy.367, and h(17/16) have similar total runtime, but h(17/16) achieves 1.32×1.32\times faster maximum updates and uses 14.8% less memory. These averages mask instance-level differences: ε=0.333\varepsilon = 0.333 wins on 17 of 24 graphs by up to 1.3×1.3\times, whereas h(17/16) wins on dense, high-count instances such as WIKI by up to 3.3×3.3\times, consistent with EGST's quadratic dependence on ∣H∣|\mathcal{H}|.

For single patterns, there is no clear winner (cf. section A.17). We focus on late/h-Index to preserve theoretical guarantees. While h(17/16) performs best for diamonds, late is faster otherwise: 1.1×1.1 \times for 4-cycles and paws ( ε=.333\varepsilon = .333), and 1.03×1.03 \times for 3-paths ( ε=.433\varepsilon = .433). As with HHH, triangles and 4-cliques are fastest without a partition (equivalently, lazy1.0).

Figure 5.4: (a) Running times (total, maximum, and 99th-pctl) over ES graphs limited to 150K updates and (b) update times on WIKI-E. Both counting all patterns.

Figure

Figure 5.5: Running times of dynamic subgraph counting and CSM algorithms using dataset ES.

When counting all patterns with EGST*-HD, h(17/16) is the best partition with similar total runtime as late.367, but with 1.3×1.3\times faster maximum update time and 14.8% less memory.

5.4 Comparison to Static Baselines We compare our dynamic algorithms against static recomputation via OB and ESCAPE after every update when counting all patterns simultaneously. We include both basic (HHH* | orig.417, EGST* | h(2)) and fully optimized versions (HHH*-HA | late.2, EGST*-HD | h(17/16)), evaluated on the first 150 000 updates of each ES instance to accommodate static runtimes. In consequence, KRONc instances are insertions-only here, while KRONG, WIKI, and TMP instances retain most characteristics. Results (Figure 5.4) show: Dynamic counting improves total runtime by 2–4 orders of magnitude, but basic versions occasionally take longer than static recomputation for individual updates, despite being 1–3 orders faster on 99% of updates. Figure 5.4 links these peaks to expensive auxiliary-map maintenance and major rebalancing. The introduced optimizations restrict anchors and avoid full reconstruction, improving total runtime and maximum update time.

Overall, HHH∗−HA∣late.2HHH^{*}-HA|late.2 and EGST∗−HD∣h(17/16)EGST^{*}-HD|h(17/16) clearly outperform static algorithms and non-optimized counterparts in both total and maximum update time.

5.5 Comparison to Dynamic Baselines We compare our algorithms against DNA (dynamic subgraph

Copyright © 2027

Figure

Figure 5.6: Running times of dynamic subgraph counting algorithms using dataset FS (counting all patterns).

counting) and state-of-the-art CSM algorithms [76, 75] on ES, using the best-performing configuration of our algorithms for each pattern. Specifically, HHH*-HA|late.2 is used for all patterns simultaneously, HHH*-H with late.233 (diamonds, paws, 4-cycles), late.333 (3-paths), or late1.0 (triangles, 4-cliques); and EGST*-HD with h(17/16) (all, diamonds), late.333 (3-paths, 4-cycles), late.433 (paws), or late1.0 (triangles, 4-cliques). Note that the late1.0 variants are identical scanning algorithms without auxiliary structures. CSM algorithms count single patterns; DNA counts triangles and all patterns. All baselines have a 5 h timeout. Results are shown in Figure 5.5. DNA timed out on half of the instances. SymBi timed out for 3-paths on WIKI-D. We use 5 h as a lower bound for speedup computation. RapidFlow crashed (segmentation faults) on up to 25% of the instances for paws, 4-cycles, and diamonds. We therefore excluded it for these patterns.

Compared to DNA, HHH*-HA is ≥ 264.6× faster for all patterns and HHH*-H is ≥ 2325× faster on triangles. For triangles, 3-paths, and 4-cliques, RapidFlow performed best among CSM baselines; on paws, 4-cycles and diamonds, Graphflow did. HHH*-H outperforms it across all patterns, with speedups between 1.8× (4-cliques) and 26.2× (4-cycles). On individual instances, gains can exceed two orders of magnitude (e.g., 149.8× on WIKI-D for 4-cycles). The exception can be graphs with very low pattern counts like KRONc-R (Table A.4), where Graphflow outperforms HHH*-H by up to 1.7× on 3-paths, paws, and diamonds, where auxiliary structure overhead does not pay off.

HHH*-H achieves speedups of 1.8×−26.2×1.8 \times -26.2 \times over Graphflow/RapidFlow and ≥2325×\geq 2325 \times over DNA (triangles); HHH*-HA is ≥264.6×\geq 264.6 \times faster than DNA (all patterns). Only on graphs with very low pattern frequency can Graphflow outperform HHH*-H by up to 44%.

5.6 Performance Evaluation on FS

We evaluate performance (Figure 5.6) by comparing the best combinations (HHH*-HA|late.2, EGST*-HD|h(17/16)) alongside their untuned counterparts (HHH*-HA|orig.417, EGST*-HD|h(2)) on FS to validate the parameter choices made on ES (Table A.3). We use a 24h timeout. For timed-out runs, we record a time of 24h, which under-estimates the reported speedups. Partition tuning yields a 2.6× speedup (0.9–7.7× per graph) for HHH*-HA|late.2 over HHH*-HA|orig.417, and 1.1× (0.9–2.0×) for EGST*-HD|h(17/16) over EGST*-HD|h(2). Comparing the best versions, EGST*-HD|h(17/16) timed out on WIKI-D/E/F after completing 97.5%/61.0%/39.2% of updates, while HHH*-HA|late.2 finished in 7.9h/13.7h/13.2h. On all remaining instances, HHH*-HA|late.2 achieves an overall 2.7× speedup (0.9–8.3×), improving runtime on every instance except those with very few pattern counts (KRONc-R, KRONG-R), where scanning algorithms without auxiliary structures remain preferable. This effect is less severe for EGST*-HD|h(17/16), which maintains simpler auxiliary structures. The speedup of HHH*-HA|late.2 partly stems from storing more auxiliary structures, enabled by fewer structural restrictions and a larger |H|, costing 74.9% more memory than EGST*-HD|h(17/16); increasing ε with late reduces memory at the expense of runtime.

HHH*-HA|late.2 outperforms EGST*-HD by multiple factors on nearly all instances, but uses more memory.

6 Conclusion and Practical Recommendations Our HHH*-H/HHH*-HA algorithms are the most effective for dynamic subgraph counting, offering speedups of up to several orders of magnitude. We recommend the following configurations:

All (all patterns simultaneously): HHH*-HA|late.2.

☑ ☑ ☐ (diamond, paw, 4-cycle): HHH*-H|late.233.

□ (3-path): HHH*-H|late.333.

△ ⊠ ⊠ (triangle, 4-clique, claw): prefer efficient scanning/direct counting as in HHH*/EGST* without partition.

Memory constrained: Increase ε\varepsilon in late to trade runtime for memory, if ε≥0.4\varepsilon \geq 0.4 switch to h(17/16), or to EGST*-HD|h(17/16) if memory remains insufficient. Practically fastest: Use lazy instead of late; it was ≈1%\approx 1\% faster than late in practice, but waives the amortized and worst-case update time guarantees.

Small counts: If it is known a priori that the subgraph counts will be small, auxiliary structures may create

Copyright © 2027 overhead; the scanning routines used by HHH* -HA/EGST* for cliques or Graphflow can be preferable.

Acknowledgements OpenAI Codex assisted with language editing, reference formatting, and LaTeX/PDF checks. The authors assume responsibility for all content.

References

[1] A. ABBOUD, A. BACKURS, AND V. VASSILEVSKA WILLIAMS, If the current clique algorithms are optimal, so is valiant's parser, SIAM J. Comput., 47 (2018), pp. 2527–2555, https://doi.org/10.1137/16M1061771.

[2] A. AGHASADEGHI, J. V. DEN BUSSCHE, AND J. STOYANOVICH, Temporal graph patterns by timed automata, VLDB J., 33 (2024), pp. 25–47, https://doi.org/10.1007/S00778-023-00795-Z.

[3] N. K. AHMED, N. G. DUFFIELD, T. L. WILLKE, AND R. A. ROSSI, On sampling from massive graph streams, Proc. VLDB Endow., 10 (2017), pp. 1430–1441, https://doi.org/10.14778/3137628.3137651, http://www.vldb.org/pvldb/vol10/p1430-ahmed.pdf.

[4] S. ASSADI AND V. SHAH, An improved fully dynamic algorithm for counting 4-cycles in general graphs using fast matrix multiplication, Proc. ACM Manag. Data, 3 (2025), pp. 91:1–91:24, https://doi.org/10.1145/3725228.

[5] Boost.Unordered. https://www.boost.org/doc/libs/latest/libs/unordered, 2026. Accessed: 2026-07-20.

[6] D. BU, Y. ZHAO, L. CAI, H. XUE, X. ZHU, H. LU, J. ZHANG, S. SUN, L. LING, N. ZHANG, G. LI, AND R. CHEN, Topological structure analysis of the protein–protein interaction network in budding yeast, Nucleic Acids Research, 31 (2003), pp. 2443–2450, https://doi.org/10.1093/nar/gkg340.

[7] L. BULTEAU, V. FROESE, K. KUTZKOV, AND R. PAGH, Triangle counting in dynamic graph streams, Algorithmica, 76 (2016), pp. 259–278, https://doi.org/10.1007/S00453-015-0036-4.

[8] L. S. BURIOL, G. FRAHLING, S. LEONARDI, A. MARCHETTI-SPACCAMELA, AND C. SOHLER, Counting triangles in data streams, in Proceedings of the Twenty-Fifth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, June 26-28, 2006, Chicago, Illinois, USA,

S. Vansummeren, ed., ACM, 2006, pp. 253–262, https://doi.org/10.1145/1142351.1142388.

[9] Q. CHEN, O. LACHISH, S. HELMER, AND M. H. BÖHLEN, Dynamic spanning trees for connectivity queries on fully-dynamic undirected graphs, Proc. VLDB Endow., 15 (2022), pp. 3263–3276, https://doi.org/10.14778/3551793.3551868, https://www.vldb.org/pvldb/vol15/p3263-chen.pdf.

[10] S. CHOUDHURY, L. B. HOLDER, G. C. JR., K. AGARWAL, AND J. FEO, A selectivity based approach to continuous pattern detection in streaming graphs, in Proceedings of the 18th International Conference on Extending Database Technology, EDBT 2015, Brussels, Belgium, March 23-27, 2015, G. Alonso, F. Geerts, L. Popa, P. Barceló, J. Teubner, M. Ugarte, J. V. den Bussche, and J. Paredaens, eds., OpenProceedings.org, 2015, pp. 157–168, https://doi.org/10.5441/002/EDBT.2015.15.

[11] W. COHEN, Enron email dataset. http://www.cs.cmu.edu/enron/. Accessed in 2009.

[12] L. DHULIPALA, Q. C. LIU, J. SHUN, AND S. YU, Parallel batch-dynamic k-clique counting, in 2nd Symposium on Algorithmic Principles of Computer Systems, APOCS 2020, Virtual Conference, January 13, 2021, M. Schapira, ed., SIAM, 2021, pp. 129–143, https://doi.org/10.1137/1.9781611976489.10.

[13] N. EAGLE AND A. PENTLAND, Reality mining: sensing complex social systems, Personal and Ubiquitous Computing, 10 (2006), pp. 255–268.

[14] D. EPPSTEIN, M. T. GOODRICH, D. STRASH, AND L. TROTT, Extended dynamic subgraph statistics using h-index parameterized data structures, Theor. Comput. Sci., 447 (2012), pp. 44–52, https://doi.org/10.1016/j.tcs.2011.11.034.

[15] D. EPPSTEIN AND E. S. SPIRO, The h-index of a graph and its application to dynamic subgraph statistics, J. Graph Algorithms Appl., 16 (2012), pp. 543–567, https://doi.org/10.7155/jgaa.00273.

[16] W. FAN, X. WANG, AND Y. WU, Incremental graph pattern matching, ACM Transactions on Database Systems (TODS), 38 (2013), pp. 1–47.

[17] F. L. GALL, Powers of tensors and fast matrix multiplication, in International Symposium on Symbolic and Algebraic Computation, ISSAC '14,

Copyright © 2027

Kobe, Japan, July 23-25, 2014, K. Nabeshima, K. Nagasaka, F. Winkler, and Á. Szántó, eds., ACM, 2014, pp. 296–303, https://doi.org/10.1145/2608628.2608664.

[18] P. GUPTA, V. SATULURI, A. GREWAL, S. GU-RUMURTHY, V. ZHABIUK, Q. LI, AND J. LIN, Real-time twitter recommendation: Online motif detection in large dynamic graphs, Proc. VLDB Endow., 7 (2014), pp. 1379–1380, https://doi.org/10.14778/2733004.2733010, http://www.vldb.org/pvldb/vol7/p1379-lin.pdf.

[19] G. HAN AND H. SETHU, Edge sample and discard: A new algorithm for counting triangles in large dynamic graphs, in Proceedings of the 2017 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining 2017, Sydney, Australia, July 31 - August 03, 2017, J. Diesner, E. Ferrari, and G. Xu, eds., ACM, 2017, pp. 44–49, https://doi.org/10.1145/3110025.3110061.

[20] K. HANAUER, S. HECK, M. HENZINGER, AND L. SIDL, DynamicSubgraphCounter, Oct. 2026, https://doi.org/10.5281/zenodo.23367636.

[21] K. HANAUER, S. HECK, M. HENZINGER, AND L. SIDL, Fully dynamic triangle and 4-vertex subgraph counting: From theory to practice and back again, in Proceedings of the SIAM Symposium on Algorithm Engineering and Experiments (ALENEX), SIAM, 2027. To appear. Short proceedings version.

[22] K. HANAUER, M. HENZINGER, AND Q. C. HUA, Fully dynamic four-vertex subgraph counting, CoRR, abs/2106.15524 (2021), https://arxiv.org/abs/2106.15524, https://arxiv.org/abs/2106.15524.

[23] K. HANAUER, M. HENZINGER, AND Q. C. HUA, Fully dynamic four-vertex subgraph counting, in 1st Symposium on Algorithmic Foundations of Dynamic Networks, SAND 2022, March 28-30, 2022, Virtual Conference, J. Aspnes and O. Michail, eds., vol. 221 of LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022, pp. 18:1–18:17, https://doi.org/10.4230/LIPIcs.SAND.2022.18.

[24] K. HANAUER, M. HENZINGER, AND C. SCHULZ, Fully dynamic single-source reachability in practice: An experimental study, in Proceedings of the Symposium on Algorithm Engineering and Experiments, ALENEX 2020, Salt Lake City, UT, USA, January 5-6, 2020, G. E. Blelloch and I. Finocchi,

eds., SIAM, 2020, pp. 106–119, https://doi.org/10.1137/1.9781611976007.9.

[25] K. HANAUER, M. HENZINGER, AND C. SCHULZ, DyReach - Fully Dynamic Single-Source Reachability in Practice: An Experimental Study. https://dyreach.taa.univie.ac.at/, 2021.

[26] K. HANAUER, M. HENZINGER, AND C. SCHULZ, Recent advances in fully dynamic graph algorithms - A quick reference guide, ACM J. Exp. Algorithms, 27 (2022), pp. 1.11:1–1.11:45, https://doi.org/10.1145/3555806.

[27] M. HENZINGER, S. KRINNINGER, D. NANONGKAI, AND T. SARANURAK, Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture, in Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, R. A. Servedio and R. Rubinfeld, eds., ACM, 2015, pp. 21–30, https://doi.org/10.1145/2746539.2746609.

[28] J. E. HIRSCH, An index to quantify an individual's scientific research output, Proc. Natl. Acad. Sci. USA, 102 (2005), pp. 16569–16572, https://doi.org/10.1073/PNAS.0507655102.

[29] T. HOČEVAR AND J. DEMŠAR, A combinatorial approach to graphlet counting, Bioinform., 30 (2014), pp. 559–565, https://doi.org/10.1093/BIOINFORMATICS/BTT717.

[30] M. IDRIS, M. UGARTE, AND S. VANSUMMEREN, The dynamic yannakakis algorithm: Compact and efficient query processing under updates, in Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD Conference 2017, Chicago, IL, USA, May 14-19, 2017, S. Salihoglu, W. Zhou, R. Chirkova, J. Yang, and D. Suciu, eds., ACM, 2017, pp. 1259–1274, https://doi.org/10.1145/3035918.3064027.

[31] M. IDRIS, M. UGARTE, S. VANSUMMEREN, H. VOIGT, AND W. LEHNER, General dynamic yannakakis: conjunctive queries with theta joins under updates, VLDB J., 29 (2020), pp. 619–653, https://doi.org/10.1007/S00778-019-00590-9.

[32] R. ITZHACK, Y. MOGILEVSKI, AND Y. LOUZOUN, An optimal algorithm for counting network motifs, Physica A: Statistical Mechanics and its Applications, 381 (2007), pp. 482–490.

Copyright © 2027

[33] H. JOWHARI AND M. GHODSI, New streaming algorithms for counting triangles in graphs, in Computing and Combinatorics, 11th Annual International Conference, COCOON 2005, Kunming, China, August 16-29, 2005, Proceedings, L. Wang, ed., Lecture Notes in Computer Science, Springer, 2005, pp. 710–716, https://doi.org/10.1007/11533719_72.

[34] C. KANKANAMGE, S. SAHU, A. MHEDHBI, J. CHEN, AND S. SALIHOGLU, Graphflow: An active graph database, in Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD Conference 2017, Chicago, IL, USA, May 14-19, 2017, S. Salihoglu, W. Zhou, R. Chirkova, J. Yang, and D. Suciu, eds., ACM, 2017, pp. 1695–1698, https://doi.org/10.1145/3035918.3056445.

[35] A. KARA, H. Q. NGO, M. NIKOLIC, D. OLTEANU, AND H. ZHANG, Counting triangles under updates in worst-case optimal time, in 22nd International Conference on Database Theory, ICDT 2019, March 26-28, 2019, Lisbon, Portugal, P. Barceló and M. Calautti, eds., vol. 127 of LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019, pp. 4:1–4:18, https://doi.org/10.4230/LIPIcs.ICDT.2019.4.

[36] K. KIM, I. SEO, W.-S. HAN, J.-H. LEE, S. HONG, H. CHAFI, H. SHIN, AND G. JEONG, Turboflux: A fast continuous subgraph matching system for streaming graph data, in Proceedings of the 2018 international conference on management of data, 2018, pp. 411–426.

[37] T. KLOKS, D. KRATSCH, AND H. MÜLLER, Finding and counting small induced subgraphs efficiently, Inf. Process. Lett., 74 (2000), pp. 115–121, https://doi.org/10.1016/S0020-0190(00)00047-8.

[38] T. G. KOLDA, A. PINAR, T. D. PLANTENGA, C. SESHADHRI, AND C. TASK, Counting triangles in massive graphs with mapreduce, SIAM J. Sci. Comput., 36 (2014), https://doi.org/10.1137/13090729X.

[39] S. KUMAR, W. L. HAMILTON, J. LESKOVEC, AND D. JURAFSKY, Community interaction and conflict on the web, in Proceedings of the 2018 World Wide Web Conference on World Wide Web, International World Wide Web Conferences Steering Committee, 2018, pp. 933–943.

[40] J. KUNEGIS, KONECT: the koblenz network collection, in 22nd International World Wide Web

Conference, WWW '13, Rio de Janeiro, Brazil, May 13-17, 2013, Companion Volume, L. Carr, A. H. F. Laender, B. F. Lóscio, I. King, M. Fontoura, D. Vrandecic, L. Aroyo, J. P. M. de Oliveira, F. Lima, and E. Wilde, eds., International World Wide Web Conferences Steering Committee / ACM, 2013, pp. 1343–1350, https://doi.org/10.1145/2487788.2488173.

[41] E. KUSEN AND M. STREMBECK, You talkin' to me? exploring human/bot communication patterns during riot events, Inf. Process. Manag., 57 (2020), https://doi.org/10.1016/J.IPM.2019.102126.

[42] E. KUSEN AND M. STREMBECK, Emotional communication during crisis events: Mining structural OSN patterns, IEEE Internet Comput., 25 (2021), pp. 58–65, https://doi.org/10.1109/MIC.2020.3033205.

[43] J. LESKOVEC, D. CHAKRABARTI, J. M. KLEINBERG, C. FALOUTSOS, AND Z. GHAHRAMANI, Kronecker graphs: An approach to modeling networks, J. Mach. Learn. Res., 11 (2010), pp. 985–1042, https://doi.org/10.5555/1756006.1756039, https://dl.acm.org/doi/10.5555/1756006.1756039.

[44] J. LESKOVEC, D. HUTTENLOCHER, AND J. KLEINBERG, Signed networks in social media, in Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, ACM, 2010, pp. 1361–1370.

[45] J. LESKOVEC, D. P. HUTTENLOCHER, AND J. M. KLEINBERG, Governance in social media: A case study of the wikipedia promotion process, in Proceedings of the Fourth International Conference on Weblogs and Social Media, ICWSM 2010, Washington, DC, USA, May 23-26, 2010, W. W. Cohen and S. Gosling, eds., The AAAI Press, 2010, http://www.aaai.org/ocs/index.php/ICWSM/ICWSM10/paper/view/1485.

[46] J. LESKOVEC AND A. KREVL, SNAP Datasets: Stanford large network dataset collection. http://snap.stanford.edu/data, June 2014.

[47] F. LI, Z. ZOU, J. LI, X. YANG, AND B. WANG, Evolving subgraph matching on temporal graphs, Knowl. Based Syst., 258 (2022), p. 109961, https://doi.org/10.1016/J.KNOSYS.2022.109961.

[48] X. LI, R. J. STONES, H. WANG, H. DENG, X. LIU, AND G. WANG, Netmode: Network motif detection without nauty, PloS one, 7 (2012), p. e50093.

Copyright © 2027

[49] Y. LIM, M. JUNG, AND U. KANG, Memory-efficient and accurate sampling for counting local triangles in graph streams: From simple to multigraphs, ACM Trans. Knowl. Discov. Data, 12 (2018), pp. 4:1–4:28, https://doi.org/10.1145/3022186.

[50] Y. LIM AND U. KANG, MASCOT: memory-efficient and accurate sampling for counting local triangles in graph streams, in Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Sydney, NSW, Australia, August 10-13, 2015, L. Cao, C. Zhang, T. Joachims, G. I. Webb, D. D. Margineantu, and G. Williams, eds., ACM, 2015, pp. 685–694, https://doi.org/10.1145/2783258.2783285.

[51] S. LU AND Y. TAO, Towards optimal dynamic indexes for approximate (and exact) triangle counting, in 24th International Conference on Database Theory, ICDT 2021, Nicosia, Cyprus, March 23-26, 2021, K. Yi and Z. Wei, eds., LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021, pp. 6:1–6:23, https://doi.org/10.4230/LIPICS.ICDT.2021.6.

[52] D. MAKKAR, D. A. BADER, AND O. GREEN, Exact and parallel triangle counting in dynamic graphs, in 24th IEEE International Conference on High Performance Computing, HiPC 2017, Jaipur, India, December 18-21, 2017, IEEE Computer Society, 2017, pp. 2–12, https://doi.org/10.1109/HIPC.2017.00011.

[53] A. McGREGOR, S. VOROTNIKOVA, AND H. T. VU, Better algorithms for counting triangles in data streams, in Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, T. Milo and W. Tan, eds., ACM, 2016, pp. 401–411, https://doi.org/10.1145/2902251.2902283.

[54] R. MILO, S. SHEN-ORR, S. ITZKOVITZ, N. KASHTAN, D. CHKLOVSKII, AND U. ALON, Network motifs: simple building blocks of complex networks, Science, 298 (2002), pp. 824–827.

[55] S. MIN, J. JANG, K. PARK, D. GIAMMARRESI, G. F. ITALIANO, AND W. HAN, Time-constrained continuous subgraph matching using temporal information for filtering and backtracking, in 40th IEEE International Conference on Data Engineering, ICDE 2024, Utrecht, The Netherlands, May

13-16, 2024, IEEE, 2024, pp. 3257–3269, https://doi.org/10.1109/ICDE60146.2024.00252.

[56] S. MIN, S. G. PARK, K. PARK, D. GIAMMARRESI, G. F. ITALIANO, AND W. HAN, Symmetric continuous subgraph matching with bidirectional dynamic programming, Proc. VLDB Endow., 14 (2021), pp. 1298–1310, https://doi.org/10.14778/3457390.3457395, http://www.vldb.org/pvldb/vol14/p1298-han.pdf.

[57] A. MISLOVE, M. MARCON, K. P. GUMMADI, P. DRUSCHEL, AND B. BHATTACHARJEE, Measurement and Analysis of Online Social Networks, in Proceedings of the 5th ACM/Usenix Internet Measurement Conference (IMC'07), San Diego, CA, October 2007.

[58] K. MUKHERJEE, M. M. HASAN, C. BOUCHER, AND T. KAHVECI, Counting motifs in dynamic networks, BMC Syst. Biol., 12 (2018), pp. 1–12, https://doi.org/10.1186/S12918-018-0533-6.

[59] M. ORTMANN AND U. BRANDES, Efficient orbit-aware triad and quad census in directed and undirected graphs, Appl. Netw. Sci., 2 (2017), p. 13, https://doi.org/10.1007/s41109-017-0027-2.

[60] M. ORTMANN AND U. BRANDES, oaqc: Orbit-aware quad census. https://cran.r-project.org/web/packages/oaqc/index.html, 2017. Accessed: 2026-07-20.

[61] A. PARANJAPE, A. R. BENSON, AND J. LESKOVEC, Motifs in temporal networks, in Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM 2017, Cambridge, United Kingdom, February 6-10, 2017, M. de Rijke, M. Shokouhi, A. Tomkins, and M. Zhang, eds., ACM, 2017, pp. 601–610, https://doi.org/10.1145/3018661.3018731, https://doi.org/10.1145/3018661.3018731.

[62] A. PAVAN, K. TANGWONGSAN, S. TIRTHAPURA, AND K. WU, Counting and sampling triangles from a graph stream, Proc. VLDB Endow., 6 (2013), pp. 1870–1881, https://doi.org/10.14778/2556549.2556569, http://www.vldb.org/pvldb/vol6/p1870-aduri.pdf.

[63] A. PINAR, C. SESHADHRI, AND V. VISHAL, ESCAPE: efficiently counting all 5-vertex subgraphs, in Proceedings of the 26th International Conference on World Wide Web, WWW 2017, Perth, Australia, April 3-7, 2017, R. Barrett, R. Cummings, E. Agichtein, and E. Gabrilovich, eds., ACM, 2017,

Copyright © 2027 pp. 1431–1440, https://doi.org/10.1145/3038912.3052597.

[64] A. PINAR, C. SESHADHRI, AND V. VISHAL, ESCAPE source code. https://bitbucket.org/seshadhri/escape, 2017. Accessed: 2026-07-20.

[65] J. PREUSSE, J. KUNEGIS, M. THIMM, S. STAAB, AND T. GOTTRON, Structural dynamics of knowledge networks, in Proceedings of the Seventh International Conference on Weblogs and Social Media, ICWSM 2013, Cambridge, Massachusetts, USA, July 8-11, 2013, E. Kiciman, N. B. Ellison, B. Hogan, P. Resnick, and I. Soboroff, eds., The AAAI Press, 2013, http://www.aaai.org/ocs/index.php/ICWSM/ICWSM13/paper/view/6076.

[66] X. QIU, W. CEN, Z. QIAN, Y. PENG, Y. ZHANG, X. LIN, AND J. ZHOU, Real-time constrained cycle detection in large dynamic graphs, Proc. VLDB Endow., 11 (2018), pp. 1876–1888, https://doi.org/10.14778/3229863.3229874, http://www.vldb.org/pvldb/vol11/p1876-qiu.pdf.

[67] P. RIBEIRO, P. PAREDES, M. E. P. SILVA, D. APARÍCIO, AND F. M. A. SILVA, A survey on subgraph counting: Concepts, algorithms, and applications to network motifs and graphlets, ACM Comput. Surv., 54 (2022), pp. 28:1–28:36, https://doi.org/10.1145/3433652.

[68] P. M. P. RIBEIRO AND F. M. A. SILVA, g-tries: an efficient data structure for discovering network motifs, in Proceedings of the 2010 ACM Symposium on Applied Computing (SAC), Sierre, Switzerland, March 22-26, 2010, S. Y. Shin, S. Ossowski, M. Schumacher, M. J. Palakal, and C. Hung, eds., ACM, 2010, pp. 1559–1566, https://doi.org/10.1145/1774088.1774422.

[69] R. A. ROSSI AND N. K. AHMED, The network data repository with interactive graph analytics and visualization, in Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 25-30, 2015, Austin, Texas, USA, B. Bonet and S. Koenig, eds., AAAI Press, 2015, pp. 4292–4293, https://doi.org/10.1609/AAAI.V29I1.9277.

[70] B. SCHILLER, S. JAGER, K. HAMACHER, AND T. STRUFE, DNA: Dynamic network analyzer source code. https://github.com/BenjaminSchiller/DNA, 2015. Version used: fork with additional data logging, commit 170e4e0. https://github.com/AlgorithmsInAction/subgraphcounting_DNA/tree/170e4e0.

[71] B. SCHILLER, S. JAGER, K. HAMACHER, AND T. STRUFE, Stream - A stream-based algorithm for counting motifs in dynamic graphs, in Algorithms for Computational Biology - Second International Conference, AlCoB 2015, Mexico City, Mexico, August 4-5, 2015, Proceedings, A. Dediu, F. H. Quiroz, C. Martín-Vide, and D. A. Rosenblueth, eds., vol. 9199 of Lecture Notes in Computer Science, Springer, 2015, pp. 53–67, https://doi.org/10.1007/978-3-319-21233-3_5.

[72] STACK EXCHANGE, INC., Stack exchange data dump. Internet Archive, 2014, https://archive.org/details/stackexchange. Accessed 2026-10-19.

[73] L. D. STEFANI, A. EPASTO, M. RIONDATO, AND E. UPFAL, Triest: Counting local and global triangles in fully dynamic streams with fixed memory size, ACM Trans. Knowl. Discov. Data, 11 (2017), pp. 43:1–43:50, https://doi.org/10.1145/3059194.

[74] S. SUN, X. SUN, B. HE, AND Q. LUO, ContinuousSubgraphMatching source code. https://github.com/RapidsAtHKUST/ContinuousSubgraphMatching, 2022. Accessed: 2026-07-20.

[75] S. SUN, X. SUN, B. HE, AND Q. LUO, Rapidflow: An efficient approach to continuous subgraph matching, Proc. VLDB Endow., 15 (2022), pp. 2415–2427, https://doi.org/10.14778/3551793.3551803, https://www.vldb.org/pvldb/vol15/p2415-sun.pdf.

[76] X. SUN, S. SUN, Q. LUO, AND B. HE, An in-depth study of continuous subgraph matching, Proc. VLDB Endow., 15 (2022), pp. 1403–1416, https://doi.org/10.14778/3523210.3523218, https://www.vldb.org/pvldb/vol15/p1403-sun.pdf.

[77] J. WANG, Y. HUANG, F. WU, AND Y. PAN, Symmetry compression method for discovering network motifs, IEEE ACM Trans. Comput. Biol. Bioinform., 9 (2012), pp. 1776–1789, https://doi.org/10.1109/TCBB.2012.119.

[78] D. J. WATTS AND S. H. STROGATZ, Collective dynamics of ‘small-world’ networks, nature, 393 (1998), pp. 440–442.

[79] S. WERNICKE, A faster algorithm for detecting network motifs, in Algorithms in Bioinformatics, 5th International Workshop, WABI 2005, Mallorca, Spain, October 3-6, 2005, Proceedings, R. Casadio and G. Myers, eds., vol. 3692 of Lecture Notes in Computer Science, Springer, 2005, pp. 165–177, https://doi.org/10.1007/11557067_14.

References (53)