Online Coloring and a New Type of Adversary for Online Graph Problems

05/21/2020 ∙ by Yaqiao Li, et al. ∙ Université de Montréal Concordia University McGill University 0

We introduce a new type of adversary for online graph problems. The new adversary is parameterized by a single integer κ, which upper bounds the number of connected components that the adversary can use at any time during the presentation of the online graph G. We call this adversary "κ components bounded", or κ-CB for short. On one hand, this adversary is restricted compared to the classical adversary because of the κ-CB constraint. On the other hand, we seek competitive ratios parameterized only by κ with no dependence on the input length n, thereby giving the new adversary power to use arbitrarily large inputs. We study online coloring under the κ-CB adversary. We obtain finer analysis of the existing algorithms FirstFit and CBIP by computing their competitive ratios on trees and bipartite graphs under the new adversary. Surprisingly, FirstFit outperforms CBIP on trees. When it comes to bipartite graphs FirstFit is no longer competitive under the new adversary, while CBIP uses at most 2κ colors. We also study several well known classes of graphs, such as 3-colorable, C_k-free, d-inductive, planar, and bounded treewidth, with respect to online coloring under the κ-CB adversary. We demonstrate that the extra adversarial power of unbounded input length outweighs the restriction on the number of connected components leading to non existence of competitive algorithms for these classes.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In online graph problems the input graph is not known in advance, but is rather revealed one item at a time. In this paper we are concerned with the so-called vertex arrival model, where the graph is revealed one vertex at a time. When a new vertex is revealed, an online algorithm learns the identity of the vertex as well as its neighborhood restricted to the already revealed vertices. Note that the algorithm gets no information about future vertices. Many graph problems do not admit any non-trivial online algorithms in the adversarial vertex-arrival model. Be that as it may, online graph problems often arise in real life applications in computer networks, public transit networks, electrical grids, and so on. Recently, the interest in online and “online-like”111Some examples of “online-like” models of computation are dynamic graph algorithms, temporal graph algorithms, streaming graph algorithms, priority graph algorithms, and so on. graph models and algorithms has been increasing since it is being sparked by the proliferation of online social networks. Thus, it is necessary to introduce various restrictions of the basic adversarial model that allow nontrivial algorithms while capturing interesting real-life scenarios.

One obtains a plethora of restricted adversaries simply by insisting that the adversary generates a graph belonging to a particular family of graphs, such as -colorable, planar, -inductive, etc. Another way to relax the classical adversarial model is to consider distributions on graphs and perform average-case analysis. One of the most studied distributions is, of course, the Erdös-Rényi random graph. While it is mathematically appealing, real life graphs rarely follow this distribution. For example, one of the early empirical observations was that distributions on degrees of nodes in real social networks are most accurately modeled by power-law distributions [12]

, whereas the Erdös-Rényi model induces a binomial distribution on degrees of nodes. Thus, new models of random graphs have been introduced in an attempt to approximate power-law distributions on degrees. Many of these new generative models are inherently offline. A notable exception is the preferential attachment model 

[2], which perfectly fits within the vertex arrival model. The formal definition is technical, but at a high level this model works as follows. When a new vertex arrives its neighborhood is generated by connecting to an already existing vertex

with probability proportional to the current degree of

. This model has a natural motivation: consider a person signing up for some social network, where people can “follow” each other. This person is signing up not because they want to be left alone (i.e. form a new connected component), but because they already have a list of people in mind who they will follow (i.e., join existing connected component(s), potentially merging some components together). It is more likely that the person is going to follow well known people, e.g. celebrities, who in turn have some of the highest numbers of followers in the network. This is akin to a new node in vertex arrival model likely being connected to existing nodes of high degree.

The starting point of our work is the observation that when a social network graph is generated via the preferential attachment process, there are very few connected components in the online graph at any point in time. Formalizing this observation in the adversarial setting, we investigate a new type of adversary that is restricted to using at most connected components at any point in time during the generation of the online input graph. We call such adversary components bounded, or -CB for short.

In this paper we focus on the online coloring problem under the -CB adversary. Indeed, another motivation for considering the -CB adversary is to extend our understanding of lower bound techniques for online coloring. Most of the past research uses the following methodology: the adversary creates a collection of disjoint components with some properties, then the adversary merges some of these components by creating a vertex appropriately connected to the components. The aim of this technique is to allow the adversary to observe the coloring of each component chosen by the algorithm, and then choose a “correct” coloring of the components that differs from the one chosen by the algorithm. The adversary then connects the components together, forcing the algorithm to use extra colors (since the algorithm’s coloring is incorrect inside at least one component). By iterating this process, the adversary tries to force the online algorithm to perform badly. Some variant of this technique has been used, for example, in [7, 14, 4, 6, 1]. A notable exception is [8], where this create-and-merge components technique is not directly involved. Usually, this type of construction involves a large number of disjoint components, typically logarithmic in the number of vertices – see, for example, [7, 6]. Our goal is to formally analyze the power of this technique and the extent of dependence of existing lower bounds on this technique. Specifically, we ask, what happens if the adversary in the online coloring problem is -CB? In this work we investigate this question, while allowing the adversary to use an unlimited number of vertices to compensate for a limited number of components.

Our first set of results gives a finer understanding of the and algorithms (for formal definitions see Section 2), which are well known in the graph coloring community. We show that, perhaps surprisingly, outperforms on trees with respect to the -CB adversary. For general bipartite graphs, we show that uses at most colors against the -CB adversary. This result is particularly interesting in the context of existing lower bounds on the performance of on bipartite graphs. In a series of works [7, 4, 6] it is shown that any online algorithm must use at least roughly colors where is the number of vertices. The construction for this lower bound uses disjoint components. Our result shows that this is necessary. One often measures the performance of an online algorithm by its competitive ratio – the worst-case ratio between the objective value achieved by an algorithm and the offline optimum. In the case of nontrivial bipartite graphs offline optimum is , thus the difference between the absolute number of colors used by and its competitive ratio is just a factor of . But this difference has a philosophical significance: our result shows that the competitive ratio of on bipartite graphs is simply : the number of components that the adversary is allowed to use.

Our second set of results shows that for several classes of graphs, including -colorable graphs, the -CB adversary equipped with unlimited number of vertices is powerful enough to rule out competitive algorithms even when . These two sets of results provide another contrast between bipartite graphs and other classes of graphs.

The rest of the paper is organized as follows. In Section 2 we go over some preliminaries. The new adversarial model is introduced in Section 3. The algorithm is analyzed in Section 4, while is analyzed in Section 5. The analysis of various classes of graphs can be found in Section 6. We finish with some discussion and open problems in Section 7.

2 Preliminaries

In online coloring, an adversary creates a simple undirected graph222We will always use to refer to and to refer to . and a presentation order of vertices333Notation stands for . More generally, notation stands for . The graph is then presented online in the vertex arrival model: at time vertex arrives, and we learn all its neighbors among already appearing vertices. An online algorithm must declare how to color the new vertex prior to the arrival of the next vertex . A priori, an online algorithm does not know or even . Alternatively, we can view the online input as a sequence of induced subgraphs:

We call the set of neighbors of that an online algorithm learns about at the time of arrival of as the pre-neighborhood of , denoted by .

A natural greedy algorithm is called (see, for example, [7, 9, 13]): when a vertex arrives, colors it with the first color that does not appear in the pre-neighbrhood of . The pseudocode is shown in Algorithm 1.

      map that stores the coloring
     while  do
         A new vertex arrives with its pre-neighborhood
Algorithm 1 The algorithm for online coloring.

Another famous algorithm due to [11] for online coloring of bipartite graphs is called : when a vertex arrives, computes an entire connected component to which belongs in the partial graph known so far. Since we assume that the input graph is bipartite, the connected component can be partitioned into two sets of vertices and such that all edges go between and only. Suppose that , then is colored with the first color that is not present among vertices in . The pseudocode is shown in Algorithm 2.

      map that stores the coloring
     while  do
         A new vertex arrives with its pre-neighborhood
          connected component of in
         Partition vertices of into and such that all edges go between and only and
Algorithm 2 The algorithm for online coloring of bipartite graphs.

In the adversarial arguments presented in this work we often need to control the chromatic number of constructed instances. These instances can get quite complicated and computing their chromatic number exactly might be rather difficult. The following technique is widely used in the online coloring community, see e.g., [8]. The adversary is not only going to construct an online instance, but it will also maintain a valid coloring of that instance. Thus, when specifying the adversary we need to define not only how the next input item is generated, but also how it is colored. The key idea is that since the adversary knows and controls how future input items will be generated, it can anticipate its own moves and create a much better coloring than what an online algorithm can achieve without this knowledge. Unless explicitly stated otherwise, by an “algorithm” we always mean a deterministic algorithm.

2.1 Bins vs. Colors

We adopt the terminology introduced in [8]: when there is a possibility of ambiguity we say that an online algorithm colors with bins and the adversary with colors in order to distinguish the two. Let be a vertex. We use the notation to denote the bin that is assigned to by an online algorithm, and to denote the color that is assigned to by the adversary. The functions and naturally extend to be defined over sets of vertices. Let be a set of vertices. Define and . Sometimes, we say that bin contains to mean that .

2.2 Saturated Bins

We define a notion that is inspired by several previous works [14, 8, 6].

Definition 2.1.

Suppose that the adversary is constructing a -colorable graph. A bin is said to be -saturated if there are vertices such that


A bin is said to be perfectly -saturated if bin is -saturated and it contains exactly vertices. When a bin is -saturated, we simply say bin is saturated.

The following simple fact demonstrates why this notion might be interesting.

Fact 2.1.

If bins are all saturated, then every color class contains vertices in distinct bins. By connecting a new vertex to these vertices, the algorithm is forced to use a new bin.

The notion of saturated bins is already implicit in some previous works. For example, the so-called two-sided colors444What is called by “colors” in [6], as in many other works, is what we call bins. in [6] are saturated bins when . The construction in [6] forces many two-sided colors, i.e., many saturated bins. The proof of a lower bound in [8], which we mentioned earlier as an example that does not use the common create-and-merge components strategy directly, could be summarized as follows. The adversary has a strategy to force any algorithm to use perfectly -saturated bins for . In [14], the lower bound construction does not necessarily force -saturated bins, but seeks to create a situation where a weaker form of the Fact 2.1 is bound to appear.

In Section 4, we show that -CB adversary can successively force saturated bins on for -colorable graphs. This leads to the algorithm being noncompetitive. Explicit examples of saturated bins can be seen in Figure 1 in Section 4. The construction of forcing saturated bins on is generalized in Section 6 to work for all algorithms.

3 A New Type of Adversary

Let denote the number of connected components of graph .

Definition 3.1.

An adversary is said to be components bounded, or -CB, if the input graph and the presentation order satisfy


Let denote a deterministic online coloring algorithm. Define to be the maximal number of bins has to use when a -CB adversary constructs the graph . Let denote a class of graphs. Define




Let . By identifying with the class of graphs that are -colorable, the notation and are defined via (3) and (4), respectively. Let TREE denote the class of graphs that are trees.

Different from traditional online coloring models, a feature of the -CB adversary model is that the number of vertices of a graph is not necessarily a parameter in the model. In this work, the -CB adversary is allowed to construct graphs with arbitrarily many vertices. We will be interested in understanding what the power and limitations are for an adversary who can use unlimited number of vertices but is -CB.

Lemma 3.1.

Let denote the set of all possible graphs and let be an arbitrary algorithm. Then,


For every , let denote the complete graph on vertices. Obviously, an adversary can present in any presentation order while maintaining a single connected component. Thus, . As is arbitrary, the result follows. ∎

Hence, the -CB adversary model becomes interesting when we consider special classes of graphs. For example, denotes the maximal number of bins that the -CB adversary can force (see Algorithm 1) to use by constructing a bipartite graph.

4 on -colorable Graphs, Triangle-Free Graphs, and Trees

In this section, we completely characterize the performance of on -colorable graphs, triangle-free graphs, and trees for -CB adversaries. We begin with the following theorem, which completely determines for all .

Theorem 4.1.

Let .

  1. for every ;

  2. ;

  3. for every and .

  1. The graphs that are -colorable and can be presented by a -CB adversary consist of up to isolated vertices. Clearly, uses a single bin on such graphs.

  2. A simple induction shows that maintains a valid -coloring when a bipartite graph is revealed by a -CB adversary. Base case of a single vertex is trivial. In the inductive step, the newly arriving vertex has edges going to the “opposite” side of the bipartition (due to the -CB restriction). By the inductive assumption, those neighbors have been assigned to a single bin consistent with a valid -coloring, correctly identifies the other bin for the new vertex.

  3. Let be even and consider the graph with the vertex set and the edge set defined by connecting each vertex with for and

    . Since all edges go in between odd-indexed and even-indexed vertices, the graph is clearly bipartite. The adversary presents vertices in order

    . This presentation order satisfies the -CB constraint: is initially in one connected component, when arrives it is isolated and forms the second component, and every future vertex has an edge either to or . An example of this graph for is shown in Figure 0(a).

    Let denote the bin that assigns to. We show by induction on that . The base case of is trivial since when and arrive they are isolated nodes, so they are placed in bin by . In the inductive step, is connected to for . By induction, , therefore assigns to a new bin . A similar argument holds for the next arriving vertex .

    As can be arbitrary large, the result follows.

  4. Since is non-decreasing with respect to both and , it suffices to show that . Let be a multiple of and consider the graph with the vertex set . The adversary presents vertices in order . The edge set is defined by the following construction. As usual, we let denote the color that the adversary maintains for vertex , while denotes the bin used by .

    The construction consists of two phases: the initial phase and the inductive phase. During the initial phase, the adversary presents a path of vertices: . Clearly, when arrives it is an isolated vertex, but each subsequent vertex is revealed with a single edge to . This clearly satisfies the -CB constraint. The adversary assigns colors , , and . This is a valid -coloring (although colors are sufficient, the adversary uses more colors in anticipation of the inductive phase). assigns bins and . The result of the initial phase is that ends up with bins that are -saturated.

    The inductive phase proceeds in rounds. In round , the vertex is revealed and its pre-neighborhood consists of vertices for . Then the vertex is revealed and its pre-neighborhood consists of vertices for . Lastly, the vertex is revealed and its pre-neighborhood consists of vertices for . The adversary assigns and . By a straightforward induction, assigns : prior to round , has bins that are -saturated; during round , creates a new bin and places all three new vertices into that bin making it -saturated. The initial phase described in the previous paragraph establishes the base case of the induction.

    The coloring maintained by the adversary is easily seen to be valid, since the color classes consist of vertices whose indices have the same remainder , while the edges are present only between two vertices whose indices have different remainders . The -CB constraint is clearly maintained during the inductive phase.

    An example of this construction for is shown in Figure 0(b).


(a) An example of the adversarial graph with that is used in the proof of part (3).



(b) An example of the adversarial graph with that is used in the proof of part (4).
Figure 1: Examples of adversarial inputs used in the proof of Theorem 4.1. Columns indicate the coloring maintained by the adversary, while rows indicate the bins used by .

Observe that the construction in part (4) of Theorem 4.1 results in a triangle-free graph. Let denote the class of triangle-free graphs. Thus, we immediately obtain the following.

Corollary 4.2.


Part (4) of Theorem 4.1 and Corollary 4.2 will be generalized in Section 6.

We conclude this section by giving a complete analysis of on trees with respect to -CB adversary.

Theorem 4.3.



The lower bound is witnessed by the so-called forest construction due to Bean [3] (also independently discovered in [7]). We claim that a -CB adversary can construct a forest consisting of trees with the property that for each the algorithm uses color on some vertex belonging to the tree . We first prove this claim and later see how it implies the lower bound.

The construction is recursive and so we prove the above statement by induction on . Base case is trivial: when the adversary can give a single isolated vertex. Assume that the statement is true for and we wish to establish it for . The adversary begins by invoking induction and creating such that for there is such that is assigned by . Then, the adversary creates a new vertex connected to all the . This process, merges all existing trees into a single tree, which we call . Moreover, this forces to assign . This tree is set aside, and to satisfy the claim for , the adversary invokes the induction again to create another set of trees with such that . Note that creating requires at most components, so the adversary is -CB (remember that we have an additional component set aside during the second invocation of induction). Moreover, note that , so the trees satisfy the claim.

This claim implies the lower bound since the -CB adversary can present with for some . In the last step, the adversary presents connected to each . This process does not increase the number of components and forces . An example of this construction is shown in Figure 2.

Next, we show the upper bound . Suppose that uses bins for some . Let be the first vertex which is placed into bin by . By the definition of , there are vertices in the pre-neighborhood that have been previously assigned to bins . Since the adversary is constructing a tree, there can be no cycle. Hence, these vertices must be in distinct components, i.e., there are at least distinct components. ∎

Figure 2: An example of the forest construction used in the proof of Theorem 4.3. The adversary presents the vertices in order: . The uses bins while the adversary uses connected components during this construction.

5 on Bipartite Graphs

This section contains the most technical result of this paper. We establish the tight bound of on the number of bins used by with respect to a -CB adversary on bipartite graphs and trees. This provides a finer understanding of the performance of and is particularly interesting in light of previous lower bounds. Recall that Gutowski et al. [6] proved that any online algorithm has to use at least bins for coloring bipartite graphs with vertices, which matches the upper bound on from [11] up to the additive constant . The construction in [6] applied to (or even ) uses disjoint connected components to force bins. In particular, the main result of this section, which we state next, demonstrates that this is a necessary feature of their construction.

Theorem 5.1.



Since , the lower bound follows from Lemma 5.2 and the upper bound follows from Lemma 5.3. ∎

Observe that Theorem 5.1 implies that, in the class of bipartite graphs, worst case input already appears in TREE for .

We begin by establishing the lower bound used in the above theorem.

Lemma 5.2.


In this proof, the notation is used to denote the root of a rooted tree . The statement of the theorem is witnessed by the following recursive adversarial construction:

Base cases: is a rooted tree consisting of a single vertex. is a rooted tree consisting of one edge, where is defined as the vertex that is assigned to bin by .

Recursive step: let . To construct the adversary does the following:

  • it constructs ;

  • it constructs ;

  • it presents a new vertex connected via an edge to and via another edge to .

The vertex from step (3) becomes the root of the newly formed tree .

As usual, let denote the bin to which is assigned by . For each , let denote the set of nodes that are at even distance from in . Similarly, let denote the set of nodes at odd distance from in . We claim that for the above construction it holds that

  • ;

  • ;

  • the construction of satisfies the -CB constraint.

We prove the above claim by strong induction on . The statements are immediate for the base cases of and . Assume that the statement holds for all for some . Next, consider . Examining the construction we obtain:

  • ,

  • .

Using the inductive assumption, we have and . Therefore, we have establishing part (ii) of the claim.

Using the inductive assumption again, we have and . Therefore, .

uses the bipartition induced by and to decide how to color . Specifically, uses the first available bin other than those in . Therefore, since we have . Combining it with the result from the previous paragraph, we get establishing part (i) of the claim.

As for the number of connected components used in the presentation of , observe that step (1) uses components by induction. After step (1), is put aside as a separate component. Therefore, step (2) uses connected components (we invoked the inductive assumption one more time here). Step (3) of the construction does not require any additional components. Therefore, the total number of components is bounded by It is easy to see that this expression is exactly by considering the cases of odd and even separately. This establishes part (iii) of the claim.

Lastly, note that the claim implies that uses bins on and that the presentation of satisfies the -CB constraint. ∎

We finish this section with a matching upper bound for the class of bipartite graphs.

Lemma 5.3.



Consider a certain point in execution of on the input graph. As usual, let denote the bin to which is assigned by . We say that a connected component is of Type if can be partitioned in two blocks and such that

  • all edges go between and

Similarly, we say that a connected component is of Type if can be partitioned in two blocks and such that

  • all edges go between and

Figure 3 shows an example construction with two connected components of Type and Type .

Figure 3: A snapshot of an execution of on an input instance, with vertices presented in left-to-right order. At this step in the presentation, the graph contains two connected components and of Type and Type respectively. Labels indicate bins used by .

The high level idea is that the -CB adversary can only force components that are either of Type or of Type for some . Before we prove it formally, we observe that when a new vertex arrives, it can either (1) be an isolated vertex (taken to be of Type ), (2) be added to an existing component, or (3) be used to merge two or more existing components. Formally, we say that components get merged at time if vertex satisfies for , and were distinct connected components at time .

We record what happens to types of components after each of the above operations (1), (2) and (3). During operation (1), a new vertex of Type for is added. Clearly, for any . Next, we consider operation (2), i.e., when a new vertex gets added to a component . We assume that the two blocks of vertices of are and and that they satisfy the conditions of Type or . The resulting component is called . The changes to types after vertex is presented are recorded in Table 1.

is connected to Type of Type of
Table 1: Type changes for case (1), i.e., when is added to an existing component.

Finally, we consider what happens when a vertex is used to merge two or more components. We distinguish four types of components, the numbers of which are denoted by , and , respectively:

  1. of Type for . Vertex has a neighbor on the -side of such components.

  2. of Type for . Vertex has a neighbor on the -side of such components.

  3. of Type for . Vertex has a neighbor on the -side of such components.

  4. of Type for . Vertex has a neighbor on the -side of such components.

Let . We call the type parameter of the partially constructed input graph.

We say that a block or of a particular component being merged is on the opposite side of if has a neighbor among the vertices of the block. Otherwise, we say that the block is on the same side as . For example, block of component is on the opposite side of , whereas block of the same component is on the same side as . Let denote the set of bins already used for the vertices of blocks on the opposite side of , and let denote the set of bins already used for the vertices of blocks on the same side as . By the definitions of Type 1 and 2 components as well as , it is easy to see that each of can be only one of the following four options: . This reduces the problem of computing the type of the merged component to analyzing 16 cases. For example, if and then vertex will be assigned bin and the merged component will be of Type since it will have one side with bins and the opposite side with bins . We denote the merged component by and Table 2 summarizes all of the 16 cases.

Possible? Bin of Type of
no NA NA
no NA NA


no NA NA
no NA NA
no NA NA

no NA NA
no NA NA
Table 2: Type changes for case (2), i.e., when is used to merge some existing components.

The reason that certain combinations in Table 2 are impossible is that if one side is colored with bins then the opposite side must use bin (because of how works).

Observe that from Table 2, the type parameter of can either stay the same, increase by additive , or increase by additive . Furthermore, it can be directly verified from the table that an increase is possible only if there are at least two components having type parameters not less than . We refer to this property as the continuity of the type parameter.

Assume that the input graph and the presentation order satisfy the -CB condition, then the above observations imply the following statements:

  1. we have consists of Type components for ;

  2. there can be at most one component that is of one of the following four types: Type , Type , Type , Type .

Note that (i) immediately implies the statement of this lemma.

These statements can be proved by induction on . The base case is easy to verify. Indeed, if , i.e., there is just a single vertex, then it is of Type 1[2]. Consider . Observe that for the algorithms and have identical behavior. Therefore, (2) in Theorem 4.1 shows (i) is true, and the single component is of Type 2[2]. Hence, (ii) is true.

We proceed to the induction step. Assume (i) and (ii) are true for , we consider the case . First, we show (ii). Let be the first component that is of one of the following types: Type , Type , Type , Type . Since the adversary is -CB, the existence of implies that the adversary becomes -CB when creating any new component that is disjoint from . By the induction assumption, the adversary can only create components that are of Type for . This proves (ii). Next we show (i). By the continuity of the type parameter, in order for the type parameter to go beyond there need to be at least two components both having type parameters not less than . By (ii), this is impossible, so (i) is true. ∎

6 Lower Bounds for Several Graph Classes

In this section we establish non-existence of competitive algorithms against -CB adversaries for various classes of graphs. We begin by establishing a strong non-competitiveness result for -colorable graphs for . This generalizes part (4) of Theorem 4.1 to arbitrary algorithms.

Theorem 6.1.

for every .


Since is non-decreasing in , it suffices to prove that . Fix an arbitrary coloring algorithm . We show that for every , a -CB adversary can construct a -colorable graph so that uses at least different bins to color vertices in . It may be helpful to consult Figure 4 while reading this proof.

The construction of proceeds in layers, which we denote by . Vertices (and their pre-neighborhoods) in are presented first, followed by , and so on. The construction stops as soon as uses distinct bins, which may happen before and will be guaranteed to happen in .

Each layer consists of “sufficiently many” vertices, meaning that there should be enough vertices in lower layers to guarantee that the construction of higher layers goes through. Initially, we don’t quantify “sufficiently many,” although we shall give some estimates on sizes of layers at the end of this proof.

Layer is simply a path of sufficiently large length . The adversary presents the vertices in in the order in which they appear on the path. There are two possibilities: (i) already uses at least bins to color ; (ii) uses fewer than bins to color . In case (i) the construction is over and the adversary has achieved its goal.

Next, we handle case (ii). Observe that has to use at least two different bins to color correctly. Consider two bins and with the most number of vertices assigned to them by . Let the sets of nodes assigned to those bins be and , respectively, with . The definition of case (ii) implies that . Since is a path, no bin can contain more than nodes. Thus, the number of nodes not in is at least . Since they are partitioned among at most bins, including , and is most populous then . Next, we select subsets and so that all the nodes in are non-adjacent in and . This can be done as follows: alternatively pick a node from or to include in or , respectively, and remove its neighbors from or , respectively. Each pair of such steps includes one vertex into and one vertex into removing at most vertices from each and from future considerations. Thus, this can go on for at least rounds. In conclusion, we end up with sets of nodes and such that

  • all nodes in are placed in bin by , where ;

  • .

In particular, the second item implies that and can be assumed to be sufficiently large.

Construction of each following layer for either terminates early because used at least different bins or forces to assign sufficiently many vertices to bin . We shall denote the set of such vertices555Note that the index of is off by one with respect to the index of layer with which it is associated. This happens for since layer has two sets and associated with it. for layer . Assuming that the construction hasn’t terminated in layer , the next layer is constructed by the adversary by repeating the following steps sufficiently many times:

  • the adversary chooses vertices for all arbitrarily;

  • the adversary presents a new vertex with pre-neighborhood ;

  • the adversary updates for all .

Due to step (3) we say that consumes nodes from for . Observe that step (2) guarantees that has to assign to a bin other than . Just as for layer , if uses different bins in this layer then we are done. Otherwise, let be the bin that has the most number of vertices assigned to it in layer . If the adversary presents vertices in layer then the number of vertices assigned to is at least . We let be an arbitrary subset of such vertices of size exactly .

This construction continues until layer where the adversary can present a single node according to the above scheme forcing to assign it to a new bin . Overall, then uses different bins, namely, .

To guarantee that step (1) in the above construction always works, we need to make sure that all sets are sufficiently large for this construction to reach layer . This is possible provided that for we have since each node in a layer above consumes one node from (step (3) of the above construction). We also need a similar condition for layer , namely, that . Thus, we end up with the following system of inequalities:

  • ;

  • for ;

  • .

It is straightforward to check that , for and is a valid solution to the above system. Thus, a feasible construction can be carried out by the adversary. The total number of nodes in this construction is at most .

Observe that the construction clearly satisfies the -CB constraint, since layer is presented as a single connected component and every vertex in a higher layer is adjacent to a vertex in layer .

We also note that the construction creates an almost-forest. More specifically, call the vertex in step (2) of the above construction the parent of the corresponding for chosen in step (1). Observe that due to step (3), each vertex has at most one parent. Therefore, the only thing preventing this construction from being a forest is layer , which can be thought of as a path going through all the leaves of the forest. This implies that the constructed graph is -colorable. Consider the subgraph obtained by removing all edges in layer along with all vertices that do not have parents. Since it is a forest, it is -colorable. Moreover, any valid -coloring of this subgraph is also a partial valid -coloring of the entire graph since we chose and to be non-adjacent. We can then extend this partial coloring to a complete -coloring of the entire graph by using a greedy strategy. Note that uncolored vertices in have degree at most , so a greedy coloring would use at most colors. ∎

Figure 4: Example of the construction used in Theorem 6.1. This is a hypothetical example for some that assigns bins to vertices according to the figure.

The above construction can be modified so that either uses bins or the adversary can successively force saturated bins. For example, the adversary can extend the level and repeat the construction on the extended part. The adversary can do this sufficiently many times and recolor each copy so that saturated bins are forced.

The rough estimates on sufficient lengths of layers presented in the above proof immediately lead to the following quantitative version of the result.

Corollary 6.2.

The -CB adversary can construct a -colorable graph on vertices so that any online coloring algorithm uses at least bins.

Next, we note that the construction from Theorem 6.1 is quite robust. It can be modified in various ways to obtain similar non-competitiveness results for other classes of graphs. We first define the relevant classes.


the class of graphs that do not contain cycle of length as a (not necessarily induced) subgraph.


the class of -inductive graphs, i.e., those graphs whose vertices can be numbered so that each vertex has at most adjacent vertices among higher numbered vertices.


the class of planar graphs.


the class of graphs of treewidth at most .

We are now ready to state and prove the following corollary of the construction from Theorem 6.1.

Corollary 6.3.
  1. for every .

  2. for every .

  3. .

  4. for every .

  1. Since the construction in Theorem 6.1 is an almost-forest, the only cycles present are those using edges in layer . By making longer we could insist that nodes in and are at least distance apart: modify the procedure for selecting nodes into or by picking a node from or respectively and removing all nodes at distance from it from and . This modification insures that all cycles are of length greater than .