1 Introduction
1.1 Background
Graph coloring is one of the most fundamental and well studied problems in computer science, having found countless applications over the years, ranging from scheduling and computational vision to biology and chemistry. A
proper coloring of a graph , for a positive integer , assigns a color in to every vertex, so that no two adjacent vertices are assigned the same color. The chromatic number of the graph is the smallest integer for which a proper coloring exists. (We shall write “coloring” as a shortcut for “proper coloring”, unless otherwise specified.)This paper studies the problem of graph coloring in fully dynamic graphs subject to edge updates. A dynamic graph is a graph sequence on a fixed vertex set , where the initial graph is and each graph is obtained from the previous graph in the sequence by either adding or deleting a single edge. We investigate general graphs as well as uniformly sparse graphs. The “uniform density” of the graph is captured by its arboricity: a graph has arboricity if , where . That is, the arboricity is close to the maximum density over all induced subgraphs of . The class of constant arboricity graphs, which contains planar graphs, bounded treewidth graphs, and in general all minorfree graphs, as well as some classes of “realworld” graphs, has been subject to extensive research in the dynamic algorithms literature [15, 16, 63, 70, 59, 60, 52, 35, 22]. A dynamic graph of arboricity is a dynamic graph such that all graphs have arboricity bounded by .
It is NPhard to approximate the chromatic number of an vertex graph to within a factor of for any constant , let alone to compute the corresponding coloring [74, 46]. Consequently, there is no hope to achieve any meaningful computational results for general graphs in the dynamic setting. It is perhaps for that reason that the literature on dynamic graph coloring is sparse (see Section 1.1.1). Nevertheless, as discussed next, one may view the area of dynamic graph algorithms as lying within the wider area of local algorithms, in which there has been tremendous success in the context of graph coloring.
When dealing with networks of large scale, it is important to devise algorithms that are intrinsically local. Roughly speaking, a local algorithm restricts its execution to a small part of the network, yet is still able to solve a global task over the entire network. There is a long line of work on local algorithms for graph coloring and related problems from various perspectives. For example, seminal papers on distributed graph coloring [26, 36, 53, 6, 54, 55] laid the foundation for the area of symmetry breaking problems, which remains the subject of ongoing intensive research. Refer to the book of Barenboim and Elkin [10] for a detailed account on this topic. Additionally, graph coloring is wellstudied in the areas of property testing [37, 27] and local computation algorithms [65, 34].
1.1.1 Dynamic graph coloring
In light of the computational intractability of graph coloring, previous work on dynamic graph coloring is devoted mostly to heuristics and experimental results
[56, 64, 73, 42, 41, 61, 66]. From the theoretical standpoint, it is natural to consider the combinatorial aspects of dynamic coloring or to study restricted families of graphs; to the best of our knowledge, the only work on this pioneering front is that of Barba et al. from WADS’17 [8] and Bhattacharya et al. from SODA’18 [17]. Additionally, Parter, Peleg, and Solomon [62] studied this problem in the dynamic distributed setting, and Barenboim and Maimon [11] studied the related problem of dynamic edge coloring. (Our work focuses on amortized time bounds; we henceforth do not distinguish between amortized and worstcase time bounds, unless explicitly specified.)Barba et al. [8] studied the combinatorial aspects of dynamic coloring in general graphs. They assumed that at all times the graph can be colored and further assumed blackbox access to a static algorithm for coloring any subgraph of the current graph. They investigated the tradeoff between the number of colors and the number of recolorings (i.e., the number of vertices that change their color) per update step. The number of recolorings is an example of a recourse bound, which counts the number of changes to the maintained graph structure done following a single update step. This measure has been well studied in the areas of dynamic and online algorithms for various fundamental problems, such as maximal matching, MIS, approximate matching, approximate vertex and set cover, network flow and job scheduling; see [38, 25, 19, 20, 21, 13, 40, 7, 5, 23, 39, 67, 14] and the references therein. In some applications such as job scheduling and web hosting, a change to the underlying structure may be costly. A low recourse bound is particularly important when the dynamic algorithm is used as a blackbox subroutine inside a larger data structure or algorithm [16, 2].
Barba et al. devised two complementary algorithms: for any , the first (respectively, second) maintains an (resp., )coloring while recoloring (resp., ) vertices per update step. While these tradeoffs coincide at , each providing coloring with recolorings per update, any slight improvement on one of these parameters triggers a significant blowup to the other. In particular, the extreme point on the first and second tradeoff curves yields a polynomial number of colors and recolorings, respectively. Barba et al. [8] also showed that the second tradeoff exhibits the right behavior, at least for : Any algorithm that maintains a coloring of an vertex dynamic forest must recolor vertices per update, for any constant . The following question was left open.
Question 1.1.
Does the first tradeoff of [8] exhibit the right behavior, and in particular, does a constant number of recolorings require a polynomial number of colors?
Bhattacharya et al. [17] studied the problem of dynamically coloring bounded degree graphs. For graphs of maximum degree they presented a randomized (respectively deterministic) algorithm for maintaining a (resp., coloring with amortized expected (resp., ) update time. These results provide meaningful bounds only when all vertices have bounded degree. The following question naturally arises.
Question 1.2.
Can we get meaningful results for the more general class of bounded arboricity graphs?
Question 1.2 is especially intriguging because, as shown in [8], dynamic forests (which have arboricity 1) appear to provide a hard instance for dynamic graph coloring.
Parter, Peleg, and Solomon [62] studied Question 1.2 in dynamic distributed networks: They showed that for graphs of arboricity an coloring can be maintained with update time. The update time in this context, however, bounds the number of communication rounds per update, while the number of recolorings done (and number of messages sent) per update is polynomial in , even for forests.
1.2 Our results
We use notation throughout to suppress factors.
1.2.1 General graphs
The following theorem summarizes our main result for general graphs.
Theorem 1.3.
For any vertex dynamic graph that can be colored at all times, there is a fully dynamic deterministic algorithm for maintaining an coloring with (amortized) recolorings per update step, for any . Using randomization (against an oblivious adversary), the number of colors can be reduced by a factor of while achieving an expected bound of recolorings.
Theorem 1.3 with yields recolorings with colors, thus answering Question 1.1 in the negative. Not only is this result an exponential improvement over the previous bound of [8], but it also unveils a rather surprising phenomenon: The tradeoff between the number of colors and recolorings is highly nonsymmetric.
We also note that the number of recolorings can be deamortized.
A running time bound.
Assuming blackbox access to two efficient coloring algorithms
we can bound the running time of the algorithm from Theorem 1.3.
Blackbox static algorithm. Let be a static algorithm that takes as input a graph from a graph class and a subset of vertices in , and computes the induced graph and a coloring of in time .
Blackbox dynamic algorithm.
Let be a fully dynamic algorithm that colors graphs of maximum degree using colors. Such algorithms exist: there is a randomized algorithm with expected amortized update time and a deterministic algorithm with amortized update time [17]. Let be the running time of an optimal deterministic algorithm for this problem. We state our results in terms of to emphasize that any improvement over the deterministic algorithm of [17] would yield an improvement to the running time of our algorithm.
Theorem 1.4.
Remark. The randomized blackbox dynamic algorithm of [17] that we apply in Theorem 1.4 is actually a simple observation (referred to as a “warmup result” in [17]) which gives a coloring with expected update time. The main result of [17], however, is an algorithm to bound the number of colors by only (or slightly more).
1.2.2 Uniformly sparse graphs
We answer Question 1.2 in the positive by showing that by applying the algorithms from Theorem 1.4 to arboricity graphs we can obtain a bound on the update time rather than only the number of recolorings.
Theorem 1.5.
There is a fully dynamic deterministic algorithm for graphs of arboricity that maintains an coloring in amortized time per update for any . Using randomization (against an oblivious adversary), the number of colors can be reduced by a factor of and the expected amortized update time becomes .
Furthermore, we improve over this result when by designing an algorithm that specifically exploits the structure of arboricity graphs.
Theorem 1.6.
There is a fully dynamic deterministic algorithm for graphs of arboricity that maintains an coloring in amortized time.
The proof of Theorem 1.6 relies on a new layered data structure (LDS) for bounded arboricity graphs that we expect will be more widely applicable.
Definition 1.1.
Given a dynamic graph of arboricity , a layered data structure (LDS) with parameters and is a partition of the vertices into layers so that all vertices have at most neighbors in layers equal to or higher than the layer containing .
Theorem 1.7.
Let be an algorithm for arboricity graphs that maintains an orientation of the edges with outdegree at most that performs amortized flips per update. Then there is an algorithm to maintain an LDS for a fully dynamic graph of arboricity with and in amortized deterministic time .
1.3 Technical overview
1.3.1 Low outdegree dynamic edge orientations
All of our results are, in different ways, intimately related to the dynamic edge orientation problem for arboricity graphs, where the goal is to dynamically maintain a low outdegree orientation of the edges in a graph (an orientation with outdegree always exists [58]). Our algorithm for general graphs (outlined in Section 1.3.2) is inspired by an algorithm for the dynamic edge orientation problem. Our algorithm for bounded arboricity graphs from Theorem 1.5 uses a dynamic edge orientation algorithm as a blackbox. Our algorithm for bounded arboricity graphs from Theorem 1.6 uses a dynamic edge orientation to define a potential function useful in the running time analysis (outlined in Section 3.1).
Brodal and Fagerberg [22] initiated the study of the dynamic edge orientation problem and gave an algorithm that maintains an outdegree orientation in amortized time. To analyze this algorithm, they reduced the “online” setting, where we have no knowledge of the future, to the “offline” settings, where we know the entire sequence of edge updates in advance. Thus, in the the subsequent results, it sufficed to consider only the offline setting. Kowalik [49] used an elegant argument to derive a result complementary to [22]: one can maintain an outdegree orientation in amortized time. He, Tang, and Zeh [43] completed the picture with a tradeoff bound: for all , one can maintain an outdegree orientation in amortized time. The worstcase update time of this problem has also been studied by Kopelowitz et al. [47] and Berglin and Brodal [12].
1.3.2 Overview of algorithm for general graphs
We apply two blackbox coloring algorithms defined in Section 1.2.1, one static and one dynamic. For each vetex , if it is assigned color by the static algorithm and color by the dynamic algorithm, its true color is defined by the pair .
Periodically, we run the static algorithm using a carefully chosen subset of vertices as input. To select these subsets, we keep track of the recent degree of each vertex : the number of edges incident to that were inserted since the last time was included as input to an instance of the static algorithm. Then, we choose the vertices of highest recent degree as input to the static algorithm, thus setting the recent degree of these vertices to zero. By repeatedly setting the recent degree of the highest recent degree vertices to zero, we obtain a bound on the maximum recent degree in the graph. Then we apply the dynamic algorithm for bounded degree graphs on only the edges that contribute to recent degrees.
We can further reduce the maximum recent degree in the graph by employing randomization: In addition to the vertices already chosen to participate in the static algorithm, we randomly select some vertices incident to newly inserted edges.
To obtain an upper bound on the maximum recent degree at all times, we model the changes in recent degree by an online 2player balls and bins game. The game was first introduced in 1988 [51, 29] and has found a number of applications in the dynamic algorithms literature for obtaining worstcase guarantees [30, 24, 1, 71, 3, 57, 71, 72, 12, 31, 45]. To the best of our knowledge, our techniques are the first to demonstrate improved amortized guarantees using the game. We anticipate that this game will find additional applications in amortized algorithms as well as in translating offline strategies to online strategies.
The main technical content that remains are the details of each instance of the static algorithm: we have not specified when to run each instance, the precise subset of vertices to input, and which palette of colors to draw from. Understanding these details illuminates the key insight that allows us to improve the number of colors from the polynomial bound in [8] to polylogarithmic. We hierarchically bipartition the update sequence into levels of nested time intervals and at the end of each interval, we apply the static algorithm. We use a separate palette of colors for each level of intervals but for all instances of the static algorithm on the same level we use the same palette. Consequently, we need to ensure that vertices colored at the end of different intervals on the same level do not have conflicting colors. To do this, we ensure the structure of the intervals is such that if we color a vertex at the end of an interval on some level , then before the end of the next interval on level , has been recolored due to the end of an interval on a different level.
This partition of the update sequence is inspired by the offline algorithm of [43] for the dynamic edge orientation problem. Adapting their ideas to our setting requires overcoming two main hurdles: a) transitioning from graphs of bounded arboricity to general graphs, and b) transitioning from the offline setting to the online setting.
1.3.3 Overview of algorithm for low arboricity graphs
The proof of Theorem 1.5 is based on the following observation: the blackbox static algorithm used in Theorem 1.3 can be made efficient if is the class of arboricity graphs and we have access to a low outdegree orientation of the graph.
The proof of Theorem 1.6 concerns the LDS (defined in Section 1.2.2). The definition of the LDS is inspired by the following property of arboricity graphs: there exists an ordering of the vertices such that every vertex has at most neighbors that appear after it in the ordering [4]. Given such an ordering, consider the procedure of iteratively removing the vertices from the graph in order (or adding the vertices to the graph in reverse order) so that when each vertex is removed (or added) its degree with respect to the current graph is only . This procedure has been a key ingredient in algorithms in a variety of settings including distributed algorithms [9], parallel algorithms [4], property testing [33], and social network analysis [44, 68, 28]. We are the first to devise a data structure that dynamically maintains (an approximate version of) this ordering.
The LDS is useful for maintaining a proper coloring of a graph because the graph induced by each layer of vertices has low degree. Thus, we can apply a dynamic algorithm for graphs of bounded maximum degree on the graph induced by each individual layer. Then, because there are not too many layers in total, we can use a disjoint palette of colors for each layer.
On the other hand, simply using a low outdegree orientation of the edges does not seem to suffice for solving dynamic coloring. In general, one shortfall of a low outdegree orientation is that it is an inherently local data structure; each vertex only keeps track of information about its immediate neighborhood. In contrast, the LDS maintains a global partition of the vertices into layers. Furthermore, the LDS is designed to store strictly more information than a bounded outdegree edge orientation; by orienting all edges in the LDS from lower to higher layers, we get a bounded outdegree edge orientation. We anticipate that the LDS could be useful for solving more dynamic problems for which a bounded outdegree edge orientation does not appear to suffice.
2 Algorithm for general graphs
Theorem 2.1 (Restatement of Theorem 1.3).
There is a fully dynamic deterministic algorithm for maintaining an coloring with (amortized) recolorings per update step, for any . Using randomization (against an oblivious adversary), the number of colors can be reduced to while achieving an expected bound of recolorings.
The algorithm is as follows. Periodically, we run the blackbox static algorithm on a subset of vertices, to be specified later. At all times, each vertex is assigned a color by the blackbox static algorithm (from the last time was input to an instance of the static algorithm) and a color by the blackbox dynamic algorithm. The true color of is defined by the pair , so the total number of colors is the product of the number of colors used in each blackbox algorithm. To specify the subsets of vertices taken as input to the static algorithm, we define a hierarchical partition of the update sequence . First, we describe this partition, then we describe how to apply the static algorithm, and then we describe how to apply the dynamic algorithm.
2.1 Partition of update sequence
We partition the update sequence (without knowing its contents) into a set of intervals as follows. An interval is said to be of length if it contains update steps. We partition the entire update sequence into intervals of length for some parameter (which we will later set to ). We say that this set of intervals is on level 0. Next, for each , the level intervals are obtained from the level intervals by splitting each interval in two subintervals of equal length. Note that the intervals on level are of length and in general the intervals on level are of length .
It will be easier to work with these intervals if no two have the same ending point. So, for every set of intervals with the same endpoint, we remove all intervals except for the one with the lowest numbered level. The resulting set of intervals, shown in Figure 1 is the set of intervals that we work with in the algorithm.
2.2 Applying the blackbox static algorithm
At the end of each interval, we apply the blackbox static algorithm. For each interval , let be the instance of the blackbox algorithm that is executed at the end of interval . If is an interval on level , we say that is on level . For each level, we use a separate palette of colors, and all instances of the algorithm on the same level use the same palette of colors. In particular, if is on level , it uses the colors in the range from to .
We determine the input to each as follows. If is on level 0, the input is simply the entire vertex set. Otherwise, we decide the input based on the update sequence. For each vertex v, we keep track of its recent degree, defined as the number of edges incident to that were inserted since the last time was included as input to an instance of the static algorithm. For each interval , we let be the vertex of highest recent degree at the end of interval (breaking ties arbitrarily). For the deterministic algorithm, the input to each is the set of vertices (where an interval is considered a subinterval of itself).
For the randomized algorithm, in addition to we select another vertex at the end of each interval . Specifically, we pick uniformly at random an edge insertion from the last updates (if one exists) and then we let be either or , chosen at random. Then the input to each is the set of vertices .
We note that each interval on level contains only 1 subinterval (itself), and generally, each interval on level contains subintervals. Thus, each on level takes vertices as input.
2.3 Applying the blackbox dynamic algorithm
We apply the blackbox dynamic algorithm on the graph with the full vertex set but only the edges that count towards the recent degree of both of its endpoints. Specifically, if denotes the input dynamic graph then the dynamic graph that we input to the blackbox dynamic algorithm is defined as follows. is initially the empty graph on the same vertex set as and whenever there is an edge update to , the same edge is updated in . Additionally, when a vertex is included as input to the static algorithm, every edge incident to is deleted from .
To apply the blackbox dynamic algorithm, we need to show that has bounded maximum degree. To do this, we apply an online 2player balls and bins game. The game begins with empty bins. The goal of Player 1 is to maximize the size of the largest bin and the goal of Player 2 is the opposite. At each step, the players each make a move according the following rules.

Player 1 distributes at most new balls to its choice of bins.

Player 2 removes all of the balls from the largest bin (breaking ties arbitrarily).
Theorem 2.2 ([29]).
In the balls and bins game, every bin always contains balls.
A randomized variant of the game will be useful in analyzing our randomized algorithm. In this variant, in addition to emptying the largest bin, Player 2 also chooses a number from uniformly at random and empties the bin to which Player 1 added its ball during its last turn. Player 1 is oblivious to the behavior of Player 2.
Theorem 2.3 ([30]).
In the randomized variant of the balls and bins game, in a game with moves every bin always contains
balls with high probability.
^{2}^{2}2“High probability” means that for all , there is an such that the probability is at leastRecall that is a parameter introduced in Section 2.1.
Lemma 2.1.
In the deterministic algorithm the maximum degree of is always . In the randomized algorithm the maximum degree of is always .
Proof.
We will argue that in the balls and bins game with and , the number of balls in the largest bin is an upper bound for the maximum degree of . Then, applying Theorems 2.2 and 2.3 completes the proof.
We first note that by construction, the degree of each vertex in is at most the recent degree of so it suffices to bound recent degree. (In particular, the recent degree of could be larger because it counts edges to vertices that have recently been included as input to the static algorithm.)
The only way for the recent degree of a vertex to increase is due to the insertion of an edge incident to . On the other hand, the recent degree of a vertex decreases when a) an edge incident to is deleted causing its recent degree to decrement, and b) is included as input to the static algorithm causing its recent degree to be set to 0.
We consider the special case of the balls and bins game where for each edge insertion , Player 1 places one ball in the bin corresponding to and one ball in the bin corresponding to . Then, when each interval ends (which happens once every updates), Player 2 moves. Recall that at this point the recent degree of is set to 0 (and in the randomized algorithm, so is that of ). It is clear from this description that the deterministic and randomized balls and bins games parallel all of the increases and some of the decreases in recent degree in our deterministic and randomized algorithms, respectively. From here, it is easy to verify that the number of balls in the largest bin is an upper bound for the maximum recent degree in both the deterministic and randomized settings. For the sake of completeness, we prove this fact formally in the appendix. ∎
2.4 Correctness
We will show that our algorithm produces a proper coloring after every update. Recall that the color of each vertex is defined by the pair of colors where is the color assigned to by the blackbox static algorithm and is the color assigned to by the blackbox dynamic algorithm.
Consider an edge in the graph at a fixed point in time. We will show that our algorithm assigns different colors to and . If is included in the input to the blackbox dynamic algorithm (i.e. if is in ), then its two endpoints are assigned different colors by this algorithm, and are thus assigned different colors by the overall algorithm.
Otherwise, by the definition of the input to the blackbox dynamic algorithm, after the edge was last inserted at least one of or was included as input to the static algorithm. We claim that and are assigned different colors by the static algorithm. If and were last colored by the same instance of the static algorithm, then was executed after the edge was inserted (by assumption). Thus, the edge was included as input to , causing and to be assigned different colors. If and were last colored by instances of the static algorithm on different levels, then they are assigned different colors since each level uses a separate palette of colors.
The only remaining case is that and were last included as input to the static algorithm by two different instances of the static algorithm on the same level . We will show that this is impossible. This case is the crux of the correctness argument and the reason that we define the intervals in precisely the way that we do. It cannot be the case that since every vertex is recolored at the end of every interval on level 0. Suppose by way of contradiction that was most recently colored by (the instance of the static algorithm at the end of interval ) and was most recently colored by where interval comes before interval and both are on level . We will show that between the end of interval and the end of interval , is recolored by an instance of the static algorithm on a level (a contradiction). By the construction of the intervals (see Figure 1), between the ending points of and is the end of an interval on a level that contains interval as a subinterval. By the definition of the algorithm, every vertex that is included as input to is also included as input to . Thus, is recolored on level before was executed, a contradiction.
2.5 Analysis
Static algorithm.
Number of colors. The static algorithm uses colors per level and there are levels, for a total of colors.
Number of recolorings. In the deterministic algorithm, each interval has an associated vertex and in the randomized algorithm, each interval has two associated vertices and . Each such vertex is included as input to the static algorithm for all superintervals of . Since there are levels and each level consists of a set of disjoint intervals, each interval has at most superintervals. Thus, for each interval , and are included as input to instances of the static algorithm. Every interval ends after a multiple of updates so the number of recolorings is amortized .
Dynamic algorithm.
Number of colors. Given a dynamic graph of maximum degree , the blackbox dynamic algorithm maintains an coloring. By Lemma 2.1, (the graph input to the blackbox dynamic algorithm) has maximum degree in the deterministic setting and in the randomized setting. The randomized bound is with high probability and in the low probability event that the maximum degree exceeds the bound, we will immediately end all intervals, thereby recoloring the entire graph. Thus, the runtime bound is probabilistic but the bound on the number of colors is not.
Number of recolorings. Using the following simple greedy algorithm as our blackbox dynamic algorithm, we get a constant number of recolorings per update. When an edge is added between two vertices of the same color, simply scan the neighborhood of one of them and recolor it with a nonconflicting color. If the maximum degree of the graph is , this algorithm produces a coloring.
Combining the static and dynamic algorithms
Number of colors. Recall that if a vertex is assigned color by the blackbox static algorithm and color by the blackbox dynamic algorithm, then our algorithm assigns the color . So the number of colors is the product of the number of colors used in each blackbox algorithm, which is for the deterministic algorithm and for the randomized algorithm.
Number of recolorings. The total number of recolorings is the sum of the number of recolorings performed in each of the blackbox algorithms, which is .
Setting completes the proof.
2.6 Time bound
Theorem 2.4 (Restatement of Theorem 1.4).
Proof.
Static algorithm
We defined as the vertex of highest recent degree at the end of each interval . Although there are data structures to find in constant time, it suffices for the analysis of this algorithm to spend time to find each . An interval ends once every updates so the amortized time is .
At the end of every interval in the randomized algorithm, is chosen randomly from a distribution over only the most recent updates, so this takes constant amortized time. Then, after finding and , determining the input to each takes time linear in the size of the input to .
We now analyze the time to run all of the instances of the static algorithm. Recall that given a graph and a subset of the vertices, the static algorithm computes and a coloring of in time . Consider a level 0 interval . At the end of interval , we run the algorithm on the entire vertex set, which takes time . By construction of the intervals, each interval on level is of length and contains subintervals. Thus, the static algorithm at the end of each interval on level takes vertices as input so each such static algorithm runs in time . For all levels , there are subintervals of on level . Thus, it takes total time to run all instances of the static algorithm on level that are executed during interval . Therefore, the total time to run all instances of the static algorithm that are executed during interval (including the one at the end of interval ) is . Interval is of length so the amortized time is .
Dynamic algorithm
We note that the number of updates to is at most twice the number of updates to since for each edge inserted to , is inserted to and deleted from at most once. Thus, maintaining takes constant amortized time.
Recall that the blackbox dynamic algorithm has amortized expected update time in the randomized setting and amortized update time in the deterministic setting.
In the randomized algorithm, when the maximum degree of exceeds the stated bound, we immediately end all intervals, thereby recoloring the entire graph. For large enough , this happens with probability less than . Each time this happens, we pay an extra time to recolor the entire graph. Thus, this takes amortized time in expectation.
Combining the static and dynamic algorithms
The total amortized update time is the sum of the amortized running times of each of the blackbox algorithms, which is in expectation for the randomized algorithm, and with an additional additive factor of for the deterministic algorithm. (This expression subsumes the additive factor of from the randomized algorithm assuming ).
Setting completes the proof. ∎
2.7 Deamortizing the number of recolorings
We note that our algorithm can be easily modified to achieve the same tradeoff between number of colors and number of recolorings in the worstcase setting as in the amortized setting. This extension does not give a worstcase bound on the running time, only the number of recolorings. Our analysis of the amortized algorithm already uses a trivial blackbox dynamic algorithm that performs a constant number of recolorings per update in the worst case. We need to show that the static algorithms can be applied with a worstcase number of recolorings per update.
The worstcase algorithm works as follows. Since we are not concerned with running time, we run our amortized algorithm in the background (without performing any actual colorings). At the end of each interval , our worstcase algorithm immediately recolors and to the color assigned by . We delay the recoloring of the rest of the vertices in the input of . It is important to recolor and immediately because otherwise the balls and bins game does not apply.
From the proof of correctness of the amortized algorithm (Section 2.4), if is an edge and and were last recolored according to two different instances of the static algorithm on different levels, or the same instance, then and are assigned different colors. The only remaining case is if and were last recolored by different instances of the static algorithm on the same level. The proof that this is impossible from Section 2.4 holds if the following property holds: for every pair of adjacent intervals and on the same level where comes before , all vertices colored by are recolored by some on a level before any vertices are colored by .
We design the worstcase algorithm to ensure that this property holds. It suffices to take all of the at most vertices input to and recoloring them to the color assigned by throughout the course of interval . For ease of notation, we say that these colorings are performed by interval . We note that by the construction of the intervals, interval ends when interval begins so when interval begins, it already has full information about all of the recolorings it will perform. Furthermore, when interval performs a recoloring according to , the interval following on level has not ended (or even started) yet so these recolorings cannot conflict with other vertices colored using the level color palette.
Interval is of length and performs at most recolorings, so on average performs at most one recoloring every updates. To achieve recolorings per update in the worst case, we need to only allow intervals on a fraction of the levels to perform recolorings following each update. One way to do this is only allow intervals on level to perform recolorings after the update if .
3 Algorithms for low arboricity graphs
In this section we begin by proving Theorem 1.5. The proof follows from a combination of dynamically maintaining a bounded outdegree edge orientation and applying the algorithm from Section 2. Our main goal in this section is to improve upon Theorem 1.5 by proving Theorem 1.6. To this end we refine the tool of dynamic edge orientations by introducing a new layered data structure.
Theorem 3.1 (Restatement of Theorem 1.5).
There is a fully dynamic deterministic algorithm for graphs of arboricity that maintains an coloring in amortized time per update for any . Using randomization (against an oblivious adversary), the number of colors can be reduced by a factor of and the expected amortized update time becomes .
Proof.
We run the dynamic edge orientation algorithm of [43], which maintains an outdegree orientation in amortized time, for all . Given this orientation, for any subset of the vertices in the current graph , we can compute and a coloring of in time . We compute by simply scanning the outneighborhood of every vertex in and including the edges whose other endpoint is also in . Every edge between a pair of vertices is oriented away from either or so this algorithm scans every edge in .
Every subgraph of an arboricity graph also has arboricity , in particular . We color by considering an ordering of the vertices in such that every vertex has at most neighbors that appear after it in the ordering. Such an ordering exists and can be computed in time [4]. We imagine starting with an empty graph iteratively adding the vertices in to the graph in reverse order. When each vertex is added, has at most neighbors in the current graph. Using a palette of colors, we can always color a color different from all of its neighbors in the current graph.
Applying Theorem 2.4 with and parameter , we see that the algorithm from Theorem 2.1 runs in time per update in expectation in the randomized setting and per update in the deterministic setting. The additional time for maintaining the edge orientation is . Setting , the running time is (with an additional additive factor of in the deterministic setting).
Applying Theorem 2.1 with , the number of colors is for the deterministic algorithm and for the randomized algorithm. Setting completes the proof. ∎
For the remainder of this section we prove Theorem 1.6.
Theorem 3.2 (Restatement of Theorem 1.6).
There is a fully dynamic deterministic algorithm for graphs of arboricity that maintains an coloring in amortized time.
Given a partition of the vertices of a graph into layers , for all vertices let (the updegree of ) be the number of neighbors of in layers equal to or higher than that of .
Definition 3.1.
Given a dynamic graph of arboricity , a layered data structure (LDS) with parameters and is a partition of the vertices into layers so that for all vertices , .
Theorem 3.3 (Restatement of Theorem 1.7).
Let be an algorithm for arboricity graphs that maintains an orientation of the edges with outdegree at most that performs amortized flips per update. Then there is an algorithm to maintain an LDS for a fully dynamic graph of arboricity with and in amortized deterministic time .
3.1 Proof overview
The idea of the algorithm is essentially to move vertices to new layers when the required properties of the data structure are violated. Roughly, when there is a vertex with we move to a higher layer so that decreases to . Additionally, to control the number of layers, whenever a vertex has updegree less than and can be moved to a lower layer while maintaining updegree less than , we move to a lower layer. The fact that and differ by a logarithmic factor ensures that vertices don’t move between layers too often which is essential for bounding the running time.
To help with the running time analysis, we maintain two dynamic orientations of the edges: one is defined by the algorithm and the other is maintained by our algorithm. The orientation maintained by our algorithm has the property that all edges with endpoints in different layers are oriented toward the higher layer. We compare the number of edge flips in the orientation defined by our algorithm to the number of edge flips in the orientation algorithm using a potential function: the number of edges oriented in opposite directions in the two algorithms. This potential function is also used in [22].
The main idea of the analysis is to observe how changes in response to vertices moving between levels. We claim that when we move a vertex to a higher level, decreases substantially for the following reason. Our algorithm is defined so that we only move a vertex to a higher layer if its updegree decreases substantially as a result. Because our algorithm orients edges from lower to higher layers, when we move a vertex to a higher layer many edges incident to are flipped towards . Then because maintains an orientation of low outdegree, many of these edges flipped towards end up oriented in the same direction in the two orientations. Thus, decreases substantially as a result of moving to a higher layer. On the other hand, when a vertex moves to a lower layer, might increase. The idea of the argument is to use the substantial decreases in that result from moving vertices to higher layers to pay for the increases in that result from moving vertices to lower layers.
3.2 Invariants
In this section we introduce four invariants that together imply that and .
We maintain two dynamic orientations of the edges in the graph, one defined by our algorithm and the other defined by the algorithm . Unless otherwise stated, when we refer to an orientation, we mean the orientation defined by our algorithm.
For ease of notation, let and let .
We define the following for each vertex :

is the layer containing .

is the lowest layer for which if were in this layer, would be at most .

is the outdegree of v.

is the indegree of from neighbors in .
Orientation invariants
Invariant 1 defines how edges are oriented between layers and is useful for analyzing the update time of the algorithm, as outlined in Section 3.1.
Invariant 1.
All edges with endpoints in different layers are oriented towards the vertex in the higher layer.
The next two invariants bound and , which helps to bound .
Invariant 2.
For all vertices , .
Invariant 3.
For all vertices , .
Proof.
Number of layers invariant
Invariant 4 serves to bound the number of layers .
Invariant 4.
For all vertices , .
Claim 2.
Invariant 4 implies that .
Proof.
First we observe that under Invariant 4, all vertices of degree at most are in . Now, consider removing all vertices in from the graph. In the remaining graph, all vertices of degree at most are in layer . More generally, after removing all vertices in layers 1 through for any , all vertices of degree at most must be in layer .
The total number of edges in a graph of arboricity alpha is less than . So at least a fraction of the vertices have degree at most . Any subgraph of an arboricity graph also has arboricity so after the vertices in any given layer are removed, the graph still has arboricity . Thus, after removing the vertices in layers 1 through for any , at least a a fraction of the remaining vertices are in . Therefore, the number of layers total is at most . ∎
3.3 Algorithm
The idea of the algorithm is essentially to move vertices to new layers when the required properties of the data structure are violated. We define two recursive procedures Rise and Drop which move vertices to higher and lower layers respectively. In particular, when a vertex violates Invariant 2 or 3 (i.e. either or ), we call the procedure Rise which moves up to the layer . The movement of to a new higher layer may increase the updegree of some neighbors of causing to violate Invariant 2 or 3, in which case we recursively call Rise. On the other hand, when a vertex violates Invariant 4 (i.e. ), we call the procedure Drop which moves down to the layer . The movement of to a new lower layer may decrease for some neighbors of causing to violate Invariant 4, in which case we recursively call Drop. See Algorithm 1 for the pseudocode.
3.4 Correctness
Invariant 1 is satisfied at all times because whenever a vertex changes layer all of its incident edges that are oriented towards the lower layer are immediately flipped.
We observe the following useful property of the algorithm:
Lemma 3.1.

Right after any vertex is moved to a new layer , .

While remains in , the only way for to increase is by the insertion of an edge incident to .
Proof.

Whenever any vertex is moved to a new layer (either by Rise or Drop), it is moved to the layer . By the definition of , we have .

When any vertex moves to a higher layer, all of ’s incident edges within its new layer are flipped towards . When any vertex moves to a lower layer, all of ’s incident edges within its new layer are already oriented towards v by Invariant 1 and they are not flipped. That is, right after is moved to a new layer (in either direction), all of its incident edges within its new layer are oriented towards . Thus, for all vertices , the movement of to a new layer cannot cause to increase. Then since all edge flips are triggered by a vertex changing layers, the only way for to increase is by the insertion of an edge incident to .
∎
Invariant 2 is violated when . This could happen as a result of a) insertion of an edge, or b) movement of a vertex to a higher layer, which could cause ’s neighbors to violate the invariant. In both of these cases, the algorithm calls Rise on all violating vertices.
Invariant 3 is violated when . By Lemma 3.1, this can only happen following the insertion of an edge. In this case, the algorithm calls Rise on all violating vertices.
Invariant 4 is violated when . This could happen as a result of a) deletion of an edge, or b) movement of a vertex from to a lower layer , which could cause ’s neighbors in layers from to to violate the invariant. In both of these cases, the algorithm calls Drop on all violating vertices.
3.5 Bounding the number of edge flips
The first step towards getting a bound on the update time is to get a bound on the number of edge flips that the algorithm performs. We will show that the amortized number of edge flips per update is (Lemma 3.7).
We choose , so , as required.
Let be the sequence of graphs with orientation defined by our algorithm and let be the sequence of graphs with orientation defined by the algorithm . That is, for all , the underlying undirected graphs corresponding to and are identical but their orientations may differ. Given i, we say an edge in is bad if it is oriented in the opposite direction in and . We define a potential function:
We say that a call to Rise is heavy if it triggers at least edge flips, ignoring recursive calls. Otherwise, we say that a call to Rise is light.
Lemma 3.2.
Every light call to Rise is due to a violation of Invariant 3.
Proof.
We define the following parameters.
the total number of edge updates
the total number of light calls to Rise
the total number of heavy calls to Rise
the total number of calls to Rise; so
the total number levels that vertices move down (due to calls to Drop)
= the total number of flips
the total number of flips triggered by light calls to Rise
the total number of flips triggered by heavy calls to Rise
= the total number of flips triggered by calls to Drop
Observation 3.4.
Using the above parameters, it is immediate to bound the total increase in due to the following events:

Edge updates: .

Edge reorientations in : .

Light calls to Rise: .

Calls to Drop: .
The only event missing from the above list is heavy calls to Rise. We will now argue that decreases substantially as a result of this event. Then, we will use these substantial decreases in to pay for the increases in from the other events.
Lemma 3.3.
The total decrease in over the whole computation triggered by heavy calls to Rise is at least .
Proof.
Consider a heavy call to Rise on vertex . Let be the set of edges flipped by this call to Rise. All of the edges in are flipped towards . Before these flips happen, has outdegree at least by the definition of a heavy call to Rise. By Lemma 3.1, after the edges in are flipped, . Thus, the number of edges flipped is at least . We will use this fact at the end of the proof.
Before the edges in are flipped, all are outgoing of . Then since has outdegree at most in all , at least of these edges are bad before they are flipped. For the same reason, after these flips at most of the flipped edges are bad. Thus, decreases by at least as a result of flipping the edges in . Therefore, the total decrease in over the whole computation due to heavy calls to Rise is at least the sum of over all heavy calls to Rise, which is at least
∎
We derive bounds for , , and , in the following lemmas.
Lemma 3.4.
. .
Proof.
By Lemma 3.2 every light call to Rise is triggered by for some . By Lemma 3.1, right after any vertex is moved to a new layer, , and while v remains in this layer, the only way for to increase is by the insertion of an edge incident to . Before a light call to Rise(), must increase to at least . Thus, every light call to Rise must be preceded by insertions of edges incident to . Conversely, the insertion of an edge can only increase the indegree of one vertex. Thus, . Each light call to Rise flips at most edges so, . Combining these two equations we have, by choice of . ∎
Lemma 3.5.
.
Proof.
By Lemma 3.1, right after the call to Drop(), . Then since Drop() only flips edges incident to whose other endpoint is in a layer above , any call to Drop() flips at most edges. Thus, . Furthermore, every call to Rise() moves up by at most layers, so . Thus we have,
∎
Lemma 3.6.
Proof.
Lemma 3.7.
The amortized number of flips per update is .
Proof.
∎
3.6 Update time bound
In this section, we will show that our algorithm runs in amortized time per update.
Each vertex keeps track of the following information:


and the set of ’s outneighbors

and the set of ’s inneighbors in .

For each layer lower than , the set of ’s neighbors in that layer and the number of them.
Lemma 3.8.
Insert(u,v) runs in time (ignoring calls to Rise).
Proof.
In Insert(u,v) we update the stored information of both and in constant time simply by incrementing the appropriate counters and adding to the appropriate sets. Then we compute whether either or exceeds and the same for . These comparisons take time. ∎
Lemma 3.9.
Computing whether takes time .
Proof.
Then, if and only if the degree of to vertices in layers at least as high as the layer just below is at most i.e. if where is such that . This comparison takes time. ∎
Lemma 3.10.
Delete(u,v) runs in time (ignoring calls to Drop).
Proof.
Delete() updates the stored information of both and in constant time simply by decrementing the appropriate counters and deleting from the appropriate sets. Then Delete(u,v) computes whether and whether . This takes time by Lemma 3.9.∎
Lemma 3.11.
Rise() runs in time with respect to ’s layer immediately before the call to Rise() (ignoring recursive calls).
Proof.
It takes time to scan the , which suffices to determine , build the set (defined in Algorithm 1), flip the appropriate edges, and determine for each whether .
We must also update the stored information for and all vertices in . This can be done in time by incrementing/decrementing the appropriate counters and editing the appropriate sets. Importantly, every vertex in a layer below immediately before the call to does not need to update its stored information because vertices only keep track of the exact layer of their neighbors on lower layers. Additionally, does not need to update any of its information concerning its neighbors in lower layers. ∎
Lemma 3.12.
Drop() runs in amortized time (ignoring recursive calls).
Proof.
Drop() begins by computing . Let be such that . can be caluculated by finding the value such that but . The time spent doing this calculation is proportional to the number of layers that moves in this call to Drop(). Thus, the time spent on these calculations throughout the whole computation is by Lemma 3.5, which is by Lemma 3.3. So the amortized time to compute is .
After moving to layer , Drop() builds the sets and (defined in Algorithm 1) and flips the appropriate edges. To do this, we scan and for the appropriate layers . The sets and contain at most vertices and the number of that we scan is the number of layers that moves in this call to Drop(). This takes amortized time from the calculations in the previous paragraph. Then, by Lemma 3.9, determining whether for each takes time (constant time for each vertex ).
We must also update the stored information for and all vertices in
Comments
There are no comments yet.