Hat chromatic number of graphs
Bart{\l}omiej Bosek, Andrzej Dudek, Micha{\l} Farnik, Jaros{\l}aw, Grytczuk, Przemys{\l}aw Mazur

TL;DR
This paper investigates the hat chromatic number of graphs, determining its value for various classes, establishing bounds, and exploring variants of the game to deepen understanding of strategic color guessing.
Contribution
It introduces the concept of the hat chromatic number, computes it for several graph classes, and explores variants to connect it with classical graph coloring parameters.
Findings
Computed $(G)$ for multiple graph classes
Established bounds relating $(G)$ to chromatic and coloring numbers
Explored game variants to derive new insights
Abstract
We study the hat chromatic number of a graph defined in the following way: there is one player at each vertex of a loopless graph , an adversary places a hat of one of colors on the head of each player, two players can see each other's hats if and only if they are at adjacent vertices. All players simultaneously try to guess the color of their hat. The players cannot communicate but collectively determine a strategy before the hats are placed. The hat chromatic number, , is the largest number of colors such that the players are able to fix a strategy that will ensure that for every possible placement of hats at least one of the guesses correctly. We compute for several classes of graphs, for others we establish some bounds. We establish connections between the hat chromatic number, the chromatic number and the coloring number. We also introduce several…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Hat chromatic number of graphs
Bartłomiej Bosek
Theoretical Computer Science Department, Faculty of Mathematics and Computer Science, Jagiellonian University, ul. Prof. Stanisława Łojasiewicza 6, 30-348 Kraków, Poland
,
Andrzej Dudek
Department of Mathematics, Western Michigan University, Kalamazoo, MI
,
Michał Farnik
Faculty of Mathematics and Computer Science, Jagiellonian University, ul. Prof. Stanisława Łojasiewicza 6, 30-348 Kraków, Poland
,
Jarosław Grytczuk
Faculty of Mathematics and Information Science, Warsaw University of Technology, 00-662 Warsaw, Poland
and
Przemysław Mazur
Wayve Technologies, 30 Station Road, Cambridge CB1 2RE, United Kingdom
Abstract.
We study the hat chromatic number of a graph defined in the following way: there is one player at each vertex of a loopless graph , an adversary places a hat of one of colors on the head of each player, two players can see each other’s hats if and only if they are at adjacent vertices. All players simultaneously try to guess the color of their hat. The players cannot communicate but collectively determine a strategy before the hats are placed. The hat chromatic number, , is the largest number of colors such that the players are able to fix a strategy that will ensure that for every possible placement of hats at least one of the guesses correctly.
We compute for several classes of graphs, for others we establish some bounds. We establish connections between the hat chromatic number, the chromatic number and the coloring number. We also introduce several variants of the game: with multiple guesses, restrictions on allowed strategies or restrictions on colorings. We show examples how the modified games can be used to obtain interesting results for the original game.
The first and fourth author are partially supported by the grant of Narodowe Centrum Nauki, grant number 2017/26/D/ST6/00264.
1. Introduction
We study a graph coloring problem inspired by the following hat guessing puzzle. There are players (we call them Bears) sitting around and looking at each other. There is also an adversary (we call her Demon) who suddenly puts colored hats on their heads. Each Bear can see all hats except his own. After a while, each Bear writes down on a piece of paper hypothetical color of his own hat. No communication with other Bears is allowed, though before the play Bears may fix some strategy. They win collectively against Demon if at least one of them guesses correctly. Otherwise, when none of them guessed correctly, Demon is the winner. Notice that Demon, as a supernatural creature, can read Bears’ minds. So, she knows their strategy before the play. What is the maximum number of hats’ colors (depending on ) for which there is a strategy guaranteeing Bears’ win?
This puzzle has a natural generalization for arbitrary graphs. Bears are sitting at the vertices of a given graph , and each Bear can see only colleagues occupying neighboring vertices. So, his guess depends only on color configuration appearing in his neighborhood. The original puzzle concerns the case of complete graph . We ask more generally: what is the maximum number of hats’ colors for which there is a strategy guaranteeing Bears’ win on a graph ?
We denote this number by , and call it the hat chromatic number of a graph . Rigorous definition will appear in the next section, where, as a warm up, we also solve the original puzzle by proving that . Another family of graphs for which the problem is completely solved are cycles. A surprising theorem due to Szczechla [7] asserts that if or , and in all other cases. The proof is quite involved. It is also known that for any tree (first shown in [5]). In fact in [6] it is shown that for a connected graph if and only if is a tree or contains a unique cycle where is not divisible by and . A Lovász Local Lemma argument shows that for graphs with maximum degree .
In [5] it was shown that for a complete bipartite graph we have . In [2] it was shown that for a sufficiently large -partite graph .
In this paper we prove more results and formulate several conjectures on the number , focusing on graphs with bounded density. In particular, we prove that is bounded for graphs of bounded genus and sufficienlty large girth (depending on genus).
2. Warm up
Let us start with a simple solution to the original puzzle with Bears on a clique .
Theorem 1**.**
Every clique satisfies .
Proof.
Denote Bears by , and assume that the set of colors is . First we show that Bears have a winning strategy. Let denote the color of hat obtained by . Suppose that the total sum of colors chosen by Demon is . Now each Bear imagines that , and guesses accordingly by writing a missing term as a hypothetical color of his own hat. More precisely, the strategy of Bear is given by an expression
[TABLE]
Since there are Bears and possible values of in , we must have for at least one , which means that at least one Bear guesses correctly.
To see that Bears cannot win if the number of colors exceeds , we apply a simple probabilistic argument. Let be a fixed number of colors. Assume that Bears have fixed their deterministic strategies. This means that a guess of each Bear is uniquely determined by hat colors of his neighbors. Suppose that Demon distributes colored hats randomly, choosing a color for each Bear independently with uniform probability. Let denote the event that the -th Bear guesses correctly. Clearly, . Thus, the probability that at least one Bear guesses correctly satisfies
[TABLE]
This implies that for , with positive probability none of the Bears guesses correctly, and therefore Demon is the winner. ∎
3. Notation and definitions
Now, we give a formal definition of the hat chromatic number . Let be a graph on the set of vertices . Let be a fixed set of colors. Suppose that each vertex is assigned an -ary function mapping to . We assume however, that depends only on those variables for which is adjacent to in . In other words, a value of stays constant under any changes on coordinates corresponding to vertices not adjacent to . Such functions will be called strategies on a graph .
Consider now a system of equations
[TABLE]
for , where ’s are some strategies on a graph . Suppose that for every substitution of elements from for variables , at least one of equations in the system (3.1) is satisfied. Then, the number is defined as the largest integer , for which such a system of equations exists for a graph . We call it the hat chromatic number of a graph .
In other words, if , then for every system of equations (3.1) there is a substitution of elements form for variables such that none of the equations in the system (3.1) holds. Such substitution will be called a demonic coloring of a graph with respect to fixed strategies . Therefore the hat chromatic number can be defined equivalently as the least positive integer such that for every strategies on a graph , there exists a demonic coloring of using colors.
We can make this definition even more algebraic in the following way. Assume that is a set of -th roots of unity in the field of complex number . For every strategy we may find a multivariable complex polynomial representing over . This means that for every we have . The system of equations (3.1) is then equivalent to a single polynomial equation
[TABLE]
over . Since for every , we may reduce polynomial to a new polynomial , in which every variable appears with exponent at most . Then the hat chromatic number is the least integer such that for every polynomial , as defined above, its reduced version is non zero.
4. Probabilistic bounds
We start with a simple proof that the hat chromatic number is bounded for graphs of bounded maximum degree. It will be sufficient to use the symmetric version of the Lovász Local Lemma.
Lemma 1**.**
Let be events in some probability space. Assume that , and no event depends on more than other events. If , then
[TABLE]
This lemma gives almost immediately the following result.
Theorem 2**.**
Every graph of maximum degree satisfies .
Proof.
Let be the number of colors. Suppose that Bears fixed their strategies and Demon plays randomly. Let denote the event that the -th Bear guessed correctly. Then . It is not hard to check that each event is mutually independent of all other events , except those for which and are adjacent in . This can be explained as follows: if colors of all neighbors of are fixed, then the color guessed by the -th Bear is uniquely determined. The event reduces then to randomly picking this color by Demon, which certainly does not depend on what happens in the remaining part of the graph. So, we may apply Lemma 1 for and , which immediately gives the assertion of the theorem. ∎
Lemma 2**.**
Let be a positive integer and let be a graph of order . Assume that there is a partition of such that is an independent set for each . Then, if
[TABLE]
then .
Proof.
Assume that (4.1) holds and . That means that with colors Bears can always win. Fix a strategy for each of the players. For a fixed there are exactly colorings for which no player in guesses his color. Thus, there are colorings for which at least one of the players in guesses his color. Consequently, there are at most
[TABLE]
colorings such that there is a player who guesses his color. If this number is less then the total number of colorings (which is equivalent to (4.1)), then the adversary can choose a coloring for which none of the players will guess the color of his hat, a contradiction. ∎
Theorem 3**.**
Let be a positive integer and let be a graph of order with chromatic number . Then, if
[TABLE]
then .
Proof.
Let be a color partition. By Lemma 2 it suffices to show that
[TABLE]
Since is a convex function, Jensen’s inequality yields that
[TABLE]
and consequently
[TABLE]
Finally, observe that by assumption and so , which implies in (4.2) that
[TABLE]
∎
Corollary 1**.**
Every graph of order satisfies . Moreover, if is not a clique, then .
Proof.
If , then and
[TABLE]
implying that . Otherwise, if , then observe that is an increasing function and so . Consequently,
[TABLE]
∎
Corollary 2**.**
Let be a positive integer and let be a graph of order with chromatic number . Then,
[TABLE]
for sufficiently large .
Proof.
Clearly,
[TABLE]
Now observe that (as tends to infinity). Indeed, let . Then, it is easy to check that is a decreasing function and so
[TABLE]
Thus, .
Let . Hence, and . Since , we get
[TABLE]
Thus, Theorem 3 yields that for large . ∎
Corollary 3**.**
For almost all graphs of order we have
[TABLE]
Proof.
The lower bound is trivial, since almost all graphs contain a clique of order . The upper bound will follow from the previous corollary. First, since for , we obtain that
[TABLE]
and consequently
[TABLE]
Next recall that for almost all graphs , where . Thus,
[TABLE]
as required. ∎
5. Graphs of bounded density
Any nonempty set of the form will be called a cube. A set is then called the -th component of the cube . By we denote the set of colors (-th complex roots of unity, for instance).
5.1. Trees
We start with a simple proof that for every tree with at least two vertices. The lower bound follows from and an easy observation that whenever is a subgraph of . For the upper bound we will need the following definition. Let be a tree with root . Let be any strategy for . A color is said to be dominant for if contains a cube whose each component have size at least .
Lemma 3**.**
Let be a tree with root . If , then for any strategy there exists at most one dominant color in .
Proof.
Suppose that there are two distinct dominant colors and for the root . Let and denote the corresponding cubes contained in and , respectively. Since each component of every cube is of size at least , these components must overlap. Hence, . So, there is an element such that and . This means that . ∎
Now we may prove the aforementioned result for the hat chromatic number of trees.
Theorem 4**.**
Let be a tree with root , and let be fixed strategies on . If , then for every color which is not dominant for , there is a demonic coloring such that . In consequence, every tree with at least two vertices satisfies .
Proof.
Let be a tree on the set of vertices . We use induction on . If , then is a constant function of one variable, that is, for some . Notice that is the unique dominant color for . So, taking for any color different than defines a demonic coloring of .
For the inductive step, let denote the neighbors of in . Let denote connected components of . Choose to be the root of . Now, let be any non-dominant color for . Denote by the restriction of strategy obtained by putting . Assume that is a dominant color for (or any color if such does not exist). Put for , and for all other . Since is not dominant for , the whole cube cannot be contained in . Hence, there must exist such that . By Lemma 3, none of the colors is dominant for . Hence, by inductive hypothesis, there exist demonic colorings of trees such that . Now we may define a coloring by taking and for all other vertices of . Clearly, is a demonic coloring of , and the proof is complete. ∎
5.2. Multiple guesses
Consider now a modified hat guessing game in which we allow each Bear to guess times, where is a fixed integer. In other words, each Bear picks a subset of colors, and they win if at least one Bear hit an actual color of his hat. Let denote the analog of the hat chromatic number . We can easily generalize the results concerning trees. Let be a tree with root . Let be any strategy for . A color is said to be -dominant for if contains a cube whose each component have size at least .
Lemma 4**.**
Let be a tree with root . If , then there are at most -dominant colors in for any strategy .
Proof.
Suppose that there are distinct dominant colors for the root . Let denote the cubes contained in . For each we have
[TABLE]
Hence, . So, there is an element such that , a contradiction. ∎
Theorem 5**.**
Every tree satisfies for every .
Proof.
Let be a tree on the set of vertices . We use induction on . If , then is a constant function of one variable, that is, for some of cardinality . Notice that is the set of dominant colors for . So, taking for any color defines a demonic coloring of .
For the inductive step, let denote the neighbors of in . Let denote connected components of . Choose to be the root of . Now, let be any non-dominant color for . Denote by the restriction of strategy obtained by putting . Assume that are sets of colors containing all dominant colors for . Put for , and for all other . Since is not dominant for , the whole cube cannot be contained in . Hence, there must exist such that . By Lemma 4, none of the colors is dominant for . Hence, by inductive hypothesis, there exist demonic colorings of trees such that . Now we may define a coloring by taking and for all other vertices of . Clearly, is a demonic coloring of , and the proof is complete. ∎
The following theorem motivates introducing the multiple guessing variant of the hat chromatic number.
Theorem 6**.**
Let be a connected graph, and let be a partition of the vertex set of . Let . Then , where .
Proof.
Let be the number of colors, let and take . Let be fixed strategies for the graph , colors and guesses. We will construct a demonic coloring for the , note that we will use only colors from to color vertices in .
First let us construct strategies for with colors and guesses. Let and let be a coloring of the neighbors of in . We set to be a fixed subset of of cardinality containing the sets for all . Such a set can be chosen because .
Since we can find a demonic coloring of with respect to .
Now let us construct a strategy for with colors and guesses. Let and . We set to be a fixed subset of containing .
Since we can find a demonic coloring of with respect to .
We claim that is a demonic coloring for the . Indeed, if and then , a contradiction with the choice of . If and then , a contradiction with the choice of . ∎
We exhibit the usefulness of Theorem 6 by showing the following two results.
Theorem 7**.**
Every graph of genus and sufficiently large girth (depending on ) satisfies , in particular .
Proof.
According to [1], Lemma it is folklore that for every surface there is a girth such that every graph of girth at least embedded in has a partition such that is a tree and is two independent in . Since is two independent we have for all and . Thus from Theorem 6 and Theorem 5 we obtain . ∎
Theorem 8**.**
Every graph has a subdivision satisfying , in particular .
Proof.
We construct by subdividing each edge. Note that is a bipartite graph with , where and is the set of vertices introduced in the subdivision. Obviously for all and . Thus by Theorem 6 we have . ∎
5.3. Restricted demonic colorings
Another way of modifying the hat chromatic number is by restricting the set of allowable strategies that Bears can use. Let be a family of strategies specified by some property, for instance. By we denote the maximum size of color set for which Bears can win with using only strategies from .
In our next result we give a bound for for bounded density graphs, where is a family of bi-polar strategies defined as follows.
Definition 1**.**
We call a strategy bi-polar with respect to an order if for all and all partial colorings we have: for all the set is either equal or is a singleton, moreover for any there may by at most one such that .
We call a strategy bi-polar if it is bi-polar with respect to all orders.
The “sum modulo ” strategy from Theorem 1 is an example of a strategy that is bi-polar with respect to all orders. A strategy for a Bear : “if any of your neighbors has a red hat, then answer “red”, otherwise say the color of the hat on Bear ” is bi-polar with respect to those orders for which is the last of the neighbors of .
Recall that a coloring number of a graph , denoted by , is the least integer for which there is a linear order of the vertices of such that each vertex has at most neighbors appearing earlier in the order.
Theorem 9**.**
Every graph satisfies .
Proof.
Let be the number of colors and be the strategies. We will construct a demonic coloring inductively by extending a partial coloring of the first vertices.
Let be the partial coloring of the first vertices such that Bears for either cannot guess yet because or guess incorrectly because for some color . We will find a suitable color for the -st vertex. If is not an neighbor of then does not depend on . Let be a neighbor of . Since is bi-polar there is at most one possible color such that . Furthermore, does not depend on the color of so or regardless of . We fix so that is distinct from for such that is a neighbor of and distinct from . This can be done because . ∎
Impressed by the theorem above one may wonder whether . In Theorem 13 we will show a family of graphs with and .
6. Variable color sets
In this section we consider another variation of our hat guessing game. This time we assume that each Bear has its private set of colors . A strategy is then a function mapping the product into (depending only on coordinates corresponding to the neighbors of the vertex ). A sequence is called winning if Bears have winning strategies for any sets of colors , with . Otherwise, the sequence is called loosing.
As a direct corollary from Theorem 4 we have the following:
Theorem 10**.**
For every tree , the sequence is loosing.
On the other hand we have:
Theorem 11**.**
If is a tree with degree sequence , then the sequence is winning for .
Proof.
We prove the theorem by induction on . Assume that is a leaf of and a neighbor of with . Consider . Let and be the set of colors of for and , respectively. Let . By the induction hypothesis the Bears have winning strategies for , we modify them to strategies for as follows:
- •
the Bears on that are not neighbors of apply for the same strategy as for ,
- •
the Bears on that are neighbors of pretend that is colored with instead of and use the strategy from ,
- •
the Bear answers if is odd and if is even,
- •
the Bear obtains an answer from his strategy for and answers .
To check that the strategy is winning assume that is a coloring of . It induces a coloring of and at least one of the Bears guesses correctly on . If it is not then that Bear also guesses correctly on . If it is then it means that . That means that answers correctly if and have the same parity and answers correctly if and have distinct parity. ∎
We would also like to cite a result by Szczechla ([7], Corollary 8):
Theorem 12**.**
For every cycle , the sequence is loosing. In consequence, .
Now let us make a slight generalization of the game. After choosing a graph and the number of colors let us also choose a set of admissible colorings. The Bears know the set before determining their strategy and the Demon must choose a coloring from . Obviously for we obtain the standard game. Moreover, if then is a winning strategy.
By we denote the largest integer such that for all and for all subsets of cardinality at most the Bears have a winning strategy in the game with the set of admissible colorings . Obviously .
The usefulness of admissible colorings is presented in Theorem 13, before proving it we need the following:
Lemma 5**.**
**
Proof.
We prove the Lemma by induction on . For we have one Bear and one admissible coloring.
Now assume and let be the set of admissible colorings on with . Let be the projection on the first coordinates and let . Note that , in particular . Moreover, for every there is a unique such that .
We define the following strategy: Bears play on disregarding the color of the hat on Bear , they use a winning strategy for the set of admissible colorings . Bear uses the strategy such that if and otherwise.
Observe that the strategy defined above is a winning strategy for the Bears. Indeed, let be a coloring. If then one of the Bears guesses correctly. If then Bear guesses correctly. ∎
Let denote the , i.e., the graph obtained by replacing the degree vertex of by a clique on vertices.
Theorem 13**.**
* for large enough.*
Proof.
Let be the number of colors. Let be the set element subsets of . Take and , where is a clique on vertices and is the empty graph on vertices. Every Bear in adopts the following strategy: if the coloring of vertices in belongs to the set the Bear represents, then it says the number of that coloring (in lexicographical order), otherwise the Bear says .
The Bears in compute (each one individually but all with the same data) the set of possible colorings of for which none of the Bears in answers correctly. Note that , indeed suppose that is a set of elements. Since the Bear in corresponding to does not guess correctly for any of the colorings in his hat must have color , so he would guess correctly if were colored with a coloring not in .
After computing the Bears in adopt a fixed winning strategy for a game on with admissible colorings , which is supplied by Lemma 5. ∎
7. Conjectures
We conclude the paper with several conjectures:
Conjecture 1**.**
There is a function such that every graph satisfies .
If such exists then by theorem 13 we have .
Conjecture 2**.**
If is a graph with degree sequence , then the sequence is winning for .
Note that for the sequence is not winning.
Conjecture 3**.**
Every graph with maximum degree satisfies .
Conjecture 4**.**
Every planar graph satisfies .
Conjecture 5**.**
Every graph satisfies .
Let denote the Hadwiger number of (the order of a largest clique minor in ).
Conjecture 6**.**
Every graph satisfies .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] M. O. Albertson, G. G. Chappell, H. A. Kierstead, A. Kündgen, R. Ramamurthi, Coloring with no 2 2 2 -colored P 4 subscript 𝑃 4 P_{4} ’s, Electron. J. Combin. 11 (2004) Research Paper 26, 13 pp. (electronic).
- 2[2] N. Alon, O. Ben-Eliezer, C. Shangguan, I. Tamo, The hat guessing number of graphs, ar Xiv:1812.09752 v 1 [math.CO], 2018.
- 3[3] N. Alon, J. H. Spencer, The Probabilistic Method, John Wiley and Sons, Inc. 2000.
- 4[4] O. V. Borodin, On acyclic colorings of planar graphs, Discrete Math. 25 (1979) 211–236.
- 5[5] S. Butler, M. Hajianghayi, R. Kleinberg, T. Leighton, Hat guessing games, SIAM J. Discrete Math. 22 (2008), 592–605.
- 6[6] K. Kokhas, A. Latyshev, For Which Graphs the Sages Can Guess Correctly the Color of at Least One Hat, J. Math. Sci. 236 (2019), 503-520.
- 7[7] W. Szczechla, The three-colour hat guessing game on the cycle graphs, ar Xiv:1412.3435 [math.CO], 2014.
