arXiv:2609.00569cs.GTSep 2026

Manuscript Offprint

arXiv:2609.00569

Graph Coloring with Color Preferences

Tomohiro Koana, Yeeseok Oh, Hirotaka Yoneda

Abstract

We study graph coloring with color preferences, in which each vertex ranks the available colors. In addition to assigning different colors to adjacent vertices, we require the coloring to be stable: no group of vertices can cyclically exchange their assigned colors so that each strictly prefers its new color to its original one. We define the stable chromatic number χstable(G)\chi_{\text{stable}}(G) of a graph GG as the minimum integer kk such that every preference profile admits a stable kk-coloring of GG. We establish several upper and lower bounds. In particular, for any acyclic orientation of the edges of GG, the largest number of vertices reachable from a vertex by directed paths, including the vertex itself, is an upper bound on χstable(G)\chi_{\text{stable}}(G). This shows that χstable(G)\chi_{\text{stable}}(G) is well-defined. We also show that O(tlog⁡(1+n/t))O(t \log(1 + n/t)) colors suffice for an nn-vertex graph GG of treewidth tt, and complement this with a lower bound in terms of the Grundy number. Turning to the problem of finding a minimum stable coloring for a given profile, we show that stable 2-colorability is polynomial-time solvable, whereas stable kk-colorability is NP-complete for every fixed k≥3k \geq 3. Using the treewidth bound, we give a fixed-parameter tractable algorithm parameterized by treewidth.

1. Introduction

Graph coloring models the problem of assigning reusable resources under pairwise incompatibilities: vertices are recipients, colors are resource types, and adjacent vertices must receive different colors [Jensen and Toft, 1995]. Classical graph coloring does not distinguish between colors and asks only for feasibility. In many allocation settings, however, vertices represent agents who have strict preferences over the available colors. We study this preference-aware setting under a new stability requirement: there is no cycle along which every agent prefers the color assigned to the next agent.

To illustrate, consider designing a take-home exam for a course. You announce that the exam is to be solved individually, but you are aware that some students close to each other might work on it together. You therefore decide to make multiple versions of the exam so that close friends receive different versions. To minimize the workload, you want to make as few versions as possible. When students are modeled as vertices, two students are adjacent if they might work together. A proper coloring of this graph represents a feasible assignment of exam versions.

Then a problem arises because students may rank the versions differently based on their strengths in different topics, familiarity with the material, or perceptions of the versions' difficulty. Once the packets have been distributed, students connected through the collaboration network may also exchange them privately. For example, Figure 1 shows such a situation: students on a cycle may circulate their packets so that each receives the version initially held by the next student. If every participant strictly prefers the received version, this is an individually profitable coalition deviation.

Figure

Figure 1: Exchanging versions along the blocking cycle a→b→c→aa \to b \to c \to a benefits all participants but makes the initially proper assignment improper.

Such a deviation may undermine the instructor's assignment. In particular, a student may acquire the same version as a collaborator outside the deviating coalition, thereby violating properness. Even when properness is preserved, an unauthorized exchange can undermine the intended distribution of assessment variants. We call a directed cycle along which every student prefers the version assigned to the next student a blocking cycle, and we seek a proper assignment with no such cycle. We call such a coloring stable. Preparing and validating many distinct versions is costly, which motivates minimizing the number of colors.

In this paper, we focus on the following two basic questions: How many colors suffice to stably color a graph? What is the complexity of finding such a coloring?

Our Contributions We introduce the stable chromatic number χstable(G)\chi_{\text{stable}}(G) of a graph GG, the minimum integer kk such that every preference profile on GG admits a stable kk-coloring. In Section 3, we bound this invariant from above and below. For any acyclic orientation of the edges of GG, the largest number of vertices reachable from a vertex by directed paths, including the vertex itself, is an upper bound on χstable(G)\chi_{\text{stable}}(G). In particular, χstable(G)≤∣V(G)∣\chi_{\text{stable}}(G) \leq |V(G)|, so the stable chromatic number is well-defined. For the lower bound, we use the Grundy number Γ(G)\Gamma(G), which is the maximum number of colors that First-Fit can use over all vertex orderings. From a Grundy coloring with rr colors, we construct a preference profile that admits no stable (r−1)(r-1)-coloring, proving that Γ(G)≤χstable(G)\Gamma(G) \leq \chi_{\text{stable}}(G). Since every stable coloring is proper, χ(G)\chi(G) is a natural lower bound on χstable(G)\chi_{\text{stable}}(G). We therefore focus mainly on graph classes of bounded chromatic number and ask whether their stable chromatic number is also bounded. We determine the stable chromatic number exactly for complete bipartite graphs, paths, and cycles. Table 1 summarizes these bounds.

In Section 4, we turn to the complexity of finding a stable coloring with the minimum number of colors for a graph GG and a preference profile ≻\succ. We show that stable 2-colorability is polynomial-time solvable, while stable kk-colorability is NP-complete for every fixed k≥3k \geq 3. In view of this NP-hardness, we seek fixed-parameter tractable algorithms. An algorithm is fixed-parameter tractable (FPT) with respect to a parameter tt if it runs in time f(t)NO(1)f(t)N^{O(1)} on instances of size NN, for some computable function ff. We focus on treewidth, arguably the most extensively studied structural graph parameter, which measures how closely a graph resembles a tree. We show that O(tlog⁡n)O(t \log n) colors suffice for every nn-vertex graph of treewidth tt. Using this bound, we design a fixed-parameter tractable algorithm parameterized by treewidth. In particular, a stable coloring of (G,≻)(G,\succ) using the minimum possible number of colors can be found in polynomial time when GG is a tree.

Related Work The closest related work is by Samaris [2023], who studies graph coloring, possibly with color lists, in which vertices have linear preferences over the available colors. A coloring is Pareto optimal if no other proper coloring makes some vertex better off without making

Graph Classχ(G)\chi(G)Stable Chromatic Number χstable(G)\chi_{\mathrm{stable}}(G)
Upper BoundLower Bound
General nn-vertex graphs≤n\leq nnnΓ(G)\Gamma(G)
Paths PnP_n (n≥4n \geq 4)233
Cycles CnC_n≤3\leq 333
Complete bipartite graphs Km,nK_{m,n}2min⁡{m,n}+1\min\{m,n\} + 1min⁡{m,n}+1\min\{m,n\} + 1
Graphs of maximum degree Δ\Delta≤Δ+1\leq \Delta + 12Δ2^{\Delta}Γ(G)\Gamma(G)
Trees≤2\leq 2O(log⁡n)O(\log n)Ω(log⁡n)\Omega(\log n)
Graphs of treewidth tt≤t+1\leq t + 1O(tlog⁡(1+n/t))O(t \log(1+n/t))Ω(tlog⁡(1+n/t))\Omega(t \log(1+n/t))
Planar graphs≤4\leq 4O(log⁡2n)O(\log^2 n)Ω(log⁡n)\Omega(\log n)

Table 1: Bounds on the chromatic number χ(G)\chi(G) and the stable chromatic number χstable(G)\chi_{\mathrm{stable}}(G). Here Δ(G)\Delta(G) and Γ(G)\Gamma(G) denote the maximum degree and Grundy number, respectively.

any vertex worse off. Samaris characterizes Pareto-optimal colorings and gives a mechanism for finding one.

Pareto optimality is incomparable with our notion of stability. A non-Pareto-optimal coloring can be stable because a Pareto improvement need not be realizable by a cyclic trade. Conversely, a Pareto-optimal coloring can be unstable because rotating colors along a blocking cycle need not produce another proper coloring.

Several other works also consider preferences or stability in graph coloring. Blum and Rosenschein [2008] study a multiagent variant of graph coloring in which each agent controls a subgraph and ranks the colors used on that subgraph, with objectives including Pareto efficiency, fairness, and individual rationality. Kun et al. [2013] also use the term stable coloring to mean a pure Nash equilibrium in an anti-coordination game. Unlike our model, their colorings need not be proper, vertices have no intrinsic color preferences, and stability concerns unilateral recoloring rather than envy cycles.

Beyond graph coloring, stability has been studied extensively in resource-allocation problems. In the house-allocation model of Shapley and Scarf [1974], a Pareto-optimal, core-stable allocation can be found by eliminating trading cycles. Such a trading cycle corresponds exactly to a blocking cycle under a proper coloring of the complete graph KnK_n. Thus, our model of stable coloring generalizes the house-allocation model. Stability in terms of trading has also been considered in matchings [Alcalde, 1994, Chen et al., 2021].

References (21)