arXiv:2608.29603cs.DSAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.29603

FirstFit online coloring in the random order model

Xinyu Ye, Yuechuan Xu, Zixuan Wang, Jiaying Zheng, Yaqiao Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The average performance of FirstFit online coloring on trees in the random order model is completely determined in recent works of Frei et al and Bosek et al, showing Θ(log⁡n/log⁡log⁡n)\Theta(\log n/\log \log n) number of colors, improving the Θ(log⁡n)\Theta(\log n) colors in the adversarial model. We provide a few further results on slightly more general graph classes. Firstly, We extend their method to obtain a simple path-counting principle for sparse graph classes, which immediately yields for example that cactus graphs and uniform hypertrees exhibit a similar improvement. We then show that FirstFit uses only O(1)O(1) colors on crown graphs, a standard example where adversarial arrival forces Θ(n)\Theta(n) colors. We further show that density alone (even linear minimum degree) is insufficient to guarantee O(1)O(1) colors even on bipartite graphs. Finally, we identify graph classes, including unit interval graphs and some graphs of high chromatic number, for which random arrival provides only limited improvement. We end with some open problems.

1 Introduction

This paper studies the vertex arrival model of online graph vertex coloring. In the adversarial model, an adversary creates a simple undirected graph G=(V,E)G = (V, E) of nn vertices, and selects a presentation order of vertices σ:[n]→V\sigma : [n] \to V. The graph is then presented online: at time ii, vertex v=σ(i)v = \sigma(i) arrives, and we learn all its neighbors among already appeared vertices. We call the set of neighbors of vv that an online algorithm learns about at the time of arrival of vv as the pre-neighborhood of vv. An online algorithm must declare how to irrevocably color the new vertex v=σ(i)v = \sigma(i) prior to the arrival of the next vertex σ(i+1)\sigma(i+1). An online algorithm does not know GG and even nn. Alternatively, we can view the online input as a sequence of induced subgraphs: G∩σ([1]),G∩σ([2]),…,G∩σ([n])G \cap \sigma([1]), G \cap \sigma([2]), \ldots, G \cap \sigma([n]). Given a graph GG, in the adversarial model, the performance of an online algorithm is measured by its maximum number of colors used among all possible presentation orders. In other words, the adversarial model is for worst case analysis.

An extensively studied online coloring algorithm is a greedy algorithm which is called FirstFit in the literature: when a vertex v arrives, FirstFit colors it with the first color that does not appear in its pre-neighborhood. A sequence of works [GL88, Ira90, AS21] showed that FirstFit is optimal on trees, inductive graphs, and chordal graphs, etc, using Θ(χ(G)⋅log⁡n)\Theta(\chi(G) \cdot \log n) colors, where χ(G)\chi(G) is

∗^{*}Email: yxyu613@163.com

†^{\dagger}corresponding author: liyaqiao@suat-sz.edu.cn the chromatic number of the graph G. Furthermore, it is shown that FirstFit is also optimal on uniform hypertrees, see [NGI08, LP23].

For practical purpose, it would be desirable to understand the average performance of algorithms. For online coloring, one way of obtaining such understanding is to analyze the random order model (aka, random arrival model), in which the adversary still selects the graph, but the presentation order σ\sigma is chosen uniformly at random. While there are many studies on the adversarial model, the random order model is much less understood. Recently, Frei et al [FGK +^{+}24] and Bosek et al [BGLP24] studied FirstFit in the random order model, they showed that on trees (forests), FirstFit uses Θ(log⁡n/log⁡log⁡n)\Theta(\log n/\log \log n) colors in expectation, demonstrating that the average performance of FirstFit is slightly better than the worst case on trees.

This work makes modest contribution in providing several further results in the random order model, demonstrating several phenomena of some interest. In Section 2 and Section 3, we exhibit several other graph classes that shows FirstFit has better, sometimes nearly optimal, performance in the random order model. We extend the method of Frei et al [FGK +^{+}24] and Bosek et al [BGLP24] to obtain a simple path-counting principle for sparse graph classes, which immediately yields O(log⁡n/log⁡log⁡n)O(\log n/\log \log n) colors for Cactus graphs and uniform hypertrees. However, we point out the limitation of this path-counting technique by providing a simple construction, belonging to several graph classes of interest, on which it fails. We then show that FirstFit uses only O(1)O(1) colors on crown graphs, a standard example where adversarial arrivals force Θ(n)\Theta(n) colors. On the other hand, we show that even in very dense bipartite graphs, FirstFit still uses Ω(log⁡n/log⁡log⁡n)\Omega(\log n/\log \log n) colors even in the random order model, i.e., being dense alone cannot guarantee O(1)O(1) colors for FirstFit in the random order model. We point out that since some parts of proofs in Section 2 are essentially the same as in Frei et al [FGK +^{+}24] and Bosek et al [BGLP24], to avoid repetition, we direct the interested readers to their papers for details. Lastly, in Section 4, we show that on certain graphs FirstFit in the random order model has only limited benefit comparing to the adversarial model.

Throughout the paper, n always denotes the number of vertices of a graph in the corresponding context, unless explicitly specified otherwise.

Acknowledgment. Y.L. thanks Vishnu V. Narayan and Denis Pankratov for useful discussion.