Minimizing Recourse in an Adaptive Balls and Bins Game
Abstract
We consider a simple load-balancing game between an algorithm and an adaptive adversary. In a simplified version of this game, the adversary observes the assignment of jobs to machines and selects a machine to kill. The algorithm must then restart the jobs from the failed machine on other machines. The adversary repeats this process, observing the new assignment and eliminating another machine, and so on. The adversary aims to force the algorithm to perform many restarts, while we seek a robust algorithm that minimizes restarts regardless of the adversary’s strategy. This game was recently introduced by Bhattacharya et al. for designing a -spanner with low recourse against an adaptive adversary.
We prove that a simple algorithm, which assigns each job to a randomly chosen live bin, incurs recourse against an adaptive adversary. This enables us to construct a much simpler -spanner with a recourse that is smaller by a factor of compared to the previous construction, without increasing the update time or the size of the spanner.
This motivates a careful examination of the range of attacks an adaptive adversary can deploy against simple algorithms before resorting to more complex ones. As our case study demonstrates, this attack space may not be as large as it initially appears, enabling the development of robust algorithms that are both simpler and easier to analyze.
Keywords and phrases:
Adaptive adversary, load-balancing game, balls-and-bins, randomized algorithms, dynamic 3-spanner, dynamic graph algorithms, adversarial robustnessCategory:
Track A: Algorithms, Complexity and GamesFunding:
Adi Fine: This work was partially supported by the Israel Science Foundation grant no. 1156/23 and the Blavatnik Family Foundation.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Adversary models ; Theory of computation Sparsification and spanners ; Theory of computation Dynamic graph algorithmsEditors:
Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele PuppisSeries and Publisher:

1 Introduction
Real-world systems rarely operate in isolation – rather, they respond to sequences of updates that may themselves be influenced by prior feedback from the system itself. This phenomenon is particularly concerning in adversarial settings, where an adversary interacts with the system to select inputs adaptively in order to exploit its weaknesses, or force worst-case behavior.
This motivates us to analyze the worst case performance of algorithms that get their input via an interaction with an adaptive environment (or adversary). This adversary responds to prior outputs of the algorithm and may be malicious. Such an analysis may be needed for streaming and dynamic graph algorithms [11, 45, 57, 23, 28, 43, 56] and for online learning and machine unlearning models [42, 30, 33]. The importance of adaptivity has grown in recent years, particularly with the rise of feedback loops in machine learning and data analysis, since when the algorithm takes inputs that depend on its prior outputs we risk overfitting and biased results.
If the algorithm is deterministic, then analyzing it against an adaptive input is equivalent to analyzing it against an oblivious input (which means that the sequence of interactions with the algorithm is fixed ahead of time). The reason is that the adversary cannot gain any information about the algorithm that it did not have before it interacts with it (we assume that the algorithm is public). However, if the algorithm is randomized, then the adversary may reveal via feedback that the algorithm provides information about the algorithm’s random coins. Then it can use this information to cause the algorithm to perform poorly.
A major obstacle in tackling adaptivity is the lack of applicable analytical tools. Many classical probabilistic techniques, such as various concentration bounds require independence or martingale assumptions on the random variables, that often could not be guaranteed in an adaptive interaction. Furthermore, even the length and purpose of the sequence of random coins that the algorithm uses, depends on the actions of the adversary, and are not fixed before the interaction starts. All this often makes the analysis of the worst case against an adaptive adversary quite challenging.
The holy grail to circumvent all these difficulties is to find a deterministic algorithm (which cannot be fooled as we argued before). Indeed, this has been shown to be achievable for several problems of interest [52, 18, 19, 46, 16, 8]. However, there are many cases for which deterministic algorithms do not exist or remain elusive. Maybe the simplest example is the classical adaptive data analysis problem [34, 44]. Here we want to estimate the probability in the population of each predicate in a sequence of predicates chosen adaptively: The next predicate is chosen based on the estimations returned by the algorithm for the previous ones. The data available to us for this estimation task is a sample of the population, so the analysis is inherently randomized. The risk is that the adversary will be able to find predicates that overfit the sample (i.e. their frequency in the sample is very different than their frequency in the population). In this context, techniques have been developed to guarantee that such overfitting does not happen if we do not allow the adversary to estimate too many predicates [34, 6, 54, 50, 21].
Same problem exists in many streaming tasks such estimating the heavy hitters [26, 32] or estimating the second moment [2]. To perform these tasks without consuming too much space randomization must be used [49, 2]. Therefore, if the input sequence depends on intermediate estimates returned by the algorithm (such as occasional reports of the heavy hitters), then standard analysis collapse and we risk an adversary that exploits these estimates and finds a sequence on which the error of the algorithm is large. Recently, streaming algorithms have been developed to prevent the adversary from finding short sequences that fool the algorithm [11, 45, 57, 31, 3, 10, 1]. Similar examples from the field of dynamic algorithms include [29, 43, 56, 15]. In particular, the proactive sampling technique [15] was developed to construct dynamic cut sparsifiers that remain effective against an adaptive adversary. These special “protection” techniques against an adaptive adversary are often difficult to deploy and analyze, and they frequently incur large time and space overhead.
In these examples there is some input (sometimes even with probability over the randomness of the algorithm) on which the algorithm has large error, but the algorithm is designed such that the adversary needs a rather long interaction in order to find it. In contrast, there may be situations in which there is no strategy for the adversary, that can fool a simple algorithm that is provable good in an oblivious setting. Identifying such scenarios in which the adversary, despite its seemingly large control, is inherently powerless is important. In such situations, we may be safe using a simple algorithm rather than wasting time and space on “protection” mechanisms that are not needed.
Our results
(1) Load balancing Games.
We consider a family of simple games between an algorithm and an adversary that seems powerful. We prove that in fact this seemingly strong adversary has no way to fool the most natural algorithm. These games generalize load balancing games that were introduced by [20] in order to design a 3-spanner with small recourse against an adaptive adversary (more on spanner with small recourse below). In [20] they designed an algorithm based on a version of the proactive sampling technique for this load balancing game and thereby obtained an efficient 3-spanner algorithm against an adaptive adversary. Their algorithm proactively refreshes its random bits in order to hide them from the adversary and its analysis is somewhat challenging.
Our analysis shows that, in fact, a simple algorithm for this game cannot be fooled by an adaptive adversary. Specifically, we prove that the adversary has no winning strategy against this algorithm, so there is no reason for the algorithm to hide its randomness. A key lesson from our proof is that one should first carefully analyze the actual power of an adaptive adversary against simple strategies that succeed in the oblivious setting, before resorting to complex algorithms that may be unnecessary for protection against adaptive attacks or dangerous feedback loops.
A simplified version of this load balancing game is best described in the classical balls and bins framework. We have balls and bins. The adversary looks at our assignment (it sees exactly how many balls we have in each bin) and picks a bin to delete. We have to take the balls in this bin and redistribute them in the remaining bins. The game continues this way until one bin remains with all balls in it. The goal of the adversary is to maximize the sum of the numbers of balls in the deleted bins (at the moment when they are deleted). In other words, it wants to maximize the total number of balls that we redistribute. We also use the term recourse for this quantity, as it represents the total number of changes in the data structure. The goal is to find a simple algorithm for which the adaptive adversary cannot cause high recourse.
A simple strategy is to pick a new bin randomly among the remaining bins for each ball in the deleted bin. We prove that this scheme has recourse with high probability. Moreover, this bound is asymptotically tight, as no strategy can achieve better recourse: A deterministic greedy adversary that always deletes the bin with maximum load ensures that each deletion contributes at least the average load among the remaining bins, leading to recourse of at least .
Our proof technique is quite simple: using stochastic domination and a basic concentration bound for a sum of geometric random variables, we prove that the probability of failing against a fixed deletion ordering is so small that it remains small even after applying a union bound over all possible deletion orderings. We then generalize this proof to more complicated load balancing games, where each ball has a different probability distribution over the bins, and we use this distribution each time we redraw a bin for it. Additionally, we extend the proof to a setting in which the graph is actually a hypergraph, where a ball can be simultaneously in several bins. In this case, we need to redraw the bins when one of the bins containing the ball is eliminated.
We can imagine several natural applications for this game, such as managing a server farm. When a server goes down (for any reason), we need to redistribute and restart the jobs running on it among the remaining servers. These restarts are expensive, so we want to redistribute the jobs in a way that minimizes the number of restarts. This is especially important if a malicious, adaptive adversary is attacking our farm, causing servers to go down one by one.
(2) -spanner with small recourse.
Another application of our improved analysis of the load balancing game described above is the construction of a -spanner with better performance against an adaptive adversary.
Prior to the work of [20] the only known dynamic spanner algorithm against an adaptive adversary required amortized update time to maintain a -spanner of size and this only for . Only for large stretch of a construction with polylogarithmic update time was recently discovered [15]. This in contrast to the oblivious setting where we know how to maintain a -spanner of size for any in amortized update time (and slightly larger but polylogarithmic worst case update time). As noted by [20], even if we allow infinite time and only count recourse (which is the number of changes in the dynamic data structure per update), no data structure with sublinear recourse was known for small . So naturally [20] asked whether we can construct a spanner with small recourse for small value of . Beside being a prerequisite for small update time, recourse is an important metric in dynamic algorithms in general. It is particularly important in settings where modifying the solution is costly, even when computation itself is inexpensive [40, 39, 5, 41]. Furthermore, low recourse has historically been a stepping stone to achieve faster dynamic algorithms in fundamental problems such as Matching, Single source shortest path, Set cover and more [48, 47, 25, 9, 27, 41, 51, 17].
Bhattacharya et al. [20] answered their question positively and presented several constructions for spanners with low recourse against an adaptive adversary. For -spanner, their construction also had a small update time of simultaneously with polylogarithmic recourse. To achieve this, they used a rather involved algorithm that employs proactive sampling. Our analysis of the load balancing game described above allows us to obtain a simpler algorithm (with a simpler analysis) for the -spanner against an adaptive adversary, with improved performance. Specifically, our algorithm maintains a fully dynamic 3-spanner of size , with amortized recourse per operation with high probability and worst-case update time. This improves the recourse bound of [20] by a factor.
Additional games and related questions
For the load balancing game, one can consider other simple algorithms in which the balls are not distributed independently and randomly. For example, we can imagine situations where we want to redistribute the balls in bunches into a relatively small number of bins. This approach may be more communication-efficient in the server farm application described earlier. However, the dependencies introduced by such strategies between the balls make them even more challenging to analyze. We elaborate on this in Section 5.
There are even simpler scenarios where adaptivity is an issue and presents an analytical challenge. The analysis tools developed for these scenarios may be useful for analyzing more complicated games. In these simple scenarios, we aim to understand the worst-case behavior of a fixed strategy against a specific adaptive method of generating its input sequence. One classical example is Polya’s urm model [35, 53]. Another example is the Optimal Ball Recycling problem studied by Bender et al. [12]. In this game, an adversary picks a set of balls in a bin (or another well-defined subset of the balls) and redistributes them (the bin is not removed) according to a fixed probability distribution over the bins, which is the same for all balls. They studied the steady-state distribution of several adaptive strategies, such as redistributing the balls in the fullest bin, using techniques from the theory of Markov Decision Processes.
The structure of the paper is as follows: In section 2 we describe a simple version of our load balancing framework as a warm-up. This version already demonstrates the main ideas in our analysis. We generalize this framework in Section 3. In Section 4 we describe our improves spanner construction. We conclude in Section 5.
2 Balls and Bins, Deletion Against An Adaptive Adversary
In this game, we have bins and identical balls. Additionally, we assume that is a power of , i.e. for some integer .
Initially, the balls are distributed arbitrarily among the bins. Then, at each step, an adversary chooses one bin to delete. The chosen bin is removed, and all of its balls are re-thrown uniformly into the remaining bins. This process continues until only one bin remains.
We are interested in minimizing the value of a random variable which we call . This variable counts the total number of balls in the bins that the adversary deletes at the moments they are deleted. This is the same as the total number of balls that the algorithm re-throws. We prove the following theorem.
Theorem 1 (Main theorem).
We first assume that the adversary is oblivious and deletes bins in the order given by a permutation (that is first bin deleted is , then until ). To simplify the presentation we also assume, without loss of generality, that is the identity. That is we first delete bin , then , and the last bin deleted is .
Let be a random value equals to the total recourse of an oblivious adversary that deletes bins according to . We prove the following:
Theorem 2.
We focus on a single ball and the recourse it incurs during its movements.
Definition 3 (Phase).
A phase is a disjoint interval of consecutive bins deletions. For an integer , define
to be the first bin deleted in phase .
In particular, phase consists of the bins deleted from through Phase goes from bin to bin , phase goes from bin to bin , and so on.
For each phase , we define a random variable to measure the recourse of ball caused by the deletions occurring in phase . If ball never landed in any of phase ’s bins, . Otherwise, it equals the number of bins that ball visited during phase . We show that is essentially dominated by a geometric random variable. Intuitively this follows since the probability that a ball keeps re-landing in the same phase is at most each time.
Definition 4 (First-order stochastic dominance).
Let and be two random variables such that
Then has first-order stochastic dominance over , and it is denoted by .
Let be a geometric random variable with success probability .
Lemma 5.
, i.e. for all .
Proof.
Both and can only receive integer values, thus it is enough to prove the statement for integer values of .
Notice that , so the claim is trivially true for . Also, cannot exceed the total number of bins in phase , i.e. , so the lemma is also trivially true for .
We prove the bound for intermediate values of by induction on .
Base case ().
This holds trivially since .
Let be the event that, after re-throws in phase , the ball is still in a bin of this same phase.
Inductive step.
Assume the statement holds for , i.e. . Then:
The on the right-hand side of the second inequality follows because bins in phase account for less than half of the remaining bins. Thus, when the ball is re-thrown uniformly, it lands again in a phase-’s bin with probability at most . We conclude that so the lemma follows.
We need the following two technical theorems in order to bound the total recourse incurred by all balls for the deletion order and prove Theorem 2. The first says that the stochastic domination relation carries over for sums of random variables.
Theorem 6 ([55]).
Let be a sequence of independent random variables. Let be another sequence of independent random variables.
If for , then:
The second theorem is a concentration bound for the sum of geometric random variables.
Theorem 7 ([24]).
Let be a negative binomially distributed random variable which is the sum of i.i.d. geometrically distributed random variables, each with success probability . Then, for :
Proof of Theorem 2.
Observe that all variables are independent, the recourse of a single ball does not affect the recourse of other balls, and a ball’s recourse in one phase does not affect its recourse in another phase. Thus, we can apply Theorem 6 along with Lemma 5.
By Lemma 5, for each ball and phase , .
Let , the index of the final phase. Note that all phases, from phase to phase , include all bins except the last. Therefore, by Theorem 6:
Using Theorem 7 with to bound the sum of these geometric random variables, we get
so the theorem follows.
We now prove our main theorem:
Proof of Theorem 1.
We model a simultaneous game against all possible choices of the adaptive adversary using a rooted game tree . Each node in represents an assignment of the balls into the bins which have not yet been deleted. The root represents the initial assignment of the balls into bins. A node which has remaining bins (at depth of ) has children, each corresponds to a possible decision of the adversary (delete the first among remaining bins, the second, etc). Each edge from to a child is associated with sufficiently many random bits to redistribute the balls in the bin which the adversary deletes when it faces the configuration associated with . Each leaf corresponds to a configuration with a single bin containing all the balls. The tree has a total of distinct leaves at depth . The path from the root to a leaf corresponds to a permutation which represents a complete deletion order of the bins.
The probability space of this simultaneous game corresponds to union of the random bits on all the edges of . Once we flip all these bits then the simultaneous game is completely determined and in particular the recourse associated with each leaf (deletion ordering) is determined.
Theorem 2 bounds the probability that the recourse is high at a specific leaf. We use the union bound to bound the probability that the recourse is high in at least one leaf as follows
Clearly if the recourse is small in every leaf then the adversary cannot cause the algorithm to have an high recourse so the theorem follows.
3 Decremental Load Balancing Framework
We consider the following setting. We have a bipartite hyper-graph consisting of jobs on one side and machines on the other. The two sides are connected by hyper-edges, where each hyper-edge connects a single job to a nonempty subset of machines. We have to maintain a valid covering of the jobs, i.e. every job that connects to some hyper-edges must be covered by exactly one hyper-edge. The jobs are not identical; each job has its own probability distribution over the hyper-edges that contain it. Let be the probability that job is covered by hyper-edge out of all hyper-edges. Additionally, the adversary deletes machines during the updates.
Initially, each job is covered by an arbitrary hyper-edge connected to it. Then, at each step, the adversary chooses one machine to delete. The chosen machine is removed, and any hyper-edge that includes this machine is also removed. Our cover might not be valid now; If a job was covered by one of those hyper-edges that we delete, then we need to cover it by a different hyper-edge. If this job has remaining hyper-edges, we randomly select one of the remaining hyper-edges incident to it to cover it. We draw the new hyper-edge for according to the normalized probabilities of the remaining hyper-edges. Specifically, if is the set of hyper-edges still available for job , then the new probability that is covered by hyper-edge is:
This process continues until the adversary deletes machines in total.
Let be a random variable equals to the total recourse against an adaptive adversary in this setting (for a given bipartite hyper-graph that we do not explicitly indicate in our notation).
Let be the maximal degree of a machine. Let be the minimal non-zero (initial) probability of a hyper-edge, of any job, i.e. . (Here is the initial set of hyper-edges available for job .)
We prove the following theorem:
Theorem 8 (Main theorem).
If and the adversary deletes at most machines then
and each deletion is handled in worst-case time.
We first prove this bound in the simpler setting where each hyper-edge consists of exactly one machine, i.e. the hyper-graph is in fact a bipartite graph. This is the same balls-and-bins setting from the previous section, except that each ball (job) now has its own probability distribution over the bins (machines), instead of a uniform distribution. (Technically, the distribution is over the edges incident to each ball , but we associate the probability of each edge with bin and denote it . If there is no edge from to bin then we set .) In this simplified setting we still refer to jobs as “balls”, to machines as “bins”, and is the random variable that counts the total number of balls re-thrown from the bins deleted by the adversary. In the balls and bins setting, is equivalent to the maximal possible load of a single bin. We prove:
Theorem 9.
If and for at most deletions by an adaptive adversary:
and each deletion is handled in worst-case time.
As in the previous section we first assume that the adversary is oblivious and deletes the bins in the order determined by a permutation (that is ) until bins are deleted. For simplicity, we fix to be the identity so we first delete bin , then until bin . In practice, we bound the recourse against an adversary that follows until all bins are deleted, as if . This upper bound on the recourse trivially applies to the recourse of only deletions.
Let be a random variable for the total recourse against an oblivious adversary following . We prove the following:
Theorem 10.
For any , if , then:
As in the previous section we focus on a single ball and the recourse caused due to its movements. For , let be the total probability that ball assigns to bins through . If , we set . We have to define the phases more carefully as follows.
Definition 11 (Phases).
For ball , partition the sequence of bins into disjoint phases, each is an interval of consecutive bins. We define , the first bin of phase , and then phase consists of the bins in the interval . We set (the first bin), and then for , if and , let be the bin such that
We set . Notice that when and , we set , so the last interval consists only of bin .
Thus, each phase ends precisely when its bins exceed half of ’s remaining probability mass. The last phase for ball is the first index for which or .
Let be the number of bins in phase- with non-zero probability for ball .
We now upper bound the number of phases of ball .
Lemma 12.
Recall that is the number of phases for ball , and define . Then .
Proof.
Phases are consecutive and disjoint, so:
Repeatedly applying this halving argument shows that . Clearly so and .
We also need the following definitions. Let be a random variable counting the recourse ball incurs during phase . If ball never lands in any bin of phase , then . The following lemma upper bounds .
Lemma 13.
, i.e. for all .
Proof.
Let be a random variable that counts the number of bins that ball changed during phase , not including the last bin deleted in the phase, that is the bin at position . We call these bins the internal bins of phase . Since both and can only receive integer values, it is enough to prove the statement for integer values of . Since , the claim is trivial for . Also, the recourse of a single ball in a phase cannot be greater than the number of bins of that phase with non-zero probability, i.e. , so the claim is trivial for as well. We use induction on to show that for the remaining integer values of . From this the lemma follows, since and therefore . The induction is as follows.
Base case ().
This holds trivially since .
Let be the event that, after such re-throws, ball is still in a phase-’s bin.
Inductive step.
Assume it holds for , i.e. .
Thus, for :
Where the bound in the second inequality follows from the way we defined the phases. In particular the total probability (according to ) of the internal bins of a phase is at most half of the total probability of all remaining bins. Thus, when the ball is re-thrown according to the normalized probabilities, it lands in an internal bin of phase with probability at most .
We are now ready to focus on the total recourse of all balls for the deletion order , and prove Theorem 10:
Proof of Theorem 10.
Note that all variables are independent: the recourse of a single ball does not affect the recourse of other balls, and a ball’s recourse in one phase does not affect its recourse in another phase. Thus, we can use Theorem 6 and Lemma 13.
By Lemma 13, for every ball and every phase we have
Let . Therefore:
Where is the sum of i.i.d. geometrically distributed random variables.
By Lemma 12, . Since by our definitions and since we assume that , we can conclude that .
Let . Note that because , and .
Applying Theorem 7 for the sum of geometric random variables, using
Inequality (1) follows since for , Inequality (2) follows since , and Inequality (3) follows since . We now prove our main theorem, Theorem 9:
Proof of Theorem 9.
First, notice that when the adversary deletes bin , the update time of each ball in bin is , as the ball randomly selects a new bin (using standard binary search on the cumulative probabilities), or removed in the case that no bins that can reside it are left. Thus, the update time of each deletion is .
We now bound the recourse for exactly adaptive deletions, and the proof for less than deletions follows. Out of total bins, bins are deleted by the adversary. There are distinct ways to pick and order these bins. If any of these ordered deletions causes a high recourse then the recourse of any oblivious adversary that deletes all bins by any permutation that extends these deletions is high. Thus, it follows by the union bound and Theorem 10 with , that the probability that any of these orders produces recourse above is:
Finally, we adapt the argument from the uniform-bins case to show that an adaptive adversary cannot do better. We simulate all possible deletion paths in parallel, revealing the state of the bins to the adversary at each node of this decision tree. If there was a high-recourse path, it would appear among the oblivious orders and we bounded the probability that this happens. Hence, the theorem follows. Returning to the original hyper-edge setting: if a hyper-edge connects multiple machines, its effective “deletion time” in a fixed permutation is given by the first machine among ’s machines to be deleted. After that, the rest of ’s machines are irrelevant for itself, since is already removed. Thus, once the deletion order is fixed, each hyper-edge effectively acts like a single-machine edge in terms of determining when it disappears. Consequently, the hyper-edge setting can be reduced to a multi-probability-distribution “balls and bins” model presented above. Concretely, let be the set of hyper-edges that connect job to machine , and for which is the first machine to be deleted among these hyper-edges. Then, for ball (job) and bin (machine) , the equivalent probability is given by .
All arguments carry through essentially unchanged, leading to
with high probability. This completes the proof of Theorem 8.
4 Fully Dynamic 3-Spanner Against Adaptive Adversary
For completeness before we start, we repeat the definition of spanner of a graph : This is a subgraph of on the same set of vertices as such that the distance between any pair of vertices in is larger than in by a factor of at most . For more information about spanners see e.g. [4, 36, 7, 22, 37, 14, 13].
In this section we apply our decremental load balancing framework to maintain a -spanner against an adaptive adversary which performs insertions and deletions of edges to the graph. We prove the following theorem:
Theorem 14.
There is a randomized algorithm that, given an unweighted graph with vertices and edges undergoing edge insertions and deletions by an adaptive adversary, maintains a 3-spanner of . This spanner has edges and is maintained with worst-case update time. Furthermore, the algorithm achieves amortized recourse with high probability.
4.1 Algorithm Description
Static Construction
We begin with a static 3-spanner construction for . Let be the set of neighbors of vertex . Partition arbitrarily into equal-sized buckets , each of size . We construct three edge sets as follows:
-
Set : For each bucket , , and every vertex such that , choose an arbitrary neighbor and add to . We call the -partner of .
-
Set : For each edge where (i.e. both in the same bucket), add to .
-
Set : For any pair of vertices that share at least one neighbor, pick an arbitrary common neighbor and add the edges and to . We refer to as the witness for .
Claim 15.
The subgraph is a 3-spanner of with edges.
Proof.
We show that every edge has a path of length at most 3 in . If and are in the same bucket, then , so the claim is immediate.
Otherwise, suppose , . If because is the -partner of (or vice versa), then we are done. Otherwise, there must be another vertex serving as the -partner of , i.e. , and share the neighbor . Hence there is a witness with edges , giving a path of length 3 between and .
Next, we bound and . Each vertex has at most one partner per bucket, so . Each bucket has at most internal edges, with buckets, giving . In each bucket, there are at most vertex pairs, each contributing up to 2 edges in , so . Altogether, .
Dynamic Maintenance
Our approach is based on the static algorithm of [38] with the modifications by [20], adapted to handle edge insertions and deletions in . We maintain and separately as the adversary add or remove edges from . To handle updates efficiently we maintain for each vertex a data structure called neighbors-dictionary, that groups the neighbors of to sets, one set for each bucket. When an edge is added or deleted, where and , we only need to update the dictionary entries for and . Specifically, we add or remove from the set of neighbors of in bucket and do the same for in bucket of . Since these operations involve simple insertions or deletions in a dictionary111We represent these dictionaries as search trees. This would work also in a computational model that does not allow dynamic hashing data structures. If we do allow them then it can take time, they run in worst-case time.
Maintaining and
When the adversary deletes an edge , we find a new (arbitrary) -partner for (if one exists) using the neighbors-dictionary of and add it to . If an edge with is inserted and does not have an -partner, we set and add to .
The maintenance of is straightforward. These operations takes time.
Maintaining : Deletions vs. Insertions
To handle in a fully dynamic setting, we partition the sequence of updates into epochs, each containing updates. Let be the edges newly added during an epoch. It suffices to maintain a 3-spanner that only handles deletions in throughout the epoch. Since remains a 3-spanner of (This follows from the decomposability property of spanners, namely that the union of two spanners of sub-graphs is itself a spanner of the union of those sub-graphs). We maintain since we may need to delete edges from it (if we delete an edge which was inserted in the same epoch). The list is of size so the union has at most edges which are not in , preserving our desired size. Hence, we only need to address deletions of edges within each epoch and to describe how we initialize an epoch to reflect newly inserted edges in the previous epoch.
Deletions in
When is deleted and the pair still share a neighbor, we must pick a new witness for the pair . We use the decremental load balancing framework to do so. Specifically, we form a bipartite hyper-graph, denoted by , representing pairs which are in the same bucket and their common neighbors:
-
For each pair in the same bucket, create a job on one side of . Because each bucket has vertices and there are buckets, we have jobs in total.
-
For each edge , create a machine on the other side of , yielding machines.
-
A hyper-edge connects to and if (of the same bucket) share a neighbor via the edges and .
A valid covering of the jobs by hyper-edges corresponds exactly to a valid set of witness edges in . Each pair with a common neighbor is covered by a hyper-edge that corresponds to a witness. Thus, we maintain a feasible cover of all jobs under machine (edge) deletions. Specifically, for each job , let be the hyper-edges incident to it, and define
After each deletion of a machine (edge), we remove all hyper-edges that are incident to the deleted machine. Then, we draw new edges for each job that lost its covering hyperedge but still has hyperedges incident to it. As in the decremental load balancing framework, we draw an edge according to the normalized probability distribution of this job (which is uniform on its remaining hyperedges). The job cover at any one time defines our set of witnesses and thereby the edges in .
We analyze the recourse incurred by adversarial deletions within a single epoch using Theorem 8. Since each job has less than hyper-edges, one hyper-edge for each common neighbor, we have , meeting the conditions of Theorem 8. The adversary deletes at most machines during an epoch, so we can use Theorem 8 with . Let be the total recourse incurred in a single epoch against an adaptive adversary. By Theorem 8, we have:
Hence, with high probability, the amortized recourse per epoch is .
In order to bound the update time we need the following lemma:
Lemma 16.
Let be the maximum degree of a machine in . Then .
Proof of Lemma 16.
Each machine corresponds to an edge , where and (possibly ). The machine can appear in hyper-edges that connects to jobs of the form for or for . Since each bucket contains at most vertices, the number of jobs associated with a machine is at most . Thus, . So, by Theorem 8 and Lemma 16, the worst-case update time for maintaining is .
Notice that the hyper-graph has a size of , which aligns with the size of the Partnership Data Structures from [20].
Epoch Initialization
To complete the description of the data structure we need to describe how to initialize an epoch. We need to start each epoch with a hyper-graph and a job cover that accurately represents the current state of , and take into account all edges inserted in the previous epoch which we collected in a separate list. Specifically, we have to update the hyper-graph’s machines and hyper-edges to incorporate newly added edges to from the previous epoch. In addition, we may have to add hyper-edges to the cover such that it remains valid (this corresponds to updating the set of witness and and their incident edges in to be a valid one).
We first describe the update process for a single edge (inserted in the previous epoch):
-
1.
Machine Creation. We add a machine for each new edge.
-
2.
Hyper-edge Updates. We add hyper-edges to represent new common neighbors: Let be the newly created machine for the edge where and . We identify these new hyperedges by traversing ’s neighbors from bucket and ’s neighbors from bucket . When we add an edge incident to a job that currently has not hyperedge in the cover we add the edge to the cover as well. Since each bucket has vertices, then the update time is . During the entire reintialization (processing all inserted edges) we add to the cover at most edges which we can charge to the update operations during the epoch, thus maintaining the recourse bound of with high probability. Notice that when we delete an edge which was inserted in the same epoch we have to find it in the list of inserted edges, , and delete it from this list. This would take time if we represent this list as a search tree.
Amortize Initialization to Worst-Case
Notice that performing all the insertions of the previous epoch at the beginning of the new epoch leads to amortized update time. Instead, we can execute these updates “in the background” and get good worst case update time. For this we utilize two copies of the hyper-graph. The first copy represents the state of at the beginning of the epoch, and is used for the decremental maintenance of during the epoch using the simple load balancing algorithm. The second copy initially does not include the edges inserted (and not deleted) in previous epoch. During the current epoch it is updated by the deletions and insertions that the adversary does, and in addition we add the edges inserted in the previous epoch, a constant number of such insertions per update of the current epoch. At the beginning of the next epoch, the second copy represents the state of , so both copies switch roles. Overall, with this incremental rebuilding each update takes worst-case time.
This completes the proof of Theorem 14.
5 Concluding remarks
Our results provide a new perspective on adaptivity in dynamic algorithms: sometimes, complex schemes to hide randomness from the adversary may not be necessary if we can show that the adversary is not as powerful as it appears. We demonstrated this within the load-balancing framework and applied it to obtain a simple construction of a -spanner against an adaptive adversary.
As we suggested in the introduction, there are several other simple algorithms one might consider for the load-balancing game. We suspect that some of these algorithms share similar properties with the one we analyzed. However, their analysis appears more challenging due to additional dependencies and may require developing new general tools. For example, one might consider an algorithm that partitions the balls in the deleted bin into two equal-sized groups and assigns each group to a randomly chosen bin.222It is easy to see that moving all balls together to a single random bin can incur quadratic recourse. What is the recourse of this scheme? Of course one can also split into groups for some fixed . For larger we use more randomness so it may be easier to analyze. Additionally, we can consider games in which bins are not deleted but remain in the system, or schemes where the adversary forces us to redistribute only a subset of the balls in the targeted bin. Analyzing any of these simple games may provide insights and fundamental tools for handling adaptive inputs.
Bounding the worst-case recourse also remains an open challenge. Furthermore, extending this approach to maintain a general -spanner in dynamic and adaptive settings presents another intriguing direction for future research.
References
- [1] Miklós Ajtai, Vladimir Braverman, T. S. Jayram, Sandeep Silwal, Alec Sun, David P. Woodruff, and Samson Zhou. The white-box adversarial data stream model. In PODS, pages 15–27. ACM, 2022. doi:10.1145/3517804.3526228.
- [2] N. Alon, Y. Matias, and M. Szegedy. The space complexity of approximating the frequency moments. Journal of Computer and System Sciences, 58:137–147, 1999. doi:10.1006/JCSS.1997.1545.
- [3] Idan Attias, Edith Cohen, Moshe Shechner, and Uri Stemmer. A framework for adversarial streaming via differential privacy and difference estimators. In ITCS, volume 251 of LIPIcs, pages 8:1–8:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPICS.ITCS.2023.8.
- [4] Giorgio Ausiello, Paolo Giulio Franciosa, and Giuseppe F. Italiano. Small stretch spanners on dynamic graphs. J. Graph Algorithms Appl., 10(2):365–385, 2006. Announced at ESA’05. doi:10.7155/JGAA.00133.
- [5] Chen Avin, Marcin Bienkowski, Andreas Loukas, Maciej Pacut, and Stefan Schmid. Dynamic balanced graph partitioning. SODA, 34(3):1791–1812, 2020. doi:10.1137/17M1158513.
- [6] Raef Bassily, Kobbi Nissim, Adam D. Smith, Thomas Steinke, Uri Stemmer, and Jonathan R. Ullman. Algorithmic stability for adaptive data analysis. In STOC, pages 1046–1059. ACM, 2016. doi:10.1145/2897518.2897566.
- [7] Surender Baswana, Sumeet Khurana, and Soumojit Sarkar. Fully dynamic randomized algorithms for graph spanners. ACM Trans. Algorithms, 8(4):35:1–35:51, 2012. Announced at SODA’08. doi:10.1145/2344422.2344425.
- [8] MohammadHossein Bateni, Hossein Esfandiari, Hendrik Fichtenberger, Monika Henzinger, Rajesh Jayaram, Vahab Mirrokni, and Andreas Wiese. Optimal fully dynamic k-center clustering for adaptive and oblivious adversaries. In SODA, pages 2677–2727. SIAM, 2023. doi:10.1137/1.9781611977554.CH101.
- [9] Soheil Behnezhad, Mahsa Derakhshan, MohammadTaghi Hajiaghayi, Cliff Stein, and Madhu Sudan. Fully dynamic maximal independent set with polylogarithmic update time. In FOCS, pages 382–405, 2019. doi:10.1109/FOCS.2019.00032.
- [10] Omri Ben-Eliezer, Talya Eden, and Krzysztof Onak. Adversarially robust streaming via dense-sparse trade-offs. In SOSA, pages 214–227. SIAM, 2022. doi:10.1137/1.9781611977066.15.
- [11] Omri Ben-Eliezer, Rajesh Jayaram, David P Woodruff, and Eylon Yogev. A framework for adversarially robust streaming algorithms. In PODS, pages 63–80, 2020. doi:10.1145/3375395.3387658.
- [12] Michael A. Bender, Jake Christensen, Alex Conway, Martin Farach-Colton, Rob Johnson, and Meng-Tsung Tsai. Optimal ball recycling. In SODA, pages 2527–2546. SIAM, 2018.
- [13] 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. arXiv preprint arXiv:2004.08432, 2020. arXiv:2004.08432.
- [14] Aaron Bernstein, Sebastian Forster, and Monika Henzinger. A deamortization approach for dynamic spanner and dynamic maximal matching. In SODA, pages 1899–1918, 2019. doi:10.1137/1.9781611975482.115.
- [15] 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 ICALP, pages 20:1–20:20, 2022. doi:10.4230/LIPICS.ICALP.2022.20.
- [16] Sayan Bhattacharya, Deeparnab Chakrabarty, and Monika Henzinger. Deterministic dynamic matching in O(1) update time. Algorithmica, 82(4):1057–1080, 2020. doi:10.1007/S00453-019-00630-4.
- [17] Sayan Bhattacharya, Fabrizio Grandoni, and David Wajc. Online edge coloring algorithms via the nibble method. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2830–2842. SIAM, 2021. doi:10.1137/1.9781611976465.168.
- [18] Sayan Bhattacharya, Monika Henzinger, and Giuseppe F. Italiano. Deterministic fully dynamic data structures for vertex cover and matching. In SODA, pages 785–804. SIAM, 2015. doi:10.1137/1.9781611973730.54.
- [19] Sayan Bhattacharya, Monika Henzinger, and Danupon Nanongkai. New deterministic approximation algorithms for fully dynamic matching. In STOC, pages 398–411. ACM, 2016. doi:10.1145/2897518.2897568.
- [20] Sayan Bhattacharya, Thatchaphol Saranurak, and Pattara Sukprasert. Simple dynamic spanners with near-optimal recourse against an adaptive adversary. In ESA, volume 244 of LIPIcs, pages 17:1–17:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ESA.2022.17.
- [21] Guy Blanc. Subsampling suffices for adaptive data analysis. In STOC, pages 999–1012. ACM, 2023. doi:10.1145/3564246.3585226.
- [22] Greg Bodwin and Sebastian Krinninger. Fully dynamic spanners with worst-case update time. In ESA, pages 17:1–17:18, 2016. doi:10.4230/LIPIcs.ESA.2016.17.
- [23] Vladimir Braverman, Avinatan Hassidim, Yossi Matias, Mariano Schain, Sandeep Silwal, and Samson Zhou. Adversarial robustness of streaming algorithms through importance sampling. In NeurIPS, NIPS ’21. Curran Associates Inc., 2021.
- [24] Daniel G. Brown. How I wasted too long finding a concentration inequality for sums of geometric variables. URL: https://cs.uwaterloo.ca/˜browndg/negbin.pdf.
- [25] Keren Censor-Hillel, Elad Haramaty, and Zohar S. Karnin. Optimal dynamic distributed MIS. In Proceedings of the 2016 ACM Symposium on Principles of Distributed Computing, PODC 2016, Chicago, IL, USA, July 25-28, 2016, pages 217–226, 2016. doi:10.1145/2933057.2933083.
- [26] Moses Charikar, Kevin Chen, and Martin Farach-Colton. Finding frequent items in data streams. Theoretical Computer Science, 312(1):3–15, 2004. Automata, Languages and Programming. doi:10.1016/S0304-3975(03)00400-6.
- [27] Shiri Chechik and Tianyi Zhang. Fully dynamic maximal independent set in expected poly-log update time. In FOCS, pages 370–381, 2019. doi:10.1109/FOCS.2019.00031.
- [28] Yeshwanth Cherapanamjeri and Jelani Nelson. On adaptive distance estimation. In NeurIPS, volume 33, pages 11178–11190. Curran Associates, Inc., 2020.
- [29] Julia Chuzhoy and Sanjeev Khanna. A new algorithm for decremental single-source shortest paths with applications to vertex-capacitated flow and cut problems. In SODA, pages 389–400, 2019. doi:10.1145/3313276.3316320.
- [30] Edith Cohen, Xin Lyu, Jelani Nelson, Tamas Sarlos, Moshe Shechner, and Uri Stemmer. On the robustness of CountSketch to adaptive inputs. In ICML, volume 162, pages 4112–4140. PMLR, 2022. URL: https://proceedings.mlr.press/v162/cohen22a.html.
- [31] Edith Cohen, Xin Lyu, Jelani Nelson, Tamás Sarlós, Moshe Shechner, and Uri Stemmer. On the robustness of countsketch to adaptive inputs. In ICML, volume 162 of Proceedings of Machine Learning Research, pages 4112–4140. PMLR, 2022. URL: https://proceedings.mlr.press/v162/cohen22a.html.
- [32] Graham Cormode and S. Muthukrishnan. An improved data stream summary: the count-min sketch and its applications. Journal of Algorithms, 55(1):58–75, 2005. doi:10.1016/j.jalgor.2003.12.001.
- [33] Jimmy Z. Di, Jack Douglas, Jayadev Acharya, Gautam Kamath, and Ayush Sekhari. Hidden poison: Machine unlearning enables camouflaged poisoning attacks. In NeurIPS ML Safety Workshop, 2022. URL: https://openreview.net/forum?id=zml9gDnulI9.
- [34] Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Aaron Roth. Generalization in adaptive data analysis and holdout reuse. In NIPS, pages 2350–2358, 2015. URL: https://proceedings.neurips.cc/paper/2015/hash/bad5f33780c42f2588878a9d07405083-Abstract.html.
- [35] Florian Eggenberger and George Pólya. Über die statistik verketteter vorgänge. ZAMM, 3(4):279–289, 1923.
- [36] Michael Elkin. Streaming and fully dynamic centralized algorithms for constructing and maintaining sparse spanners. ACM Trans. Algorithms, 7(2):20:1–20:17, 2011. Announced at ICALP’07. doi:10.1145/1921659.1921666.
- [37] Sebastian Forster and Gramoz Goranci. Dynamic low-stretch trees via dynamic low-diameter decompositions. In STOC, pages 377–388. ACM, 2019. doi:10.1145/3313276.3316381.
- [38] Ofer Grossman and Merav Parter. Improved deterministic distributed construction of spanners. In DISC, volume 91 of LIPIcs, pages 24:1–24:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPIcs.DISC.2017.24.
- [39] Anupam Gupta and Amit Kumar. Online steiner tree with deletions. In SODA, pages 455–467. SIAM, 2014. doi:10.1137/1.9781611973402.34.
- [40] Anupam Gupta, Amit Kumar, and Cliff Stein. Maintaining assignments online: Matching, scheduling, and flows. In SODA, pages 468–479. SIAM, 2014. doi:10.1137/1.9781611973402.35.
- [41] Anupam Gupta and Roie Levin. Fully-dynamic submodular cover with bounded recourse. In FOCS, pages 1147–1157. IEEE, 2020. doi:10.1109/FOCS46700.2020.00110.
- [42] Varun Gupta, Christopher Jung, Seth Neel, Aaron Roth, Saeed Sharifi-Malvajerdi, and Chris Waites. Adaptive machine unlearning. In NeurIPS, volume 34. Curran Associates, Inc., 2021.
- [43] Maximilian Probst Gutenberg and Christian Wulff-Nilsen. Decremental sssp in weighted digraphs: Faster and against an adaptive adversary. In SODA, pages 2542–2561. SIAM, 2020. doi:10.1137/1.9781611975994.155.
- [44] Moritz Hardt and Jonathan R. Ullman. Preventing false discovery in interactive data analysis is hard. In FOCS, pages 454–463. IEEE Computer Society, 2014. doi:10.1109/FOCS.2014.55.
- [45] Avinatan Hasidim, Haim Kaplan, Yishay Mansour, Yossi Matias, and Uri Stemmer. Adversarially robust streaming algorithms via differential privacy. NeurIPS, 33, 2020.
- [46] Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. A deterministic almost-tight distributed algorithm for approximating single-source shortest paths. In STOC, pages 489–498. ACM, 2016. doi:10.1145/2897518.2897638.
- [47] Jacob Holm and Eva Rotenberg. Fully-dynamic planarity testing in polylogarithmic time. In STOC, pages 167–180. ACM, 2020. doi:10.1145/3357713.3384249.
- [48] Jacob Holm and Eva Rotenberg. Worst-case polylog incremental SPQR-trees: Embeddings, planarity, and triconnectivity. In Proceedings of the 2020 ACM-SIAM, SODA, pages 2378–2397, 2020. doi:10.1137/1.9781611975994.146.
- [49] Piotr Indyk and David Woodruff. Optimal approximations of the frequency moments of data streams. In STOC, pages 202–208. Association for Computing Machinery, 2005. doi:10.1145/1060590.1060621.
- [50] Christopher Jung, Katrina Ligett, Seth Neel, Aaron Roth, Saeed Sharifi-Malvajerdi, and Moshe Shenfeld. A new analysis of differential privacy’s generalization guarantees. In ITCS, volume 151 of LIPIcs, pages 31:1–31:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPICS.ITCS.2020.31.
- [51] Alison Hsiang-Hsuan Liu and Jonathan Toole-Charignon. The power of amortized recourse for online graph problems. In Approximation and Online Algorithms, pages 134–153. Springer International Publishing, 2022. doi:10.1007/978-3-031-18367-6_7.
- [52] Jelani Nelson, Huy L. Nguyên, and David P. Woodruff. On deterministic sketching and streaming for sparse recovery and norm estimation. In APPROX-RANDOM, volume 7408 of Lecture Notes in Computer Science, pages 627–638. Springer, 2012. doi:10.1007/978-3-642-32512-0_53.
- [53] George Pólya. Sur quelques points de la théorie des probabilités. In Annales de l’institut Henri Poincaré, volume 1, pages 117–161, 1930.
- [54] Ryan M. Rogers, Aaron Roth, Adam D. Smith, and Om Thakkar. Max-information, differential privacy, and post-selection hypothesis testing. In FOCS, pages 487–494. IEEE Computer Society, 2016. doi:10.1109/FOCS.2016.59.
- [55] Y. L. Tong. Stochastic orders and their applications (Moshe Shaked and J. George Shanthikumar). SIAM Review, 37(3):477–479, 1995. doi:10.1137/1037117.
- [56] David Wajc. Rounding dynamic matchings against an adaptive adversary. In STOC, pages 194–207. Association for Computing Machinery, 2020. doi:10.1145/3357713.3384258.
- [57] David P. Woodruff and Samson Zhou. Tight bounds for adversarially robust streams and sliding windows via difference estimators. In FOCS, pages 1183–1196. IEEE Computer Society, 2022. doi:10.1109/FOCS52979.2021.00116.