Manuscript Offprint
arXiv:2610.29776Fully Dynamic Triangle and 4-Vertex Subgraph Counting: From Theory to Practice and Back Again
Kathrin Hanauer
Sophia Heck
Monika Henzinger
Leonhard Sidl
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
Research Network Data Science, University of Vienna, Vienna, Austria
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.
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:
-
We identify and correct errors and omissions in the description of these algorithms.
-
We optimize auxiliary data structures used internally by the algorithms to achieve speedups in practice, while retaining or even improving the theoretical guarantees.
-
We describe and experiment with new ways to maintain a vertex partitioning under edge updates.
-
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.
-
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 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 -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 amortized update time, where the -Index is the largest integer such that the graph has vertices of degree at least . Note that . Eppstein et al. [14] extend this approach to non-induced subgraphs of size four with an amortized update time of . 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 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 except for the clique and the path, which take and 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 update time, where 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 be a simple undirected graph with and . The degree of a vertex is the number of incident edges of , and . Let denote the neighborhood of . We define and . For a set of vertices and some vertex , we use , , , and .
A graph is a (non-induced) subgraph of if and , and an induced subgraph if . A pattern is a (small) graph that we are interested in finding in a larger graph. Given a pattern , its induced or non-induced count equals the number of induced or non-induced subgraphs in , respectively, that are isomorphic to , divided by the number of automorphisms of . 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 partitions the vertex set into two disjoint subsets, where vertices with high degree (for some notion of high degree) are in and all others are in . All partitions in the following can be maintained in amortized constant time per update. We denote by 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 access and modification time.
4.2 HHH Algorithm and -Partition We briefly review the -Partition as well as the HHH algorithm [23] and describe a correction. We then discuss several practical optimization strategies.
4.2.1 -Partition HHH uses an -Partition to define and . The partitioning scheme depends on a parameter , 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. ) substantially. We refer to the time between two re-initializations as an epoch. More precisely, for the ith epoch, we set a degree threshold , where is the number of edges in the graph at the beginning of the epoch, and assign a vertex to if and to otherwise. Afterwards, during the same epoch, changes partitions only if or . We call such a change a vertex partition update (VPU) and refer to [23] for details. The next epoch starts as soon as the current number of edges no longer satisfies . The transition between two epochs requires a major rebalancing (MR) step, where all vertices are re-classified according to the new threshold . There are 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 is in . The -Partition further guarantees that and 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 for triangles and 3-paths and for all remaining connected four-vertex non-induced subgraphs except the 4-clique. The latter can be directly maintained in 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 , the original paper [23] incorrectly states the count for the subcase where is a terminal edge and the first adjacent inner vertex has low degree as . The correct count is obtained by applying the following lemma (proof in section A.2) twice, once with the roles of and swapped.
LEMMA 4.1. Assume that the auxiliary structures vLV and uLv are maintained with anchors of any degree. Let be an edge. Then, the number of 3-paths of the
This also works for the other four-vertex patterns, but with worse amortized update times.

• 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 , where is , where if and 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 -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 time. We replace this by iterating over the high-degree neighbors of x in time, requiring maintenance of each vertex's neighborhood partitioned into high- and low-degree neighbors, which is implementable with constant overhead.
(O-H ) 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- ) Tuning and the MR Frequency .
Recall that controls the size of , with . Larger 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 and processing neighbors of low-degree vertices. While a theoretically optimal exists for each pattern, tuning it in practice yields significant runtime improvements.
An MR is triggered when leaves the range . This is generalized with a rebalance factor : an MR occurs only when exits , setting and . Larger yields longer epochs and fewer MRs without affecting asymptotic running times for constant .
(O-SLL) Soft, Lazy, or Late Rebalancing. Even though we can reduce the frequency of MR events (cf. (O- )), 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 be the time needed to update all auxiliary structures for a single (simulated) edge insertion or deletion. In orig, an MR results in edge updates to the auxiliary structures and hence incurs a total cost of and an amortized cost of 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 [23]. The proof is in section A.5.
LEMMA 4.2. The number of vertices that are reclassified by an MR is in .
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 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 and a new range for 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 that is now wrongly partitioned w.r.t. , i.e., if or if , 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 , and symmetrically for vertices in if the graph shrinks. This may violate the bound on (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 .
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 , in particular it covers at least updates. Checking both endpoints of edges per update therefore processes all initial edges within that interval. This distribution of work also has a positive effect on the worst-case time for maintaining the -Partition (proof in section A.8):
LEMMA 4.5. MR via individual VPUs over the first updates of the new epoch (late rebalancing) (1) has the same total cost of for the MR as the original version and (2) a constant number of VPUs per update and only on vertices of degree in .
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 -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 .
4.3 EGST Algorithm and -Index We next introduce the -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 -Index Partition The -Index vertex partition is based on the Hirsch index (-Index) concept from bibliometrics [28] and transferred to graphs. The -Index of a graph is the largest integer such that there are vertices with degree . On an empty graph,
Table 4.1: Worst-case update times (in ) to count subgraphs with HHH using different -Partitions and the theoretically optimal (for the amortized time). Recall that direct scanning has worst-case update time.
| Subgraph | worst-case | amortized | |||
|---|---|---|---|---|---|
| orig/soft | lazy | late | orig/soft | late | lazy |
| triangle | m | m | |||
| 3-paths | m | m | |||
| paw | |||||
| 4-cycle | m | ||||
| diamond | m | ||||
. A vertex swaps from once it reaches and from if . There are no major rebalances. With the -Index partition, , and , with amortized changes to the partition per update [15].
4.3.2 EGST algorithm The EGST algorithm uses the vertex partition given by the -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 .
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 -Partition, where and , both values are bounded by here. This results in an amortized update time of [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 be an updated edge.
(1) Update rules for : No explicit update rules are given when , (or swapped), we add all missing cases. was defined with arbitrary anchors for updates, and we applied this to the missing cases as well. is used with mixed-degree anchors in 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 : The update rules are ambiguous when , (or swapped). The paper states that is used in edge updates. However, for this is not possible, as the low-degree vertices must be adjacent, which cannot be tested using the count. For , this would require maintaining with mixed-degree anchors which we decided not
Copyright © 2027 to do (see above). To preserve asymptotic bounds, we propose: When , increment for each , , , where or . If , increment for each , , where or . updates are identical but require both edges present.
(3) Update rules for 3-paths : [14] omits several cases for 3-path updates depending on the position of in the path. When is the central edge, the count is adjusted by , which overcounts by including triangles containing : a vertex adjacent to both and does not form a valid 3-path. We correct this by finding all such using for and adjacency tests for when , or iterating over the low-degree endpoint's neighbors otherwise. When is non-central, say the 3-path is (symmetrical for swapped roles of and ), [14] covers with , and , but omits with . We fill this gap in Lemma A.10 (proof in section A.10), which counts such paths using and with triangle corrections.
4.3.4 Optimizations This subsection presents variants designed with practical improvements to enhance the efficiency of EGST and the -Index. We use (O-LP) and (O-NP) as described in section 4.2.4.
High-Degree Anchors Only. For the same reasons as in , having high-degree anchors only is desirable also for EGST. Here, this only requires a modification of (all other auxiliary structures have high anchors already): For edge insertions/deletions with , if we update by one for all distinct pairs with and in time. If, w.l.o.g., and , we update by one for all with in time. In consequence, we update 4-cycle counts by iterating over low-degree neighbors instead of using . The new procedure takes time and does not affect the asymptotic running time.
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 , 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).
Tuning the Gradual Factor of the -Index Partition. In [15], a vertex is placed in only when , which in practice often yields very few high-degree vertices. We introduce a gradual factor , placing in when . We prove that the running time bounds remain the same in section A.12.
Table 4.2: Amortized update times (in ) for subgraph counts using HHH or EGST combined with an abstract partition , the -Partition, or the -Index. Shaded terms only apply to the high-anchors-only optimization.
| Name | -Partition | -Index | |
|---|---|---|---|
| HHH with (O-HHH) | |||
| triangle | |||
| 3-path | |||
| paw | |||
| 4-cycle | |||
| diamond | |||
| 4-clique | |||
| EGST with (O-EGST) | |||
| triangle | |||
| 3-path | |||
| paw | |||
| 4-cycle | |||
| diamond | |||
| 4-clique | |||
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 , and analyze cross-combinations.
Table 4.2 states the amortized update times for both algorithms under . For derivations, see section A.13 for EGST, [22] for HHH, and section A.3 for . The table also shows the cross-combination bounds, which (in all cases) preserve or worsen the amortized update time, especially for EGST with -Partition. Notably, HHH with -Index matches EGST with -Index for all patterns except the 4-clique: HHH uses a naive routine, while EGST achieves via and , exploiting under -Index. With -Partition, where , EGST's 4-clique time becomes at , 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 for these patterns, as its auxiliary structures only involve low-degree vertices besides the anchors. Patterns where both non-anchor vertices are in require enumerating all pairs in .
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-H), HHH*-A adds auxiliary counting structures (O-A), and HHH*-HA combines both. Analogously, EGST*-H uses high-degree anchors (O-H), EGST*-D uses direct partition swaps (O-D), and EGST*-HD combines both. We evaluate -Partition variants orig, soft, lazy, and late, where the value is indicated as a suffix, e.g., soft.5 for . The -Index partition with gradual factor 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 for over means where 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 ( ), and max. #edges ( ). Shaded cells indicate membership to the engineering dataset ES. Full statistics in Table A.3.
| WIKI [40, 65] | TMP | ||||||
|---|---|---|---|---|---|---|---|
| ID | Graph | δ | ID | Graph | δ | ||
| A | simple wiki | 1.6M | 690.7K | A | reality-call [69, 13] | 7.2K | 3.6K |
| B | nl wiki | 18.9M | 9.6M | B | wiki-elec [69, 44] | 201.5K | 100.8K |
| C | pl_wiki | 23.6M | 11.4M | C | tech-as-topology [69] | 215.4K | 107.7K |
| D | it_wiki | 33.1M | 15.7M | D | reddit-body [46, 39] | 433.5K | 4K |
| E | fr_wiki | 56.3M | 22.3M | E | mathoverflow [46, 61, 72] | 458K | 2.5K |
| F | de_wiki | 82M | 28.1M | F | enron [69, 11] | 594.9K | 297.5K |
| G | reddit-title [46, 39] | 824.7K | 7.8K | ||||
| H | askubuntu [46, 61, 72] | 952.4K | 6.1K | ||||
| I | superuser [46, 61, 72] | 1.5M | 7.3K | ||||
| J | wiki-talk [46, 61, 45] | 6.3M | 102K | ||||
| K | youtube-growth [69, 57] | 18.8M | 9.4M | ||||
| L | stackoverflow [46, 61, 72] | 59.4M | 277.9K | ||||
| KRONc [24, 25] | KRONg [24, 25] | ||||||
|---|---|---|---|---|---|---|---|
| ID | Graph | δ | ID | Graph | δ | ||
| A | c answers | 2.6M | 185.5K | A | g answers | 538.3K | 184.9K |
| B | c delicious | 3.2M | 225.9K | B | g delicious | 646K | 225.3K |
| C | c epinions | 5.9M | 413.7K | C | g epinions | 1.1M | 413K |
| D | c flickr | 4.3M | 305.5K | D | g flickr | 853.4K | 304.7K |
| E | c blog-nat05-6m | 18.7M | 1.3M | E | g blog-nat05-6m | 3.3M | 1.3M |
| F | c blog-nat06all | 22.3M | 1.6M | F | g blog-nat06all | 3.9M | 1.6M |
| G | c cit-hep-ph | 22.2M | 1.6M | G | g cit-hep-ph | 3.9M | 1.6M |
| H | c cit-hep-th | 29.8M | 1.6M | H | g cit-hep-th | 3.9M | 1.6M |
| I | c ca-dblp | 8.5M | 597.3K | I | g ca-dblp | 1.6M | 596K |
| J | c ca-gr-qc | 7.9M | 559.2K | J | g ca-gr-qc | 1.5M | 558.4K |
| K | c ca-hep-th | 5.3M | 374.1K | K | g ca-hep-ph | 5.3M | 2.1M |
| L | c ca-hep-ph | 30.4M | 2.1M | L | g ca-hep-th | 1M | 373.2K |
| M | c web-notredame | 4.1M | 288.7K | M | g web-notredame | 811.6K | 288.1K |
| N | c as-newman | 6.9M | 487.6K | N | g as-newman | 1.3M | 486K |
| O | c as-routeviews | 7.9M | 556.9K | O | g as-routeviews | 1.5M | 555.3K |
| P | c gnutella-30 | 2.9M | 203.4K | P | g gnutella-25 | 722.1K | 253.2K |
| Q | c gnutella-25 | 3.6M | 254.1K | Q | g gnutella-30 | 587.7K | 202.7K |
| R | c atp-gr-qc | 1.3M | 90.9K | R | g atp-gr-qc | 277.3K | 90.5K |
| S | c bio-proteins | 9.5M | 667.5K | S | g bio-proteins | 1.8M | 666.3K |
5.2 HHH and -Partition Optimizations We first evaluate HHH* with optimizations on the original -Partition, followed by a parameter study for and . Finally, we consider the best variant of HHH* in combination with different partitions, i.e. -Partition variants soft, lazy and late as well as the h-Index.
5.2.1 Proposed Optimizations We start by evaluating (O-H), where all anchors have high degree, on the ES graphs. For this experiment, we set as a compromise between the optimum of for triangles and 3-paths and 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 speedup in total time, a speedup in the maximum update time, and reduces memory usage by a factor of over HHH*. These results showcase the impressive efficiency
Copyright © 2027

Figure 5.1: Effects of the parameter on the runtime of orig using dataset ES (counting all patterns). Note the logarithmic y-axis.

Figure 5.2: Performance of -HA for different vertex partitions w.r.t. on ES data (counting all patterns).
of 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 in experiments where all patterns are counted and otherwise.
5.2.2 Analysis of for the -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 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 , 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 for counting all patterns simultaneously cannot be derived by simply averaging the individual optima per pattern. In practice, should be chosen smaller than the theoretical optimum.
5.2.3 Best Partitions for HHH We compare all partitions studied in this work using -HA on ES. For the h-Index, we vary the gradual factor ; for the -Partition, we compare orig, soft, late, and lazy with 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( ) (the best in our experiments).
Total runtime. All -Partition variants perform best at . Among variants preserving amortized guarantees, late.2 is fastest, faster than orig.2 and than soft.2. lazy is another 1.2% faster but lacks these guarantees. For h-Index partitions, h(17/16) achieves a speedup over h(2), though late.2 remains faster.
Maximum update time. Maximum update time generally decreases with , 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 at . 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 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 , 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 (see section A.15) and found the optimal choice to be highly graph-dependent. We fix as a good compromise.
Finally, we also briefly evaluate for single patterns instead of all simultaneously (cf. section A.17). Also here, should be chosen smaller than its theoretically optimal value: For diamonds, paws and 4-cycles, yields the best results in practice with speedups of , , , respectively, over the theoretically best . The deviation in running time from , the best choice for “all”, is within 10% in the geometric mean. For counting all patterns simultaneously, a slightly smaller 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, is faster than the theoretical optimum of , and almost twice as fast as . Clever neighborhood scanning without

Figure 5.3: Performance of EGST*-HD for different vertex partitions w.r.t. 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 and over late.2 respectively.
late.2 and h(17/16) are the fastest -Partition and h-Index variants, respectively, offering different tradeoffs: late is faster in total runtime, while h(17/16) has faster maximum updates and uses 38.4% less memory. lazy.2 (without preserving theoretical bounds) is faster than late.2. is a good default for all -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 faster total runtime and 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 for h-Index and (rounded to three digits) for lazy and late, the best -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 faster total runtime, faster updates, and only 4% more memory.
The effects of -Partition in section 5.2.2 also favor 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 faster maximum updates and uses 14.8% less memory. These averages mask instance-level differences: wins on 17 of 24 graphs by up to , whereas h(17/16) wins on dense, high-count instances such as WIKI by up to , consistent with EGST's quadratic dependence on .
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: for 4-cycles and paws ( ), and for 3-paths ( ). 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 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 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, and 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 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 over Graphflow/RapidFlow and over DNA (triangles); HHH*-HA is 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 in late to trade runtime for memory, if 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 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.
Static Setting Subgraph counting for arbitrary patterns generalizes the -hard subgraph isomorphism problem, thus ruling out efficient algorithms unless . Much prior work is concerned with the identification of motifs [54, 32, 79, 48, 77, 68], i.e., patterns that occur more frequently than can be expected under a suitable random model. Kloks et al. [37] show how to count 4-cliques in time and all other induced 4-vertex subgraphs in time . Hočevar and Demšar [29] give an algorithm for counting induced subgraphs with up to five vertices that exploits symmetries in the pattern. A similar approach was later employed by Ortmann and Brandes [59] for non-induced subgraphs of size up to four. Pinar et al. [63] give an algorithm for patterns with up to five nodes. Especially for triangles, there is also a large body of work on approximate and streaming algorithms [33, 8, 50, 49, 53, 38, 62].
Dynamic Setting Eppstein and Spiro [15] describe an algorithm for maintaining the triangle count in amortized update time, where is again the h-index of the graph . Eppstein et al. [14] extend this approach to non-induced subgraphs of size four with an amortized update time of (EGST, see section 4.3). Kara et al. [35] show how to count triangles in amortized update time based on a heavy-light vertex partitioning. Based on their work, Lu and Tao [51] study an optimal tradeoff between update time and approximation quality and obtain arboricity-sensitive update times. Using a similar vertex partitioning strategy as Kara et al., Hanauer et al. [23] give improved algorithms to count non-induced 4-vertex patterns in amortized time except for the clique and the path, which take and update time, respectively (HHH). Their triangle counting algorithm 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], induced connected 4-vertex patterns cannot be maintained with amortized update time and query time for any . There also is no fully dynamic algorithm that maintains non-induced connected 4-vertex pattern counts in amortized update time and query time with an error probability of at most for any unless the OMv conjecture [27] fails. Assadi et al. [4] show that 4-cycles can be maintained in using fast matrix multiplication. Dhulipala et al. [12] consider a batch-dynamic setting, where each graph update may consist of multiple edge insertions and deletions, to count cliques and give easily parallelizable algorithms for counting cliques with an amortized update time of , where is the size of the batch.
Schiller et al. [71] describe a practical algorithm based on neighborhood scanning to count induced triangles and 4-vertex subgraphs in update time, where D denotes the maximum vertex degree.
CSM There also exists a large body of empirical work on continuous subgraph matching (CSM) for arbitrary subgraphs [16, 36, 56, 34, 30, 31, 75]. CSM algorithms often rely on an index, a precomputed data structure that accelerates query processing by storing structural information about the data graph. Edge updates then consist of index updates and matching enumeration. Graphflow [34] computes incremental changes without relying on an explicit index. TurboFlux [36] and IEDyn [30, 31] construct indices with space and time complexity for data graph G and query graph Q, while SymBi [56] builds an index with complexity . Sun et al. [76] provide an extensive survey and experimental study of these algorithms and give recommendations for different use cases. According to their study, there is no single dominant algorithm: SymBi is particularly effective for sparse queries or long-running queries, TurboFlux and IEDyn are well-suited for tree queries, while Graphflow performs best on dense queries or when both query and data graphs are sparse.
A.2 Proof of Correctness for HHH 3-Path Counting
LEMMA 4.1. Assume that the auxiliary structures vLV and uLv are maintained with anchors of any degree. Let be an edge. Then, the number of 3-paths of the form , where is vLV[u] - , where if and 0 otherwise.
Proof. Recall from Figure 4.1 that vLV[u] (♠) counts the paths u-x-y with . There are two cases where an extension of a path counted by vLV[u] with edge does not result in a valid 3-path of the form : (1) and (2) . The number
denotes the exponent of fast matrix multiplication algorithms, [17]
Note that .
of invalid paths in (1) is if and 0 otherwise, and the number of invalid paths for (2) is , i.e., the number of 2-paths adjacent to both and with a low-degree joint.
A.3 The HHH Algorithm with High Anchors We describe the required techniques and changes to the structure and subgraph count maintenance. We begin with the auxiliary structures. The structures t and uHv remain unchanged, since their anchors already have high degree in [23]. For the remaining structures the change to high-degree anchors affects both edge updates and partition changes of vertices.
In case of edge updates for most structures, it is sufficient to include an additional requirement to the description in [23] for anchor vertices to be in . Note that this -time check does not change the asymptotic runtime, when using (O-NP) this even improves the actual running time in practice. The only exception is the auxiliary structure, where an update of edge requires additional changes, since as before was used in the update routine which is no longer possible when or . In this case, assume w.l.o.g. and adjust by for each and if , by . This adjustment is an increment for insertions and a decrement for deletions and can be performed in time , which equals the previous update time bound of in [23].
We next describe how we update the count of each auxiliary structure when a vertex v changes the partition. We use ( ) as a notation for v changing to ( ). In case v has a non-anchor position we extend [23] by the high anchors requirement. For v in an anchor position we use the following routines:
(vLV ♢) If , we set vLV[v] = 0. If , we compute newly formed vLV[v] = , in .
(uLv ♢) If , we set uLv[v, x] = 0 for all , where . In practice, instead of finding , we can also find all entries of uLv that contain and set them to zero, in case is smaller than . If , we increase uLv[v, h] by 1 for all where . This runs in .
(uLLv ♢) We find all for and . If , we set uLLv[v, z] = 0 and if , we increase uLLv[v, z] by 1. In practice, when and , instead of finding z, it is faster to find all entries of uLLv that contain v and set them to zero. Hence, the time for a partition swap here is .
(cLV ♢) We find with . If set . If , increase by . In practice, when , it is faster to find all entries of that contain and set them to zero instead of finding as described above. The vertex change takes time.
(pLL ♢) The pLL has two positions for as anchor: in the triangle or in the arm. If , we decrease, and if , we increase the count. For as anchor in the triangle, we find with . Specifically, we adjust pLL by 1 for in or , and by 2 if it is in both neighborhoods. For as anchor in the arm, we find and with such that and adjust pLL by 1. This computation takes time. In practice, in the case and , it is faster to find all entries of pLL that contain and set them to zero instead of finding as described above.
(cL ♢) For and , if , we decrease, and if , we increase by 1.
We now describe the adjustment to the query algorithm when restricting all anchors for auxiliary structures to high-degree vertices. As for claws and 4-cliques no auxiliary structures are used they remain unchanged. For the other subgraphs the technique is straightforward, we now iterate over the neighbors of low-degree vertices for which we do not store auxiliary counts anymore. To update the subgraph count after an edge update , we compute the subgraphs containing e and adjust the total by adding or subtracting this count for edge insertion or deletion, respectively.
(△) Let be the third vertex of a triangle containing . To obtain the number of triangles with , we follow [23] and count . We adapt the way to obtain the number of triangles with . Before, , but now we can only use this if . Otherwise, let w.l.o.g. . Then .
(⌒) Counting 3-paths containing as a centerpiece is done as in [23] with minus the number of triangles containing . We only need to adapt the way to obtain the number of such triangles with a third vertex as described above. We next consider a non-center edge in a 3-path and apply the following twice (with swapped roles of and ): Let be the start of a path, i.e. . If , we follow the description in [23]. For the case that , we proceed as follows: (i) If , directly use Lemma 4.1. (ii) If and , proceed as in Lemma 4.1, but compute uLv[u, v] directly as . (iii) If , the number of 3-paths is , as we first count all paths for as and then correct this count for the case where with
(☎) To count paws containing e, we distinguish the position of e to be (1) the arm of the paw or (2) adjacent to the arm and (3) the third triangle edge non-adjacent to the arm. We need the count of triangles with an edge e as obtained above and triangles containing vertex as computed by [22, Lemma 32]. Then, similar to [22] we count (1) as and (2) as . In [22], case (3) was counted as cLV[u,v] plus those where the central vertex has high degree. Now, we can only use cLV if . Otherwise w.l.o.g. , we count .
(□) To count 4-cycles containing , when we apply [22, Lemma 40]. However, when at least one endpoint of is in , we can not use the same auxiliary structures anymore. For the case only one endpoint is in , let w.l.o.g. and . Then, we find . If we add and if we add to the count. If both , we simply count .
(☑) Counting diamonds containing , when we apply [22, Lemma 16]. If and/or , we need to make adaptations. We distinguish the position of to be (1) the chord, (2) part of the 4-cycle. For (1) we apply the exact description from the proof in [22, Lemma 16]. For (2), if , we iterate over and , checking whether . For each chord present from , we increase the count by 1. Otherwise, w.l.o.g., let and . First, we count all diamonds where is not adjacent to the chord. For each with as the chord, we count the number of triangles containing but not . If , the count is . Otherwise, we iterate over and count each such that . Second, we count all diamonds where is adjacent to the chord, but is not the chord. For , we increase the count by 1 if , and by 1 if .
A.4 Optimizing the HHH Algorithm: (O-A) Extra Use of Auxiliary Structures When counting triangles or 4-cliques, we can use additional auxiliary structures without changing asymptotic running times. These dependencies are highlighted as dashed arcs in Figure 4.1. For counting triangles that contain an edge and a third vertex , where , we look up uHv[u, v] instead of iterating over all vertices in . As uHv can be maintained in time [23], this does not affect the overall cost to maintain triangle counts, which also is when only using uLv. As mentioned earlier, 4-clique counts can

Figure A.1: Comparing the total update times for different patterns using more auxiliary structures than required in the HHH algorithm using orig -Partition with on dataset ES.
be maintained in worst-case time without using any auxiliary counts. If we use cL with high-degree anchors, i.e., , and an edge with is inserted or deleted, we use cL to count 4-cliques where and by adding up cL[u, v, y] for each . This requires a single pass over and thus takes time. As cL can be maintained in and the update time for other cases remains , we obtain the same (now amortized) update time as long as .
Experimental Evaluation. To evaluate the practical improvement we compare HHH*-HA|orig.417 and HHH*-H|orig.417 on dataset ES.
If we are only interested in 4-cliques or triangles, not maintaining (and using) any auxiliary structures is (4-cliques) and (triangles) faster. However, when counting all patterns simultaneously, using all available auxiliary structures performed similarly (within 2%). While (O-A) reduces neighbor traversals, increased lookup times and branch prediction misses slightly offset the gains, leading to marginally faster running times in the geometric mean (0.1%) with (O-A).
A.5 Bounding Reclassifications during Major Rebalancing
LEMMA 4.2. The number of vertices that are reclassified by an MR is in .
Proof. Let and be the number of edges in the last and current MR step, respectively. Let and be the set of high-degree vertices immediately before and right after the MR, respectively. Note that the number of current edges remains unchanged during an MR. By definition and the properties of the -Partition, , so , and . In the worst case, , so vertices are classified differently after an MR than before.
A.6 Cost of soft Major Rebalancing
LEMMA 4.3. MR via individual VPUs (soft rebalancing) has the same total cost of as the original version.
Proof. Let be the number of vertices that need to change partition in an MR step, where by Lemma 4.2. Thus, an MR step with soft requires time in total.
A.7 Degree Bound Degradation under lazy
LEMMA 4.4. Rebalancing with the lazy strategy may result in .
Proof. If , , and if , , so the statement trivially holds. Otherwise, assume we are in epoch . Let with . Delete all edges not incident to . Then, , and, as no edge incident to was updated, remains in .
A.8 Cost of late Major Rebalancing
LEMMA 4.5. MR via individual VPUs over the first updates of the new epoch (late rebalancing) (1) has the same total cost of for the MR as the original version and (2) a constant number of VPUs per update and only on vertices of degree in .
Proof. Since late performs the same steps as soft, it has the same total cost of by Lemma 4.3 and (1) follows. By construction, all vertex checks are done within the current epoch. For (2), recall that there may be up to two VPUs per update in the original -Partition, which result from checking the end vertices of the updated edge. With late, we perform VPUs per update in addition and hence in total per update. Note that the threshold changes only by a constant factor between one epoch and the next. Hence, each vertex that needs to change partition still has degree in when the change is performed.
A.9 Impact of -Partitions on Worst-case Update Times in HHH We analyze the worst-case update times for each of the four variants of the -Partition:
LEMMA 4.6. The worst-case update times for HHH using different variants of the -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 .
Table A.1: Per-auxiliary costs (in ) [22]. : cost to perform an edge update/a VPU to a single auxiliary structure.
| Auxiliary Structure | ||
|---|---|---|
| vLV | ||
| uLv | ||
| t | ||
| uLLv | ||
| cLV | ||
| pLL | ||
| uHv | ||
| cL |
After an edge update, the following steps are performed: the partition is updated in ; if triggered, an MR is executed at cost ; if required, VPUs of the endpoints are performed at cost ; auxiliaries are updated at cost ; and counts are updated using auxiliary structures at cost . The worst-case update time is thus .
To derive these terms, we use and : the cost of an edge update and a VPU to a single auxiliary structure, respectively, derived from [22] (see Table A.1). The total cost (resp. ) of a subgraph is the sum of (resp. ) over all its required auxiliary structures. For example, .
COROLLARY A.7. Using orig/soft, the worst-case update time for subgraph counting is for triangles and 3-paths, and for paws, 4-cycles, and diamonds.
Proof. Under orig, an MR recomputes all auxiliaries from scratch in a single step, so , which dominates all other terms. Using soft an MR has the same time by Lemma 4.3. Taking per auxiliary from Table A.1, summing over the auxiliaries required by each subgraph, and substituting , with the optimal from [22] yields the bounds listed in Table A.2.
COROLLARY A.8. Using lazy, the worst-case update time for subgraph counting is for triangles, for 3-paths and paws, and for 4-cycles and diamonds.
Proof. Under lazy, an MR takes time, but (Lemma 4.4) but like any
Copyright © 2027
Table A.2: Worst-case update times (in ) to count subgraphs with HHH using different partitions. Recall that for orig, soft and late , and for lazy .
: cost for edge update/VPU to all required auxiliary structures (combined from Table A.1)
: counting cost given the auxiliaries (from [22] and subsection A.4).
Worst-case update times using
late/lazy: , or
orig/soft: .
Shaded terms apply only with .
| Subgraph | Required auxiliaries | late | orig/soft | lazy | |||
|---|---|---|---|---|---|---|---|
| triangle | vLV | ||||||
| 3-path | vLV, uLv | ||||||
| paw | t, uLv, cLV | ||||||
| 4-cycles | uLv, uLLv, uHv | ||||||
| diamond | uLv, pLL, cL |
degree. Hence, the worst-case update time is . The pattern costs and are listed in Table A.2.
COROLLARY A.9. With late rebalancing, the worst-case update time for subgraph counting via HHH and -Partition is: for triangles, for paws, and for 3-paths, 4-cycles, and diamonds, while preserving amortized bounds.
Proof. Under late, the VPUs from an MR are spread over subsequent updates (Lemma 4.5), so each update performs VPUs and no MR cost is incurred, giving a worst-case of . The per-auxiliary costs and are listed in Table A.1. For each subgraph, we sum and over all required auxiliaries and substitute , with the optimal from [22]. Table A.2 summarizes the results. For example, triangles use only vLV with : . Amortized bounds are preserved since the total rebalancing work over each window remains unchanged.
The amortized update times are computed as [23]. Hence, soft/late have the same amortized times as orig in [23]. For lazy we can argue that by a similar argument as Lemma A.11. Hence, from Table A.2 the times in Table 4.1 follow.
A.10 Proof of Correctness for EGST 3-Path Counting
LEMMA A.10. Assume and are maintained. Let be an edge with . The number of 3-paths -u-x-y with can be counted in time as , where, if , and , and otherwise.
Proof. To count paths with , recall that counts paths -x-y with . Two cases counted in do not yield valid 3-paths -u-x-y: (1) and (2) . Case (1) contributes invalid paths if , and 0 otherwise. Case (2) contributes if , and 0 otherwise. Hence, paths with are counted by where if and 0 otherwise.
To count paths with , recall that counts vertices adjacent to both and . Summing over counts all such paths, but includes invalid ones where . The number of these is if , and 0 otherwise. Hence, paths with are counted by where if and 0 otherwise.
The running time is , as we iterate over all elements of or neighbors of low-degree vertices.
A.11 Direct Partition Swaps of the EGST Algorithm As an alternative to performing partition swaps via simulating repeated edge updates [14], we describe how to update auxiliary structures directly by scanning the 2-hop neighborhood of the moving vertex. Consider a vertex moving from to (the reverse case is symmetric). Note that upon a partition change and for the -Index partition . For each structure , we first reduce counts where served as a low-degree non-anchor vertex, then increase counts where becomes an anchor. All partition swaps have the same running time as in [14] with for and for .
Copyright © 2027
Reduce : for each and with , reduce by 1. Increase : for each , increase by . Time: .
Reduce : for each pair , reduce by 1. Increase : for each and , increase by 1. Time: .
Reduce : for each , , , reduce by 1. Reduce : for each , , , reduce by 1. Increase : for each , , , increase by 1. Time: . When anchors may have any degree [14], replace by at anchor positions; the bound remains .
A.12 Proof of the Gradual Factor for the h-Index Partition
LEMMA A.11. Let be the -Index after an update operation. If vertex moves from when for any and from when , the resulting partition has amortized changes per update.
Proof. We follow the proof scheme in [15]. Note that [15, Lemma 1] states that a sequence of operations during which changes from to includes at least insert operations.
Hence, when the h-Index changes from h to this requires at least insert operations.
We consider the case that a vertex v is removed from H. Let h be the h-Index when v was inserted into H. Let for any h-Index in an operation between the insertion and removal from H.
The authors of [15] provided a charging scheme to show that any vertex in H remains in H for a series of updates. We adapt this charging scheme: For every edge insert we give each element a credit of and for every edge removal adjacent to an to that x, where is the h-Index after the operation.
To show that any removed from still must have accumulated credits [15, Lemma 2], we consider two cases: (1) the -Index grew over , then has credit at least for any constant . Now assume that, (2) the -Index was always at most . Then received at least credit for insertions and credit for deletions. Note that by definition , then for any constant .
Given that any element removed from H has gained credits, the proof that the partition has amortized changes to the partition per update follows directly from [15, Theorem 2].
A.13 The EGST Algorithm with an Abstract Partition We follow [14] and provide a detailed description of every update step to derive the amortized update times for each pattern. To this end we start with the auxiliary structures and use these to derive the patterns.
Auxiliary structure updates. The amortized update time consists of edge updates which happen every update and partition swaps that only happen at an amortized rate of changes per update. An edge update affects auxiliary structures only if at least one endpoint is in [14]. When exactly one endpoint is low, we assume w.l.o.g. that and . Below we describe only edge insertions; deletions are symmetric.
Partition swaps are handled by simulating a deletion of all incident edges followed by reinsertion, costing where is the per-edge update time for each structure [14] or by the practical optimization as given in section A.11 resulting in the same time.
LEMMA A.12. The amortized update time for auxiliary structures under partition is for , for , and for .
Subgraph count updates. We describe how updating edge affects each subgraph count. Below we describe only edge insertions resulting in increase of the count; deletions are symmetric and decrease the count. In case at least one endpoint is in , we assume this is u. Let refer to the time it takes to maintain the auxiliary structure .
(claw): Increase the count by , since each claw containing e has its center at u or v. Time: .
(triangle): Increase the count by the number of vertices adjacent to both and . If , use to count , and additionally for each checking adjacency to . If , for each and test . Time: .
(3-path): If is the center edge , increment by and subtract triangles through , which are counted as in above. If is a leaf edge, consider both orientations (once with swapped roles of and ): Assuming , for each we need to increment by . If , iterate over all such directly. If , handle by iteration over and via Lemma A.10 using and . Time: .
(paw): If is the arm, consider both orientations, once with swapped roles for and : Assume with and count triangles containing but not . If , for each pair with , increment by 1. If , use for triangles with two low vertices; since counts all such triangles through , when we must subtract to exclude triangles that contain (as those involve ). For triangles with exactly one low vertex, sum over , where each counts low vertices adjacent to both and ; again when , subtract 1 for each such with to exclude triangles through . For all-high triangles, iterate over pairs in checking mutual adjacency directly.
If is in the triangle with arm to , find common neighbors of ; each such triangle contributes paws, one for each choice of an arm edge from to a vertex outside the triangle. If at least one endpoint of is in , this is handled by neighbor iteration. If , let count the triangles through . We split the contribution (arms from ) from (arms from or ), accumulating the latter globally over all triangles. For : increase by , which counts low vertices adjacent to both and ; for the arms, use to count those with and sum over . For : iterate over , and if , increase by 1 and the paw count by . Finally, increase the paw count by , accounting for all arms originating at or across all triangles.
Time: .
□ (4-cycle): Let be the two vertices not in , forming the path . We case-split on how many of lie in .
If : Use which directly counts such 2-paths among low vertices. When applying (O-H ), is only available for high-degree anchors, so if we instead iterate over 2-paths among low-degree neighbors of , costing an additional .
If exactly one of is high, say : iterate over as candidates for . When , use to count low vertices adjacent to both and , correcting by subtracting 1 when and to exclude paths through . When , instead check for each .
If : iterate over all pairs , and increase by 1 whenever .
Time with (O-H ): .
☑ (diamond): Edge e is either the diagonal or a side of the outer 4-cycle; we sum both.
e is the diagonal. We need pairs of common neighbors of . If , iterate over pairs in checking adjacency to . If , compute the total common-neighbor count via (low common neighbors) plus scanning (high common neighbors); we then increase the diamond count by .
e is on the outer cycle. Let form the outer cycle. Then either or form the diagonal. : Iterate over pairs in (and ), checking mutual adjacency and adjacency to the opposite endpoint.
At least one of in : If : We further distinguish (1) to count exactly one of low. For , iterate over : if is the diagonal, require and use ; if is the diagonal, use . Symmetrically for , iterate over : if is the diagonal, require and use ; if is the diagonal, use . And (2) to count both , use .
If : For diamonds with diagonal , iterate over with , count common neighbors of excluding : if use ; otherwise enumerate neighbors of the low endpoint checking adjacency. For diamonds with diagonal , iterate over pairs with .
Time: .
(4-clique): Find two vertices such that forms a complete graph. If , iterate over pairs of neighbors of and check . If , use for ; for exactly one high, iterate over and use ; for , iterate over pairs in checking mutual adjacency. Time: .
LEMMA A.13. The amortized update times for counting undirected four-vertex subgraphs using EGST with partition P are listed in Table 4.2.
A.14 Full Dataset Statistics The full statistics of the data used can be found in Table A.3 and for the engineering set in Table A.4.
Table A.3: Full Data Set (FS) statistics: #updates (), insertion ratio (); maximum #non-isolated vertices (), edges (), and degree (); average h-index (), ratio, and global clustering coefficient (); and network type, i.e., one of social network (Soc), interaction graph (Int), hyperlink network (HyL), internet topology (Top) or miscellaneous (Misc). Shaded rows indicate membership of the engineering dataset ES.
| ID | Graph | δ | δ+ | ŋ | ŋ | ŋ | ŋ | h3/m | CC | Type |
|---|---|---|---|---|---|---|---|---|---|---|
| Wikipedia Hyperlink Networks (WIKI) [40, 65] | ||||||||||
| A | simple_wiki | 1.6M | 72% | 99.5K | 690.7K | 10 054 | 230 | 38.93 | 8.2e-3 | HyL |
| B | nl_wiki | 18.9M | 75% | 1M | 9.6M | 68 864 | 723 | 84.76 | 2.3e-3 | HyL |
| C | pl_wiki | 23.6M | 74% | 1M | 11.4M | 102 331 | 847 | 113.22 | 2.9e-3 | HyL |
| D | it_wiki | 33.1M | 74% | 1.2M | 15.7M | 71 489 | 948 | 109.59 | 1.4e-3 | HyL |
| E | fr_wiki | 56.3M | 70% | 2.2M | 22.3M | 113 317 | 1.1K | 132.39 | 1.8e-3 | HyL |
| F | de_wiki | 82M | 67% | 2.2M | 28.1M | 75 577 | 1.2K | 123.85 | 2.9e-3 | HyL |
| Temporal Graphs (TMP) | ||||||||||
| A | reality-call [69, 13] | 7.2K | 50% | 3.6K | 3.6K | 3 599 | 1 | 0 | 0 | Int |
| B | wiki-elec [69, 44] | 201.5K | 50% | 7.1K | 100.8K | 1 065 | 113 | 32.96 | 2.6e-2 | Misc |
| C | tech-as-topology [69] | 215.4K | 50% | 34.8K | 107.7K | 2 760 | 108 | 26.29 | 9.2e-3 | Top |
| D | reddit-body [46, 39] | 433.5K | 50% | 3.3K | 4K | 373 | 21 | 3.3 | 2.1e-2 | HyL |
| E | mathoverflow [46, 61, 72] | 458K | 50% | 1K | 2.5K | 137 | 17 | 3.91 | 1.6e-2 | Int |
| F | enron [69, 11] | 594.9K | 50% | 87K | 297.5K | 1 726 | 166 | 34.57 | 1.4e-2 | Int |
| G | reddit-title [46, 39] | 824.7K | 50% | 4.9K | 7.8K | 500 | 33 | 6.21 | 1.1e-2 | HyL |
| H | askubuntu [46, 61, 72] | 952.4K | 50% | 4.9K | 6.1K | 339 | 26 | 4.93 | 5.5e-3 | Int |
| I | superuser [46, 61, 72] | 1.5M | 50% | 5.5K | 7.3K | 364 | 28 | 4.9 | 5.9e-3 | Int |
| J | wiki-talk [46, 61, 45] | 6.3M | 50% | 74.4K | 102K | 29 540 | 87 | 13.26 | 1.0e-3 | Int |
| K | youtube-growth [69, 57] | 18.8M | 50% | 3.2M | 9.4M | 91 751 | 612 | 55.04 | 3.1e-4 | Soc |
| L | stackoverflow [46, 61, 72] | 59.4M | 50% | 158.3K | 277.9K | 825 | 117 | 9.14 | 4.3e-3 | Int |
| Constant-Size Kronecker Graphs (KRONc) [24, 25] | ||||||||||
| A | c_answers | 2.6M | 54% | 74.3K | 185.5K | 578 | 112 | 8.04 | 7.2e-4 | Soc |
| B | c_delicious | 3.2M | 54% | 93.7K | 225.9K | 306 | 80 | 2.48 | 5.2e-4 | Soc |
| C | c_epinions | 5.9M | 54% | 85.7K | 413.7K | 2 140 | 175 | 13.94 | 1.3e-3 | Soc |
| D | c_flickr | 4.3M | 54% | 78.2K | 305.5K | 1 544 | 151 | 12.09 | 1.2e-3 | Soc |
| E | c_blog-nat05-6m | 18.7M | 54% | 120.4K | 1.3M | 3 036 | 350 | 34.74 | 1.5e-3 | Soc |
| F | c_blog-nat06all | 22.3M | 54% | 122.6K | 1.6M | 3 431 | 403 | 44.33 | 1.6e-3 | Soc |
| G | c_cit-hep-ph | 22.2M | 54% | 130.7K | 1.6M | 661 | 182 | 4.31 | 5.7e-4 | Soc |
| H | c_cit-hep-th | 29.8M | 53% | 130.8K | 1.6M | 579 | 178 | 3.84 | 5.3e-4 | Soc |
| I | c_ca-dblp | 8.5M | 54% | 127.2K | 597.3K | 202 | 82 | 1.01 | 4.7e-4 | Soc |
| J | c_ca-gr-qc | 7.9M | 54% | 129.7K | 559.2K | 92 | 49 | 0.24 | 5.8e-4 | Soc |
| K | c_ca-hep-th | 5.3M | 54% | 121.8K | 374.1K | 129 | 55 | 0.5 | 4.6e-4 | Soc |
| L | c_ca-hep-ph | 30.4M | 54% | 130.8K | 2.1M | 933 | 256 | 8.54 | 7.7e-4 | Soc |
| M | c_web-notredame | 4.1M | 54% | 85.4K | 288.7K | 916 | 151 | 12.63 | 9.1e-4 | HyL |
| N | c_as-newman | 6.9M | 54% | 83.1K | 487.6K | 3 308 | 219 | 23 | 9.5e-4 | Top |
| O | c_as-routeviews | 7.9M | 54% | 86.5K | 556.9K | 3 603 | 244 | 27.59 | 1.4e-3 | Top |
| P | c_gnutella-30 | 2.9M | 54% | 95.6K | 203.4K | 334 | 75 | 2.21 | 5.2e-5 | Top |
| Q | c_gnutella-25 | 3.6M | 54% | 103.9K | 254.1K | 389 | 86 | 2.7 | 5.5e-5 | Top |
| R | c_atp-gr-qc | 1.3M | 54% | 86.4K | 90.9K | 26 | 14 | 0.04 | 9.4e-5 | Misc |
| S | c_bio-proteins | 9.5M | 54% | 107.2K | 667.5K | 1 773 | 203 | 13.44 | 3.2e-4 | Int |
| Growing Kronecker Graphs (KRONg) [24, 25] | ||||||||||
| A | g_answers | 538.3K | 67% | 74K | 184.9K | 563 | 80 | 6.27 | 1.4e-3 | Soc |
| B | g_delicious | 646K | 67% | 93.4K | 225.3K | 282 | 59 | 2.12 | 1.0e-3 | Soc |
| C | g_epinions | 1.1M | 68% | 85.6K | 413K | 2 023 | 135 | 14.42 | 2.1e-3 | Soc |
| D | g_flickr | 853.4K | 68% | 77.8K | 304.7K | 1 393 | 124 | 14.83 | 2.0e-3 | Soc |
| E | g_blog-nat05-6m | 3.3M | 70% | 120.3K | 1.3M | 2 912 | 238 | 23.22 | 2.3e-3 | Soc |
| F | g_blog-nat06all | 3.9M | 70% | 122.6K | 1.6M | 3 286 | 273 | 29.24 | 2.4e-3 | Soc |
| G | g_cit-hep-ph | 3.9M | 70% | 130.7K | 1.6M | 622 | 137 | 3.94 | 9.7e-4 | Soc |
| H | g_cit-hep-th | 3.9M | 70% | 130.8K | 1.6M | 568 | 134 | 3.67 | 9.2e-4 | Soc |
| I | g_ca-dblp | 1.6M | 69% | 127.1K | 596K | 181 | 63 | 0.98 | 8.4e-4 | Soc |
| J | g_ca-gr-qc | 1.5M | 69% | 129.5K | 558.4K | 79 | 39 | 0.27 | 9.7e-4 | Soc |
| K | g_ca-hep-ph | 5.3M | 70% | 130.7K | 2.1M | 907 | 187 | 7.12 | 1.3e-3 | Soc |
| L | g_ca-hep-th | 1M | 68% | 121.6K | 373.2K | 120 | 43 | 0.52 | 8.0e-4 | Soc |
| M | g_web-notredame | 811.6K | 68% | 85.2K | 288.1K | 879 | 111 | 10.9 | 1.6e-3 | HyL |
| N | g_as-newman | 1.3M | 69% | 82.9K | 486K | 3 183 | 156 | 18.41 | 1.6e-3 | Top |
| O | g_as-routeviews | 1.5M | 69% | 86.4K | 555.3K | 3 551 | 170 | 20.39 | 2.2e-3 | Top |
| P | g_gnutella-25 | 722.1K | 68% | 103.7K | 253.2K | 360 | 62 | 2.24 | 1.7e-4 | Top |
| Q | g_gnutella-30 | 587.7K | 67% | 95.3K | 202.7K | 329 | 55 | 1.92 | 1.7e-4 | Top |
| R | g_atp-gr-qc | 277.3K | 66% | 86K | 90.5K | 25 | 13 | 0.07 | 2.7e-4 | Misc |
| S | g_bio-proteins | 1.8M | 69% | 106.9K | 666.3K | 1 731 | 150 | 11.94 | 6.3e-4 | Int |
Copyright © 2027
Table A.4: Engineering Data Set (ES) statistics: updates (), insertion percentage (); maximum values for non-isolated vertices (), edges () and pattern counts.
| ID | Graph | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Wiki | A | simple_wiki | 1.6M | 72% | 99.5K | 690.7K | 3.8e+6 | 5.4e+10 | 7e+11 | 1.1e+10 | 4.9e+8 | 5.1e+8 | 5.8e+6 |
| B | nl_wiki | 2M | 79% | 253K | 1.2M | 3.1e+6 | 6.3e+10 | 4.3e+11 | 7.8e+9 | 6.2e+8 | 2.7e+8 | 5.1e+6 | |
| C | pl_wiki | 2M | 80% | 213.3K | 1.2M | 5.7e+6 | 9.4e+10 | 2.1e+12 | 1.3e+10 | 1.6e+9 | 6.5e+8 | 2.5e+7 | |
| D | it_wiki | 2M | 84% | 279.6K | 1.4M | 3.3e+6 | 1.4e+11 | 3.4e+13 | 3.2e+10 | 3.9e+9 | 3.6e+9 | 3.6e+6 | |
| E | fr_wiki | 2M | 80% | 264.5K | 1.2M | 3.8e+6 | 6.7e+10 | 5.5e+11 | 7.8e+9 | 7.7e+8 | 3.8e+8 | 1.8e+7 | |
| F | de_wiki | 2M | 82% | 240.4K | 1.3M | 4e+6 | 3.9e+10 | 1.1e+11 | 3.9e+9 | 4.4e+8 | 2.8e+8 | 2.6e+7 | |
| TMP | F | enron | 595K | 50% | 87K | 298K | 1.2e+6 | 4.7e+9 | 9.7e+9 | 9.2e+8 | 9.3e+7 | 8.4e+7 | 5.5e+6 |
| H | askubuntu | 952K | 50% | 4.9K | 6.1K | 74585 | 1.7e+8 | 6.8e+8 | 1.5e+7 | 8.1e+5 | 4e+5 | 10742 | |
| I | superuser | 1.5M | 50% | 5.5K | 7.3K | 1.3e+5 | 3e+8 | 1.1e+9 | 2.9e+7 | 1.7e+6 | 8.8e+5 | 23639 | |
| J | wiki-talk | 2M | 51% | 49.7K | 64.7K | 2.9e+5 | 2.4e+9 | 3.3e+12 | 1.4e+8 | 6.3e+6 | 2.8e+6 | 95480 | |
| K | youtube-growth | 2M | 100% | 1.2M | 2M | 3.8e+5 | 4.8e+10 | 9.7e+12 | 2.5e+9 | 7.2e+7 | 2e+7 | 1.1e+5 | |
| L | stackoverflow | 2M | 51% | 16.1K | 50.6K | 5.1e+5 | 2.4e+9 | 2.5e+9 | 1.5e+8 | 1.2e+7 | 3.7e+6 | 77043 | |
| KRONc | A | c_answers | 2M | 55% | 74.2K | 185.4K | 46974 | 1.8e+9 | 2.2e+9 | 1.9e+7 | 1.2e+6 | 1e+5 | 671 |
| B | c_delicious | 2M | 56% | 93.7K | 225.9K | 20074 | 7.6e+8 | 5.6e+8 | 4.8e+6 | 3.5e+5 | 22573 | 134 | |
| I | c_ca-dblp | 2M | 65% | 127.1K | 597.3K | 20519 | 9.7e+8 | 4.4e+8 | 3.3e+6 | 2.9e+5 | 11323 | 62 | |
| M | c_web-notred. | 2M | 57% | 85.4K | 288.7K | 95243 | 4.1e+9 | 5.7e+9 | 5.8e+7 | 3.6e+6 | 3.7e+5 | 2670 | |
| O | c_as-routeviews | 2M | 64% | 86.5K | 556.9K | 5.6e+5 | 3.3e+10 | 1.1e+11 | 1e+9 | 5.6e+7 | 7.8e+6 | 51752 | |
| R | c_atp-gr-qc | 1.7M | 53% | 86.4K | 90.9K | 509 | 1.4e+7 | 5.9e+6 | 8884 | 699 | 6 | 0 | |
| KRONG | C | g_epinions | 1.1M | 68% | 85.6K | 413K | 2e+5 | 6.1e+9 | 1.4e+10 | 1.6e+8 | 9.5e+6 | 1.5e+6 | 13510 |
| B | g_flickr | 853K | 68% | 77.8K | 304.7K | 1e+5 | 2.7e+9 | 5.2e+9 | 6.6e+7 | 3.9e+6 | 6e+5 | 5703 | |
| F | g_blog-nat06all | 2M | 70% | 98.4K | 798K | 7.1e+5 | 2.4e+10 | 3.2e+10 | 6.9e+8 | 5.4e+7 | 8e+6 | 75866 | |
| G | g_cit-hep-ph | 2M | 70% | 117.4K | 796.7K | 1.1e+5 | 3.9e+9 | 2.1e+9 | 2.9e+7 | 3.2e+6 | 1.8e+5 | 1191 | |
| N | g_as-newman | 1.3M | 69% | 82.9K | 486K | 2.7e+5 | 1.2e+10 | 4.2e+10 | 3e+8 | 1.8e+7 | 2.1e+6 | 11730 | |
| S | g_bio-proteins | 1.8M | 69% | 106.9K | 666.3K | 77387 | 6.2e+9 | 1.3e+10 | 4.1e+7 | 3.6e+6 | 94856 | 199 |
Copyright © 2027

Figure A.2: Maximal speedup over using rebalance factor in different -Partition when using HHH*-HA to count all patterns. Each graph corresponds to a single marker, where the horizontal position marks the recomputation factor achieving the maximal speedup and the vertical position shows the speedup over using .

Figure A.3: Running and maximal update time (log scale) of different EGST variants with h-Index using dataset ES and counting all subgraphs simultaneously.
A.15 Tuning the Rebalancing Frequency To study the effects of the rebalance factor , we consider HHH*-HA with different for orig.2, soft.2, lazy.2, and late.2. For lazy, we additionally include since for lazy updating the threshold more frequently reflects the evolution of the graph more accurately.
Figure A.2 shows that varying can yield speedups of up to (orig), (soft), and (lazy), (late) over the originally described on individual graphs. However, the best factor seems highly graph-specific. In the geometric mean, was always within 1% for lazy, 2% for late, 3% for soft and 9% for orig w.r.t. other values of . We therefore fix as a good compromise.
A.16 Proposed Optimizations for the EGST Algorithm Since allowing any degree for anchors in the auxiliary structure in EGST can incur high maintenance cost, we introduced EGST*-H, which uses (O- ). Additionally, we consider EGST*-D, which uses (O-D) to improve the partition swap of vertices. Figure A.3 shows running and maximum update times for all versions when counting all subgraphs simultaneously on dataset ES.
We compare the four combinations on ES. As expected, EGST*-H demonstrates clear improvements, achieving a speedup of in terms of total runtime. The maximum update time improves by . The smaller improvement on TMP graphs arises due to their sparsity, which limits the number of found auxiliary structures, thereby reducing the impact of the optimization. The larger gains appear on heavily growing graphs, where the number of auxiliary structures increases over time. This results in a higher number of expensive capacity increases in hash maps, amplifying the effect of reducing the number of structures. For EGST*-D, we observe improvements of 1.4% in total runtime compared to EGST. This is because, in most cases, applying the edge update routine twice is more expensive than scanning the 2-hop neighborhood. Differences in maximum update time are small (within 1%), without a clear winner. When combining both methods into EGST*-HD, we achieve the best overall results. EGST*-HD improves the maximum update time by and the total runtime by over EGST.
A.17 Counting Single Patterns

(a) Triangles
(a) Triangles
(b) 3-Paths
(b) 3-Paths
(c) Paws
(c) Paws
(d) 4-Cycles
(d) 4-Cycles
(e) Diamonds
(e) Diamonds
(f) 4-Cliques
Figure A.4: Performance of HHH* -H for different vertex partitions w.r.t. on ES data counting individual patterns. (We did not study claws here as these have constant update time)
(f) 4-Cliques
Figure A.5: Performance of EGST*-HD for different vertex partitions w.r.t. on ES data counting individual patterns. (We did not study claws here as these have constant update time).
Copyright © 2027