Fully Dynamic Spectral Sparsification for Directed Hypergraphs
Abstract
There has been a surge of interest in spectral hypergraph sparsification, a natural generalization of spectral sparsification for graphs. In this paper, we present a simple fully dynamic algorithm for maintaining spectral hypergraph sparsifiers of directed hypergraphs. Our algorithm achieves a near-optimal size of and amortized update time of , where is the number of vertices, and and respectively upper bound the number of hyperedges and the rank of the hypergraph at any time.
We also extend our approach to the parallel batch-dynamic setting, where a batch of any hyperedge insertions or deletions can be processed with amortized work and depth. This constitutes the first spectral-based sparsification algorithm in this setting.
Keywords and phrases:
Spectral sparsification, Dynamic algorithms, (Directed) hypergraphs, Data structuresFunding:
Sebastian Forster: This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 947702).Copyright and License:
2012 ACM Subject Classification:
Theory of computation Sparsification and spannersEditors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim ThắngSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Sparsification – the process of approximating a graph with another that has fewer edges while preserving a key property – is a central paradigm in the design of efficient graph algorithms. A fundamental property of interest is graph cuts, which are not only foundational in graph theory and serve as duals to flows, but also have widespread applications in areas such as graph clustering [39, 46, 17] and image segmentation [10, 34], to mention a few. In their seminal work, Benczúr and Karger [7] initiated the study of sparsifiers in the context of graph cuts. They showed that any graph admits a sparse reweighted cut-sparsifier whilst paying a small loss in the approximation. Spielman and Teng [52] introduced a variant of sparsification known as spectral sparsification, which generalizes cut sparsification and measures graph similarity via the spectrum of their Laplacian matrices. The development of such sparsification techniques has had a profound impact across algorithm design [42, 48, 53, 45], with the Laplacian paradigm standing out as a key example [9, 51, 14, 31, 36].
Motivated by the need to capture complex interdependencies in real-world data, beyond the pairwise relationships modeled by traditional graphs, there has been a surge of interest in recent years in developing spectral sparsifiers for hypergraphs. These efforts have led to algorithmic constructions that achieve near-optimal size guarantees [24, 25, 44, 23, 38]. However, a common limitation of these algorithms is the assumption that the input graph is static – an assumption that does not hold in many practical settings. For example, real-world graphs, such as those modeling social networks, are inherently dynamic and undergo continual structural changes. For undirected hypergraphs, this limitation has been addressed in two recent independent works [22, 32], which show that spectral hypergraph sparsifiers can be maintained dynamically, supporting both hyperedge insertions and deletions in polylogarithmic time with respect to input parameters. This naturally leads to the question of whether directed hypergraphs also admit similarly efficient dynamic sparsification algorithms.
In this paper, we study problems at the intersection of dynamic graph-based data structures and spectral sparsification for directed hypergraphs. Specifically, we consider the setting where a directed hypergraph undergoes hyperedge insertions and deletions, and the goal is to efficiently process these updates while maintaining a spectral sparsifier that approximates the input hypergraph. Our work builds upon variants of two key algorithmic constructions: the static spectral sparsification framework for directed hypergraphs developed by Oko et al. [44], and the dynamic sparsifier maintenance techniques for ordinary graphs by Abraham et al. [1]. Leveraging insights from both lines of work and modifying them to our setting, we design efficient dynamic algorithms for maintaining spectral sparsifiers of directed hypergraphs, as formalized in the theorem below.
Theorem 1.
Given a directed hypergraph with vertices, rank , and at most hyperedges (at any time), there is a fully dynamic data structure that, with high probability, maintains a -spectral hypersparsifier of of size in amortized update time.
The guarantees provided by the above theorem are nearly tight, for the following reasons: (1) even reading the hyperedges in a hypergraph of rank requires time, which means any update time must inherently depend on , and (2) in the setting of directed graphs, it is folklore that a complete bipartite graph on vertices, with all edges directed from one partition to the other, gives an lower bound on the size of any directed sparsifier. Moreover, Oko et al. [44] established an even stronger lower bound, showing that any spectral sparsifier must also incur a dependence. The latter implies that the size of our dynamic sparsifier is optimal up to a factor of and polylogarithmic terms.
Our algorithmic construction also extends naturally to the closely related batch-dynamic setting. In this model – similar to the fully dynamic setting – updates consist of hyperedge insertions and deletions, but are processed in batches, enabling the exploitation of parallelism. This approach is particularly well-suited for handling high-throughput update streams and may more accurately reflect how dynamic changes are managed in real-time systems. Our result in this model is formalized in the theorem below.
Theorem 2.
Given a directed hypergraph with vertices, rank , and at most hyperedges (at any time) undergoing batches of hyperedge additions or deletions, there is a parallel fully dynamic data structure that, with high probability, maintains a -spectral hypersparsifier of of size in amortized work and depth.
The data structure of Theorem 2, along with its analysis, is explained in the full version of the paper (Appendix A).
1.1 Related Work
We briefly discuss the related work for spectral sparsification on both graphs and hypergraphs below.
Static Algorithms
Dynamic Algorithms
For undirected graphs, there have been several results for dynamic spectral sparsifiers that use a similar approach to ours. This includes the work of Abraham, Durfee, Koutis, Krinninger, and Peng [1], which achieves polylogarithmic update time using -bundle spanners, and its extension against an adaptive adversary by Bernstein, Brand, Gutenberg, Nanongkai, Saranurak, Sidford, and Sun [8] and to directed graphs by Zhao [55]. More recently, Khanna, Li, and Putterman [32] achieved a fully dynamic spectral sparsifier with near-optimal size and update time for undirected hypergraphs. A closely related notion of sparsification, namely vertex sparsifiers, has also been studied in the dynamic setting [21, 16, 11, 19, 3, 54, 15].
Distributed and Parallel Algorithms
Koutis and Xu [37] achieved simple algorithms for spectral graph sparsification that can be implemented in many computational models, including both parallel and distributed settings, with sub-optimal guarantees on the sparsifier size. Very recently, Ghaffari and Koo [20] developed a parallel batch-dynamic algorithm for spanners. Other related works include distributed vertex sparsifiers [56, 18].
Online and Streaming Algorithms
For graphs, Kelner and Levin [30] extended the sampling scheme based on effective resistances [51] to the semi-streaming setting. Cohen, Musco, and Pachocki [13] obtained an online spectral sparsification algorithm for graphs. Recently, Soma, Tung, and Yoshida [49] proposed an online algorithm for spectral hypergraph sparsification. For graphs in dynamic streams, Ahn, Guha, and McGregor [2] developed a spectral sparsifier. Also, there has been a series of work on spectral sparsification in dynamic streams for both graphs and hypergraphs [26, 28, 27].
1.2 Technical Overview
In this section, we present the main ideas behind our fully dynamic algorithm for maintaining a -spectral hypersparsifier of a directed hypergraph . Our algorithm builds on the static algorithm of [44], which we briefly review.
The algorithm of [44] constructs by computing a sequence of hypergraphs , where is a spectral hypersparsifier of , is a spectral hypersparsifier of , and so on, until . Each is obtained via simple sampling scheme (discussed shortly) that guarantees, with high probability, is proportionally smaller than . As a result, the number of iterations is bounded by . In constructing from , the algorithm obtains two sub-hypergraphs of : the coreset hypergraph and the sampled hypergraph .
At a high level, consists of a sufficient number of heavy-weight hyperedges of (to be specified shortly). This ensures that, when hyperedges are sampled uniformly at random from the remaining hypergraph to construct , the resulting union forms a spectral hypersparsifier of . More precisely, is constructed as follows. For every pair , the algorithm selects the heaviest hyperedges whose tail111In a directed hypergraph, each hyperedge is a pair , with the tail and the head reflecting the direction of . See Section 2 for further details. contains and whose head contains .222If multiple hyperedges have equal weight, the algorithm picks them arbitrarily. These hyperedges are then added to .
To construct , each hyperedge in is sampled independently with probability , and its weight is doubled. They prove that, with high probability, this simple sampling scheme produces a -spectral hypersparsifier of . Moreover, with high probability, and so . See Figure 1(a) for an illustration of their approach.
Unfortunately, the static algorithm cannot be directly converted into an efficient dynamic algorithm. This is mostly due to the way the hypergraphs in the sequence are built on top of each other, as a single change in can propagate into changes across the sequence. As an example, we explain how the removal of a hyperedge from can cause at least two changes in , which can eventually lead to changes throughout the sequence. Assume a hyperedge is removed from and that also belongs to the coreset hypergraph of . As is a sub-hypergraph of , may also belong to , necessitating its removal from as well. To maintain as a coreset of , the algorithm must replace with a next heaviest hyperedge from . If is an unsampled hyperedge (i.e., belongs to ), its addition to (and so ) may require updating as well: as is a sub-hypergraph of , the (newly added) hyperedge could be heavier than some hyperedge in , necessitating the replacement of in . Thus, the removal of a hyperedge from can trigger at least two removals (namely, and ) and one insertion (namely, ) in . See Section 3.1 for further details.
To overcome this issue, our static algorithm deviates from that of [44] in the following way. We ensure that each hyperedge is included in at most one coreset by recursing on the sampled hypergraph rather than on . At the same time, we add to the sparsifier . i.e., we set , which can be verified to remain a spectral sparsifier of (as discussed in Lemma 5). See Figure 1(b) for an illustration. Using this approach, after the deletion of from , each hypergraph in the sequence will undergo at most one change. Specifically, in the case of replacing a hyperedge by as in the high-recourse example above, there are two possibilities: either (1) does not belong to (i.e., it is not in the sampled hypergraph ), in which case the replacement does not affect , or (2) belongs to , in which case the update is interpreted as the removal of from (note that since is excluded from , the hyperedge no longer belongs to ). The downside of this approach is that it increases the size of from to . This increase becomes noticeable only when is exponential in . Even in that case, however, the size of stays , which is asymptotically much smaller than the exponential size of .
To dynamize our static algorithm, we adapt an approach similar to that of [1] for graphs. We first design a decremental data structure (Algorithm 4 in Section 3.2.1), where the updates consist of only hyperedge deletions, and then use it to design a fully dynamic data structure (Algorithm 5 in Section 3.2.2) via a reduction technique.
Our decremental algorithm leverages the fact that a hyperedge deletion in causes at most one hyperedge deletion in each hypergraph in the sequence . The removal of a hyperedge from is handled using a straightforward replacement scheme. If belongs to the sampled hypergraph , then remains valid after the removal of , in the sense that it is still a set of hyperedges sampled uniformly at random from the updated . The update procedure is more involved if belongs to the coreset hypergraph . Recall that was added to through a pair , where belongs to the tail of and belongs to the head of . The replacement of is handled by removing it from all sets representing such pairs and then selecting a hyperedge with high weight that is not already in . Since there are such pairs, this results in an update time for maintaining . See Section 3.2.1 for more details.
To convert our decremental data structure to a fully dynamic one, we leverage the decomposability property of spectral sparsifiers: the union of spectral sparsifiers of hyperedge partitions of forms a spectral sparsifier of (see Lemma 3 for a formal statement). The main idea is to maintain a hyperedge partition of where at any time. Deletions are handled by passing them to the respective , whereas insertions are more difficult to handle: the data structure finds an integer and moves all the hyperedges in to along with the inserted hyperedge. The choice of depends on the number of insertions so far, with smaller values of (corresponding to hypergraphs considerably smaller than ) being chosen more frequently. On each , we run our decremental data structure to maintain a spectral sparsifier of , and upon an insertion, we reinitialize it for . The algorithm sets , and since the desired size of follows. See Section 3.2.2 for further discussion.
Our approach in designing a decremental data structure and extending it to a fully dynamic one is similar to recent work on dynamic sparsification for undirected hypergraphs [22, 32]. Moreover, [22] also builds on the framework of [44]. The key difference is that we adapt the directed framework of [44] (specifically, -coresets), whereas [22] employs their undirected framework (specifically, -bundle hyperspanners, a concept also used in [32]). Both [22] and [32] rely on spanner-based techniques to bound the effective resistances in the associated graph of the hypergraph as a crucial step in enabling their simple sampling scheme. For the directed case, however, [44] shows that this translates to using coresets, which are structurally simpler than hyperspanners. This structural simplicity allows us to design relatively simpler algorithms compared to those in [22, 32].
It is noteworthy to mention the recent work of [33] that reduces directed hypergraph sparsification to undirected hypergraph sparsification. Combining this reduction with the fully dynamic undirected hypergraph sparsification result of [32] yields a dynamic algorithm for directed hypergraph sparsification with guarantees similar to ours. However, the algorithm of [32] is substantially more involved: (i) it relies on vertex-sampling steps, which our approach does not require, and (ii) it uses dynamic graph spanner constructions in a black-box manner. Moreover, it does not seem straightforward to extend their algorithm to the batch-parallel setting. In comparison, our coreset-based construction is significantly simpler and potentially more practically relevant. It readily extends to the batch-parallel setting and achieves a better and explicit polylogarithmic overhead in both sparsifier size and update time.
Lastly, in the full version of the paper (Appendix A), we show how to parallelize our data structures when undergoes batches of hyperedge deletions or additions as a single update. This discussion also explains how to adapt our fully dynamic data structure to support batch updates rather than single updates.
2 Preliminaries
Hypergraphs
A hypergraph consists of a set of vertices , a set of hyperedges , and a weight vector . The direction of a hyperedge is defined by sets and as follows. Each hyperedge is a pair , where both and are non-empty subsets of . The sets and are called the tail and head of , respectively; they indicate the direction of . Note that and may overlap.
We use to denote the set of hyperedges of whenever necessary, to avoid possible confusion. We define and and call an -edge -vertex hypergraph. We say is of rank if, for every hyperedge , .
Given a vector defined on the set of vertices , we define to be the value of vector at the element associated with vertex . Similarly, for a vector defined on the set of hyperedges , we define to be the value of vector at the element associated with hyperedge .
Spectral Sparsification of Directed Hypergraphs
We define the spectral property of a directed hypergraph using the energy function defined in the following. For a vector , we define the energy of with respect to as
where and . Note that this definition generalizes a similar definition for graphs, given by , which represents the total energy dissipated in when viewed as an electrical network. In such electrical network, the endpoints of each edge have potentials and , respectively, and the edge itself has resistance . This interpretation is closely related to the notion of electrical flows, a concept that is deeply intertwined with spectral analysis.
The central object of this paper is the notion of a spectral hypersparsifier. A hypergraph is called a -spectral hypersparsifier of if for every vector ,
The following lemma will be useful later in proving the guarantees of our algorithm.
Lemma 3 (Decomposability).
Let partition the hyperedges of a hypergraph . For each , let be a -spectral hypersparsifiers of . Then, the union is a -spectral hypersparsifier of .
Proof.
By definition, for every vector , we have
Summing over all , results in
which means
as partition .
Chernoff Bound [12, 43]
Let be independent random variables, where each equals with probability , and otherwise. Let and . Then, for all ,
| (1) |
Parallel Batch-Dynamic Model
We use the work-depth model to analyze our parallel algorithm. Work is defined as the total number of operations done by the algorithm, and depth is the length of the longest chain of dependencies. Intuitively, work measures the time required for the algorithm to run on a single processor, whereas depth measures the optimal time assuming the algorithm has access to an unlimited number of processors.
In the batch-dynamic setting, each update consists of a batch of insertions or deletions, and the goal is to take advantage of performing several hyperedge insertions or deletions as a single update to improve the work and depth of the parallel algorithm. Note that this model is equivalent to the one with mixed updates (i.e., when the batch consists of both insertions and deletions), as this can be transformed into two steps, each consisting of insertions and deletions separately, without asymptotically increasing the work or depth.
3 Dynamic Spectral Sparsification
In this section, we present our fully dynamic algorithm of Theorem 1 for maintaining a -spectral hypersparsifier of a directed hypergraph . To achieve this goal, we use a static algorithm as the cornerstone for our dynamic algorithm. The static algorithm is explained in Section 3.1 and is followed by the dynamic data structure in Section 3.2.
3.1 The Static Algorithm
We start by briefly explaining the algorithm of [44], which serves as a foundation for our algorithm. Their algorithm constructs a -spectral hypersparsifier of using an iterative approach: starting with , each iteration computes a sub-hypergraph of , until the final iteration computes , where .
To compute from , the algorithm first obtains a -coreset of . Roughly speaking, is a sub-hypergraph containing “heavyweight” hyperedges of and is defined as follows. The algorithm defines an ordering on hyperedges in by their weights in decreasing order. Note that this ordering naturally extends to every hypergraph as a sub-hypergraph of . To construct , the algorithm examines every pair and selects the first hyperedges in the ordering (if any) that are not already in , whose tail contains and whose head contains . These hyperedges are then added to . The second building-block of is the sampled hypergraph of defined as follows. The algorithm samples the non-heavy hyperedges (i.e., the ones in ) with probability and adds them to while doubling their weight. Consequently, . See Algorithm 1 for a pseudocode.
Having heavyweight hyperedges in ensures that the simple sampling scheme used for constructing results in , which, with high probability, is a -spectral hypersparsifier of [44, Lemma 4.3]. Due to the sampling scheme, is roughly half the size of , which ensures the termination of the algorithm after iterations. Using this sequence of hypergraphs, they achieve a sparsifier with an almost optimal size of [44, Theorem 1.1]. See Figure 1(a) for an illustration.
Unfortunately, employing the sequence of hypergraphs can result in recourse (and consequently, update time) in the dynamic setting. For example, consider the removal of a hyperedge from that also belongs to the coreset of . In this scenario, to ensure remains a -coreset and so remains a -spectral hypersparsifier of , we need to replace with another hyperedge from . i.e., if was added to through the pair , hyperedge in is the next hyperedge in the ordering whose tail contains and whose head contains . Since is a set of sampled hyperedges uniformly at random, it may be the case that does not belong to , and therefore to none of for . Since is added to after the update (as it now belongs to ), it must be taken into account in the update of as a sub-hypergraph of (newly updated) . But now, may be heavier than another hyperedge in , which necessitates the replacement of with . Since can be present in as well, this means that the deletion of from can result in at least changes in , and at least changes in the sequence, which is too expensive to afford.
To alleviate this issue, our static algorithm deviates from that of [44] by recursing on instead of as follows. At each iteration , the algorithm recurses on , adds the coreset of to , and samples the rest, , to obtain a smaller hypergraph for the next iteration. More precisely, the algorithm starts with and an empty sparsifier . In the first iteration, it computes the coreset of , and adds it to . The algorithm then samples the remaining hypergraph to compute by sampling every hyperedge in with probability and doubling their weight. Similar to [44], with high probability, is a -spectral hypersparsifier of (Lemma 4). The algorithm then recurses on , and so on. Thus, our algorithm adds the sequence of coresets to while recursing on the sequence of hypergraphs . In the last iteration , our algorithm adds as well as to . See Algorithm 2 for a pseudocode and Figure 1(b) for an illustration.
This technique, which is similar to the one used in [1] for graphs, ensures that each hyperedge of is associated with at most one coreset. This guarantees hyperedge deletions from after a hyperedge deletion in (Lemma 8), but in return, results in a overhead in the size of as we include the coresets in . i.e., our algorithm ensures that is a desired sparsifier of size , which is asymptotically much smaller than even when is exponential in .
The rest of this section examines the correctness of Algorithms 1 and 2. Algorithm 1, used as a subroutine of Algorithm 2, computes a coreset and a sampled hypergraph of the input hypergraph. The guarantees of Algorithm 1 are stated in the following lemma.
Lemma 4.
Let and let be an -edge -vertex hypergraph. For any positive constant , if , then Algorithm 1 returns a coreset and a sampled hypergraph such that is a -spectral hypersparsifier of of size with probability at least .
Proof.
High probability claim.
For every hyperedge in , we define the random variable to be equal if is sampled to be in , and otherwise. Let . Since each hyperedge in is sampled independently with probability , we can use Equation 1 and we have . By substituting in Equation 1,
or equivalently
| (2) |
Since each pair adds at most hyperedges to , we have . Together with Equation 2, it follows that has size with probability at least .
The guarantees of Algorithm 2 are stated in the following lemma.
Lemma 5.
Let and let be an -edge -vertex hypergraph. Then, with high probability, Algorithm 2 returns a -spectral hypersparsifier of of size .
Proof.
We prove each guarantee separately below.
Approximation guarantee.
We prove that is a -spectral hypersparsifier of by induction on .
If , by Lemma 4, is a -spectral hypersparsifier of .
Suppose that, for an integer , be a -spectral hypersparsifier of . To compute , the algorithm computes a -spectral hypersparsifier of . Since partition , by Lemma 3, is a -spectral hypersparsifier of . For every vector , we have
Similarly, , and so is a -spectral hypersparsifier of .
The desired bound follows from the fact that , and
Size of .
Let be the number of hyperedges present in , where . We first show that . By Equation 2, has size , so it suffices to show that . By the assumption of the loop, we have
and thus . This means that the size of is
The rest of consists of the coresets . By Lemma 4, each has size . Since , the total size of the coresets is
Therefore, the total size of is
High probability claim.
Since and from Lemma 4, is a -spectral hypersparsifier with probability at least . The claim follows by choosing .
3.2 The Dynamic Algorithm
In this section, we dynamize our static algorithm (Algorithm 2). We first design a decremental data structure in Section 3.2.1, where undergoes only hyperedge deletions. Then, we reduce it to a fully dynamic data structure in Section 3.2.2 using the following lemma.
Lemma 6.
Assume that there is a decremental algorithm that with probability at least , maintains a -spectral hypersparsifier of any hypergraph with initial hyperedges in amortized update time and of size , where and are monotone non-decreasing functions. Then, the algorithm can be transferred into a fully dynamic algorithm that, with high probability, maintains a -spectral hypersparsifier of any hypergraph with hyperedges (at any point) in amortized update time of size .
The fully dynamic to decremental reduction (Lemma 6) uses the batching technique [1, 22, 32] and is explained in Section 3.2.2.
3.2.1 Decremental Spectral Sparsifier
In this section, we explain our data structure (Algorithm 4) to decrementally maintains a -spectral hypersparsifier of . As Algorithm 1 is used as a subroutine of Algorithm 2, we begin by explaining its decremental implementation (presented in Algorithm 3).
Decremental Implementation of Algorithm 1
To decrementally maintain a coreset and a sampled hypergraph of , we need to ensure that after each deletion, the maintained remains a valid sparsifier for . i.e., it continues to be a -spectral hypersparsifier of (Lemma 4).
Recall that, for every pair , Algorithm 1 defines the set of hyperedges where iff and . It then constructs a coreset by adding (defined in Algorithm 1) heaviest hyperedges of to . The hypergraph is then obtained by sampling each hyperedge in with probability while doubling its weight.
To construct , the algorithm greedily chooses a pair , adds its heavyweight hyperedges to , and continues with another pair . Note that the order of choosing the pairs might affect the choice of hyperedges included in . Nevertheless, the guarantee of the algorithm (Lemma 4) is independent of this order. For example, it does not matter whether is chosen first or is. We will use this fact later to maintain a valid and after each deletion.
We use the same procedure to initialize the decremental implementation. Since we would need to find the heaviest hyperedges in after a deletion, we also order each .
Suppose that hyperedge has been removed from . Then, must belong to one of the three cases below, which together cover all hyperedges of .
-
If belongs to neither nor to , then its removal does not affect . This is because still contains the heaviest hyperedges associated with each pair , and each hyperedge in has been independently sampled.
-
If belongs to , similar to the previous case, the sampled hypergraph after the removal of is still a valid sample. Thus, no further changes are required to maintain .
-
If belongs to , then the deletion from translates to undoing the addition of to from the specific set that originally added to . In this case, since no longer exists in , we add a heaviest hyperedge from to . Since the order of hyperedge addition to does not affect its guarantees (Lemma 4), the updated remains valid. For bookkeeping reasons, if was previously sampled, we remove it from . Based on the previous discussion, the updated is also valid.
In addition to the changes explained above, the maintenance involves the removal of from every set containing , which, as explained in the lemma below, adds overhead to the update time. Putting it all together, Algorithm 3 is our decremental data structure for maintaining . We have the following.
Lemma 7.
Given a constant and an -edge -vertex hypergraph of rank undergoing hyperedge deletions. If , then Algorithm 3 maintains a -spectral hypersparsifier of of size in amortized update time with probability at least .
Proof.
Suppose the hyperedge is removed from .
Correctness.
From the discussion above, it follows immediately that , after the update, is a valid sparsifier for ; the correctness of its spectral property is addressed in the high probability claim below.
Size of .
Since after each hyperedge deletion from , the algorithm substitutes it with at most one other hyperedge from , the size of is monotonically decreasing. Thus, has the same size guarantee as of Algorithm 1 explained in Lemma 4, which is
Update time.
Since each hyperedge contains vertices, the total number of ’s containing is . Thus, constructing ’s, takes time, while ordering them adds time to the initialization time as well. As explained before, the deletion of from translates to its deletion from at most sets of ’s, each of which takes time, i.e., total time. Other changes, such as substituting another hyperedge in , can be done by probing ’s only once in total. We conclude that the total update time is , resulting in amortized update time.
High probability claim.
By choosing in Lemma 4, each update is guaranteed to succeed with probability at least . Since there are at most updates, it follows that Algorithm 3 succeeds with probability at least .
Decremental Implementation of Algorithm 2
Our decremental data structure for maintaining a -spectral hypersparsifier of (Algorithm 4) is a decremental implementation of Algorithm 2. Recall that, in Algorithm 2, we recurse on the sampled hypergraphs and add the coresets to . By Lemma 5, is a -spectral hypersparsifier of .
In Algorithm 4, we decrementally maintain the hypergraphs and the coresets . Suppose that hyperedge has been deleted from as the most recent update. Below, we discuss how the data structure handles the deletion in all possible scenarios.
-
If does not belong to , then can only exist in the sets of sampled hyperedges . In this case, removing from all ’s does not affect since the set of sampled hyperedges remains valid, as each hyperedge is sampled independently.
-
If belongs to , then is present in all sets of sampled hyperedges, i.e., in . Note that, although belongs to in this case, since it is only present in sampled hypergraphs, its removal does not affect the coresets and can be handled similarly to the previous case.
-
If belongs to a coreset , then it belongs to the sets of sampled hyperedges , and since it is in the coreset of , it cannot be present in . Similar to the previous cases, we can simply remove from to maintain . For , we need to maintain , for which we use Algorithm 3 as a subroutine to find a hypergraph to be added to as the substitution for . By Algorithm 3, belongs to and thus its addition to does not affect . On the other hand, might be present in , and we need to ensure they are still valid after adding to . If appears in the sets of sampled hyperedges, then similar to the previous cases, simply removing from the sparsifiers makes them valid. Therefore, we pass the deletion of to the next sparsifiers until we reach containing in its coreset . Again, by construction, cannot be present in , and we need to remove from . This procedure is similar to the one we just explained for the removal of from , except that we now use it to remove from .
As explained above, to handle hyperedge deletions in each sparsifier , the data structure utilizes Algorithm 3 and then transmits the changes in to . The key point of our data structure is that it guarantees the transfer of at most one hyperedge deletion from one level to the next, thereby ensuring low recourse at each level. This results in at most hyperedge deletions across all levels following a hyperedge deletion in . The guarantees of the data structure are stated below.
Lemma 8.
Given a constant and an -edge -vertex hypergraph of rank undergoing hyperedge deletions, Algorithm 4 maintains a -spectral hypersparsifier of of size in amortized update time with probability at least . Additionally, each deletion in results in recourse in .
Proof.
Suppose that a deletion has happened in .
Correctness.
From Lemma 7, each correctly handles the deletions. The fact that the data structure correctly transfers hyperedge deletions between ’s and thus correctly maintains follows from the discussion above.
Size of .
Update time.
The data structure initializes and decrementally maintains data structures of Algorithm 3. By Lemma 7, each data structure takes total update time. Also, at each update, the data structure transmits at most one hyperedge from one level to the next, which results in an total transmission. Thus, the algorithm takes total update time, or equivalently, amortized update time.
High probability claim.
From Lemma 7, for any constant , each correctly maintains its coreset and the set of sampled hyperedges with probability at least . Since , by choosing , the claim follows.
Recourse bound.
As explained before, every hyperedge deletion from translates to at most one hyperedge deletion or addition in for . Since , it follows that the total number of hyperedge changes in is .
3.2.2 Fully Dynamic Spectral Sparsifier
With a decremental data structure (Algorithm 4) in hand, we now obtain the fully dynamic data structure. We begin by explaining the reduction from the fully dynamic to the decremental data structure and by proving Lemma 6. We then prove Theorem 1.
Reduction from Fully Dynamic to Decremental
We explain how to use the decremental data structure to design a fully dynamic data structure, as described in Algorithm 5. In a nutshell, the data structure uses the batching technique; it maintains a batch of -spectral hypersparsifiers , each of which decrementally maintains sub-hypergraphs , respectively, such that these sub-hypergrphs partition . The union , by decomposability (Lemma 3), is a -spectral hypersparsifier of .
More specifically, the data structure starts with an empty and empty and ensures that each contains at most hyperedges at all time (which we call the size constraint of ). Intuitively, a hyperedge inserted in is placed in as long as the size constraint of is not violated. If there are already two hyperedges in , the data structure moves all hyperedges of (along with ) to the empty . Note that can contain at most four hyperedges, and so its size constraint is not violated. However, if there were already two hyperedges in , then the addition of three more hyperedges (from plus ) would violate its size constraint. In this case, the data structure would move the hyperedges of and plus to , and so on.
To regularize the insertion process, we initialize a counter as a binary sequence of zeros. After each insertion, the data structure increments (in the binary format) by one and finds the highest index whose bit flipped due to the increment. The data structure then moves the hyperedges in , along with the inserted hyperedge , to and reinitializes the decremental data structure with the new .
The deletion process can be done as before; since each hyperedge is associated with exactly one sub-hypergraph , its deletion would be easily handled by passing it to the decremental data structure maintaining .
Proof of Lemma 6.
Suppose that the decremental data structure maintains a -spectral hypersparsifier of any hypergraph with initial hyperedges in amortized update time and of size with probability at least .
Correctness.
Size of .
By assumption, each has size , which is upper bounded by since and is a monotone non-decreasing function. Since , the size of is bounded by
Update time.
After insertions, has been reinitialized for at most times. This is because can contain at most hyperedges. By assumption, the total time for the initialization and maintenance of is bounded by , which is bounded by since and is a monotone non-decreasing function. Thus, the total time for the initialization and maintenance of throughout insertions is . Therefore, the total update time for maintaining is
resulting in an amortized update time.
High probability claim.
After insertions, each is reinitialized times. By Lemma 8, the probability of failure is at most , where . Since , it follows that the probability of failure for maintaining is at most . Since , the high probability claim follows by choosing to be large enough.
Proof of Theorem 1.
Given an -edge -vertex hypergraph of rank , by Lemma 8, the decremental data structure (Algorithm 4) maintains a -spectral hypersparsifier of of size in amortized update time.
Since and are monotone non-decreasing functions, it follows from Lemma 6 that, for any hypergraph containing at most hyperedges at any point, the fully dynamic data structure (Algorithm 5) maintains a -spectral hypersparsifier of of size in amortized update time.
References
- [1] Ittai Abraham, David Durfee, Ioannis Koutis, Sebastian Krinninger, and Richard Peng. On fully dynamic graph sparsifiers. In 57th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 335–344, 2016. doi:10.1109/FOCS.2016.44.
- [2] Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. Spectral sparsification in dynamic graph streams. In Prasad Raghavendra, Sofya Raskhodnikova, Klaus Jansen, and José D. P. Rolim, editors, 16th Workshop on Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX), volume 8096 of Lecture Notes in Computer Science, pages 1–10. Springer, 2013. doi:10.1007/978-3-642-40328-6_1.
- [3] Kyriakos Axiotis, Aleksander Madry, and Adrian Vladu. Faster sparse minimum cost flow by electrical flow localization. In 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 528–539, 2021. doi:10.1109/FOCS52979.2021.00059.
- [4] Nikhil Bansal, Ola Svensson, and Luca Trevisan. New notions and constructions of sparsification for graphs and hypergraphs. In 60th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 910–928, 2019. doi:10.1109/FOCS.2019.00059.
- [5] Joshua Batson, Daniel A. Spielman, and Nikhil Srivastava. Twice-ramanujan sparsifiers. SIAM Journal on Computing, 41(6):1704–1721, 2012. doi:10.1137/090772873.
- [6] Joshua D. Batson, Daniel A. Spielman, Nikhil Srivastava, and Shang-Hua Teng. Spectral sparsification of graphs: theory and algorithms. Commun. ACM, 56(8):87–94, 2013. doi:10.1145/2492007.2492029.
- [7] András A. Benczúr and David R. Karger. Approximating s-t minimum cuts in time. In 28th Annual ACM Symposium on Theory of Computing (STOC), pages 47–55, 1996. doi:10.1145/237814.237827.
- [8] Aaron Bernstein, Jan van den Brand, Maximilian Probst Gutenberg, Danupon Nanongkai, Thatchaphol Saranurak, Aaron Sidford, and He Sun. Fully-dynamic graph sparsifiers against an adaptive adversary. In 49th International Colloquium on Automata, Languages and Programming (ICALP), volume 229, pages 20:1–20:20, 2022. doi:10.4230/LIPIcs.ICALP.2022.20.
- [9] Erik G. Boman, Bruce Hendrickson, and Stephen A. Vavasis. Solving elliptic finite element systems in near-linear time with support preconditioners. SIAM J. Numer. Anal., 46(6):3264–3284, 2008. doi:10.1137/040611781.
- [10] Yuri Boykov and Olga Veksler. Graph cuts in vision and graphics: Theories and applications. In Handbook of Mathematical Models in Computer Vision, pages 79–96. 2006. doi:10.1007/0-387-28831-7_5.
- [11] Li Chen, Gramoz Goranci, Monika Henzinger, Richard Peng, and Thatchaphol Saranurak. Fast dynamic cuts, distances and effective resistances via vertex sparsifiers. In 61st IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 1135–1146, 2020. doi:10.1109/FOCS46700.2020.00109.
- [12] Herman Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, 23(4):493–507, 1952. URL: http://www.jstor.org/stable/2236576.
- [13] Michael B. Cohen, Cameron Musco, and Jakub Pachocki. Online row sampling. Theory Comput., 16:1–25, 2020. doi:10.4086/TOC.2020.V016A015.
- [14] Samuel I. Daitch and Daniel A. Spielman. Faster approximate lossy generalized flow via interior point algorithms. In 40th Annual ACM Symposium on Theory of Computing (STOC), pages 451–460, 2008. doi:10.1145/1374376.1374441.
- [15] Sally Dong, Yu Gao, Gramoz Goranci, Yin Tat Lee, Richard Peng, Sushant Sachdeva, and Guanghao Ye. Nested dissection meets ipms: Planar min-cost flow in nearly-linear time. In 33rd ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 124–153, 2022. doi:10.1137/1.9781611977073.7.
- [16] David Durfee, Yu Gao, Gramoz Goranci, and Richard Peng. Fully dynamic spectral vertex sparsifiers and applications. In 51st Annual ACM Symposium on Theory of Computing (STOC), pages 914–925, 2019. doi:10.1145/3313276.3316379.
- [17] Zhuo Feng. Similarity-aware spectral sparsification by edge filtering. In Proceedings of the 55th Annual Design Automation Conference, pages 1–6, 2018. doi:10.1145/3195970.3196114.
- [18] Sebastian Forster, Gramoz Goranci, Yang P. Liu, Richard Peng, Xiaorui Sun, and Mingquan Ye. Minor sparsifiers and the distributed laplacian paradigm. In 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 989–999, 2021. doi:10.1109/FOCS52979.2021.00099.
- [19] Yu Gao, Yang P. Liu, and Richard Peng. Fully dynamic electrical flows: Sparse maxflow faster than goldberg-rao. In 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 516–527, 2021. doi:10.1109/FOCS52979.2021.00058.
- [20] Mohsen Ghaffari and Jaehyun Koo. Parallel batch-dynamic algorithms for spanners, and extensions. In 37th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 299–313. ACM, 2025. doi:10.1145/3694906.3743322.
- [21] Gramoz Goranci, Monika Henzinger, and Pan Peng. Dynamic effective resistances and approximate schur complement on separable graphs. In 26th European Symposium on Algorithms (ESA), volume 112, pages 40:1–40:15, 2018. doi:10.4230/LIPIcs.ESA.2018.40.
- [22] Gramoz Goranci and Ali Momeni. Fully dynamic spectral sparsification of hypergraphs. CoRR, abs/2502.01421, 2025. doi:10.48550/arXiv.2502.01421.
- [23] Arun Jambulapati, Yang P. Liu, and Aaron Sidford. Chaining, group leverage score overestimates, and fast spectral hypergraph sparsification. In 55th Annual ACM Symposium on Theory of Computing (STOC), pages 196–206, 2023. doi:10.1145/3564246.3585136.
- [24] Michael Kapralov, Robert Krauthgamer, Jakab Tardos, and Yuichi Yoshida. Spectral hypergraph sparsifiers of nearly linear size. In 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 1159–1170, 2021. doi:10.1109/FOCS52979.2021.00114.
- [25] Michael Kapralov, Robert Krauthgamer, Jakab Tardos, and Yuichi Yoshida. Towards tight bounds for spectral sparsification of hypergraphs. In 53rd Annual ACM Symposium on Theory of Computing (STOC), pages 598–611, 2021. doi:10.1145/3406325.3451061.
- [26] Michael Kapralov, Yin Tat Lee, Cameron Musco, Christopher Musco, and Aaron Sidford. Single pass spectral sparsification in dynamic streams. SIAM J. Comput., 46(1):456–477, 2017. doi:10.1137/141002281.
- [27] Michael Kapralov, Aida Mousavifar, Cameron Musco, Christopher Musco, Navid Nouri, Aaron Sidford, and Jakab Tardos. Fast and space efficient spectral sparsification in dynamic streams. In Shuchi Chawla, editor, ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1814–1833. SIAM, 2020. doi:10.1137/1.9781611975994.111.
- [28] Michael Kapralov, Navid Nouri, Aaron Sidford, and Jakab Tardos. Dynamic streaming spectral sparsification in nearly linear time and space. CoRR, abs/1903.12150, 2019. arXiv:1903.12150.
- [29] Michael Kapralov and Rina Panigrahy. Spectral sparsification via random spanners. In Shafi Goldwasser, editor, Innovations in Theoretical Computer Science (ITCS), pages 393–398. ACM, 2012. doi:10.1145/2090236.2090267.
- [30] Jonathan A. Kelner and Alex Levin. Spectral sparsification in the semi-streaming setting. Theory Comput. Syst., 53(2):243–262, 2013. doi:10.1007/S00224-012-9396-1.
- [31] Jonathan A. Kelner and Aleksander Madry. Faster generation of random spanning trees. In 50th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 13–21, 2009. doi:10.1109/FOCS.2009.75.
- [32] Sanjeev Khanna, Huan Li, and Aaron Putterman. Near-optimal linear sketches and fully-dynamic algorithms for hypergraph spectral sparsification. In Michal Koucký and Nikhil Bansal, editors, 57th Annual ACM Symposium on Theory of Computing (STOC), pages 1190–1200. ACM, 2025. doi:10.1145/3717823.3718239.
- [33] Sanjeev Khanna, Aaron (Louie) Putterman, and Madhu Sudan. Almost-tight bounds on preserving cuts in classes of submodular hypergraphs. In Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson, editors, 51st International Colloquium on Automata, Languages and Programming (ICALP), volume 297 of LIPIcs, pages 98:1–98:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.ICALP.2024.98.
- [34] Pushmeet Kohli and Philip H. S. Torr. Dynamic graph cuts and their applications in computer vision. In Computer Vision: Detection, Recognition and Reconstruction, volume 285 of Studies in Computational Intelligence, pages 51–108. 2010. doi:10.1007/978-3-642-12848-6_3.
- [35] Ioannis Koutis, Alex Levin, and Richard Peng. Faster spectral sparsification and numerical algorithms for SDD matrices. ACM Trans. Algorithms, 12(2):17:1–17:16, 2016. doi:10.1145/2743021.
- [36] Ioannis Koutis, Gary L. Miller, and David Tolliver. Combinatorial preconditioners and multilevel solvers for problems in computer vision and image processing. Comput. Vis. Image Underst., 115(12):1638–1646, 2011. doi:10.1016/J.CVIU.2011.05.013.
- [37] Ioannis Koutis and Shen Chen Xu. Simple parallel and distributed algorithms for spectral graph sparsification. ACM Trans. Parallel Comput., 3(2):14:1–14:14, 2016. doi:10.1145/2948062.
- [38] James R. Lee. Spectral hypergraph sparsification via chaining. In 55th Annual ACM Symposium on Theory of Computing (STOC), pages 207–218, 2023. doi:10.1145/3564246.3585165.
- [39] James R. Lee, Shayan Oveis Gharan, and Luca Trevisan. Multiway spectral partitioning and higher-order cheeger inequalities. Journal of the ACM, 61(6):1–30, 2014. doi:10.1145/2665063.
- [40] Yin Tat Lee and He Sun. An sdp-based algorithm for linear-sized spectral sparsification. In Hamed Hatami, Pierre McKenzie, and Valerie King, editors, 49th Annual ACM Symposium on Theory of Computing (STOC), pages 678–687. ACM, 2017. doi:10.1145/3055399.3055477.
- [41] Huan Li and Aaron Schild. Spectral subspace sparsification. In Mikkel Thorup, editor, 59th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 385–396. IEEE Computer Society, 2018. doi:10.1109/FOCS.2018.00044.
- [42] Aleksander Madry. Fast approximation algorithms for cut-based problems in undirected graphs. In 51st IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 245–254, 2010. doi:10.1109/FOCS.2010.30.
- [43] Michael Mitzenmacher and Eli Upfal. Probability and computing: Randomization and probabilistic techniques in algorithms and data analysis. Cambridge university press, 2017.
- [44] Kazusato Oko, Shinsaku Sakaue, and Shin-ichi Tanigawa. Nearly tight spectral sparsification of directed hypergraphs. In 50th International Colloquium on Automata, Languages and Programming (ICALP), pages 94:1–94:19, 2023. doi:10.4230/LIPIcs.ICALP.2023.94.
- [45] Richard Peng. Approximate undirected maximum flows in time. In 27th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1862–1867, 2016. doi:10.1137/1.9781611974331.CH130.
- [46] Richard Peng, He Sun, and Luca Zanetti. Partitioning well-clustered graphs: Spectral clustering works! SIAM Journal on Computing, 46(2):710–743, 2017. doi:10.1137/15m1047209.
- [47] Akbar Rafiey and Yuichi Yoshida. Sparsification of decomposable submodular functions. In 36th Conference on Artificial Intelligence (AAAI), pages 10336–10344. AAAI Press, 2022. doi:10.1609/AAAI.V36I9.21275.
- [48] Jonah Sherman. Nearly maximum flows in nearly linear time. In 54th IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 263–269, 2013. doi:10.1109/FOCS.2013.36.
- [49] Tasuku Soma, Kam Chuen Tung, and Yuichi Yoshida. Online algorithms for spectral hypergraph sparsification. In Jens Vygen and Jaroslaw Byrka, editors, 25th Conference on Integer Programming and Combinatorial Optimization (IPCO), volume 14679 of Lecture Notes in Computer Science, pages 405–417. Springer, 2024. doi:10.1007/978-3-031-59835-7_30.
- [50] Tasuku Soma and Yuichi Yoshida. Spectral sparsification of hypergraphs. In Timothy M. Chan, editor, 30th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2570–2581. SIAM, 2019. doi:10.1137/1.9781611975482.159.
- [51] Daniel A. Spielman and Nikhil Srivastava. Graph sparsification by effective resistances. In 40th Annual ACM Symposium on Theory of Computing (STOC), 2008. doi:10.1145/1374376.1374456.
- [52] Daniel A. Spielman and Shang-Hua Teng. Spectral sparsification of graphs. SIAM J. Comput., 40(4):981–1025, 2011. doi:10.1137/08074489X.
- [53] Daniel A. Spielman and Shang-Hua Teng. Nearly linear time algorithms for preconditioning and solving symmetric, diagonally dominant linear systems. SIAM J. Matrix Anal. Appl., 35(3):835–885, 2014. doi:10.1137/090771430.
- [54] Jan van den Brand, Yu Gao, Arun Jambulapati, Yin Tat Lee, Yang P. Liu, Richard Peng, and Aaron Sidford. Faster maxflow via improved dynamic spectral vertex sparsifiers. In 54th Annual ACM Symposium on Theory of Computing (STOC), pages 543–556, 2022. doi:10.1145/3519935.3520068.
- [55] Yibin Zhao. Fully dynamic spectral and cut sparsifiers for directed graphs. CoRR, 2025. doi:10.48550/arXiv.2507.19632.
- [56] Chunjiang Zhu, Qinqing Liu, and Jinbo Bi. Spectral vertex sparsifiers and pair-wise spanners over distributed graphs. In 38th International Conference on Machine Learning (ICML), volume 139, pages 12890–12900, 2021. URL: https://proceedings.mlr.press/v139/zhu21c.html.
- [57] Zeyuan Allen Zhu, Zhenyu Liao, and Lorenzo Orecchia. Spectral sparsification and regret minimization beyond matrix multiplicative updates. In Rocco A. Servedio and Ronitt Rubinfeld, editors, 47th Annual ACM Symposium on Theory of Computing (STOC), pages 237–245. ACM, 2015. doi:10.1145/2746539.2746610.
