On Robust Colorings of Hamming-Distance Graphs

$H_q(n,d)$ is defined as the graph with vertex set ${\mathbb Z}_q^n$ and where two vertices are adjacent if their Hamming distance is at least $d$. The chromatic number of these graphs is presented for various sets of parameters $(q,n,d)$. For the $4$-colorings of the graphs $H_2(n,n-1)$ a notion of robustness is introduced. It is based on the tolerance of swapping colors along an edge without destroying properness of the coloring. An explicit description of the maximally robust $4$-colorings of $H_2(n,n-1)$ is presented.


Introduction
In this paper we study vertex colorings of graphs based on the Hamming distance. Precisely, fix q ≥ 2 and d ≤ n and consider the graph with vertex set Z n q and where two vertices are adjacent if their Hamming distance is at least d. We denote these graphs by H q (n, d) and call them Hamming-distance graphs or shortly Hamming graph (the latter terminology, however, is used for a variety of graphs in the literature and therefore needs to be taken with care). Note that the cliques in H q (n, d) are exactly the q-ary block codes of length n and Hamming distance at least d, whereas the independent sets are the anticodes with maximum distance d − 1.
For general parameters, H q (n, d) is not a graph product of any standard sort (weak, strong, cartesian etc.) and therefore the abundant literature on the chromatic number and colorings of graph products (see, e.g., the survey [8] by Klavzar and the references therein) does not apply.
However, for d = n the graph H q (n, n) is the n-th weak power of the complete graph K q on q vertices, and its chromatic number as well as all minimal colorings are known. Precisely, the chromatic number of this graph is q and (for q > 2) each q-coloring is given by a coordinate coloring, that is, by simply assigning the value of a fixed coordinate as the color; see [4] by Greenwell/Lovász as well as [2] by Alon et al., where -among many other results -the authors present an alternative proof based on Fourier analytical methods. By applying a certain relation between a function and its Fourier transform to the indicator function of a maximal independent set they derive the exact structure of that set.
We will begin with discussing the chromatic number of H q (n, d). This discussion is closely related to [11] by Rouayheb et al., where the authors link bounds on codes to properties of the Hamming graphs. In [7], Jamison/Matthews study the chromatic number of the graph complement of H q (n, d) for various sets of parameters. However, their results combined with the well-known Nordhaus-Gaddum relations between the chromatic numbers of a graph and its complement do not lead to any tighter bounds than those presented in this paper.
As for the chromatic number, it is straightforward to generalize the idea of coordinate colorings of H q (n, n) in [2] to H q (n, d). This trivially leads to the upper bound q n−d+1 for the chromatic number of H q (n, d). As a consequence, the chromatic number of H 2 (n, n−1) is 4 because Payan [12] showed that the chromatic number of a nonbipartite cube-like graph is at least 4. Furthermore, with the aid of the Erdős-Ko-Rado Theorem for integer sequences [1, 3,9] it can be shown that for various other sets of parameters, q n−d+1 is in fact the chromatic number; see Corollary 3.5 for details. The general case, however, remains open (to the best of our knowledge). This includes H 2 (n, d) for most pairs (n, d) with d < n − 1.
In the main part of the paper we will focus on the graphs H 2 (n, n − 1), which have chromatic number 4. We show that -different from H q (n, n) -these graphs enjoy 4colorings that are not coordinate colorings. Even more, they also allow uneven 4-colorings (i.e., the color classes do not have the same size). This irregular structure of maximal independent sets and minimal colorings suggests that the Fourier analytical methods of [2] are unlikely to be of any help in order to determine the exact chromatic number for general H q (n, d).
The abundance of genuinely different 4-colorings of H 2 (n, n − 1) gives rise to the question of whether the colorings can be ranked in a certain way. We approach this question by introducing a measure of robustness, which is based on the number of transition edges. We call an edge a transition edge of a given coloring if swapping the colors of the two incident vertices leads to a new proper coloring. The robustness is simply the fraction of transition edges among all edges. We show that if n is odd the coordinate colorings are exactly the maximally robust 4-colorings of H 2 (n, n − 1), while for even n there is an additional (natural) type of coloring with maximal robustness. Furthermore, we show that a 4-coloring is maximally robust if and only if the transition edges tile the graph in disjoint 4-cycles.
Throughout the paper we use the following terminology and notation. For any graph G we denote by V (G) its vertex set and by E(G) its edge set. Thus E(G) ⊆ V (G) × V (G). All graphs have neither loops nor multiple edges. Furthermore, graphs are undirected, and thus (x, y) ∈ E(G) ⇐⇒ (y, x) ∈ E(G). We also use the notation ∼ for adjacency, thus x ∼ y ⇐⇒ (x, y) ∈ E(G). Let N (x) := {y ∈ V (G) | y ∼ x} denote the set of neighbors of vertex x ∈ V (G). For any graph G we define the following invariants: α(G) denotes its independence number, that is, the maximal size of an independent set; ω(G) is the clique number, that is, the maximal size of a clique in G; girth(G) denotes the girth, that is, the length of a shortest cycle. A proper k-coloring is a vertex coloring such that adjacent vertices have different colors. We only consider proper colorings and usually omit the qualifier 'proper' unless we explicitly discuss properness. We denote by χ(G) the chromatic number, that is, the minimal k such that G has a proper k-coloring. Any χ(G)-coloring is called a minimal coloring. A coloring is called even if all color classes (the sets of vertices with the same color) have the same cardinality. Finally, for any x, y ∈ V (G) we define d G (x, y) as the graph distance between x and y, that is, the length of a shortest path from x to y. The vector with all entries equal to 1 is denoted by 1. Its length will be clear from the context. We set [n] := {1, . . . , n}.

Basic Properties of the Hamming-Distance Graphs
Let q, n ∈ N ≥2 and let A be a set of cardinality q. For any two vectors x, y in A n we denote by d(x, y) := |{i | x i = y i }| the Hamming distance between x and y and by wt(x) := d(x, 0) the Hamming weight of x. Recall that a q-ary block code of length n and Hamming distance d over the alphabet A is a subset, say C, of A n such that d(x, y) ≥ d for all distinct elements x, y ∈ C. The block code is called linear if A is a field of size q (thus q is a prime power) and C is a subspace of the vector space A n .
Throughout this paper we choose A = Z q := Z/qZ. This is solely for convenience and any alphabet of cardinality q would work. However, some arguments are simplified by using the group structure of Z q , i.e., computing modulo q. In the very few cases where we consider linearity we will switch to a field of size q.
Definition 2.1. Let q, d, n ∈ N be as in (2.1). The Hamming-distance graph, or simply Hamming graph, H q (n, d) is defined as the graph with vertex set V := Z n q and edge set We point out that in the literature the terminology "Hamming graph" sometimes refers to other graphs, among them for instance our special case H q (n, n). In this paper the name exclusively refers to the graphs in the above definition.
Note that the graph H q (n, n) is the n-th weak power of the complete graph K q on q vertices; see also [2, p. 914].
By definition of the Hamming graphs, the cliques form q-ary block codes of length n and Hamming distance at least d and thus the clique number ω(H q (n, d)) is the maximal cardinality of such a code. On the other hand, the independent sets are the anticodes in Z n q of distance d − 1, that is, any two elements in such a set have distance at most d − 1.
Let us briefly look at the case (q, d) = (2, n), which is excluded in (2.1). This case is genuinely different from the general one because the graph H 2 (n, n) is disconnected with 2 n−1 components each one consisting of one edge. Indeed, every x ∈ Z n 2 has only one neighbor, namely x + 1 (recall that n ≥ 2). Thus H 2 (n, n) is entirely uninteresting and excluded from our considerations.
We list some basic properties of the Hamming graphs.
(c) H q (n, 1) is the complete graph on q n vertices. (d) The Hamming graph H q (n, d) is the undirected Cayley graph of the group (Z n q , +) and the subset S d = {v ∈ Z n q | wt(v) ≥ d}, which generates the group. (e) H q (n, d) is connected.
Proof. (a) For any vertex x ∈ Z n q the neighbors are exactly those vectors that agree with x in at most n − d coordinates. There are clearly n i (q − 1) n−i vectors that share exactly i coordinates with x. Summing over all possible i yields the desired formula. (b) For any two vertices x, y ∈ Z n q the map Z n q −→ Z n q , v −→ v + (x − y) defines a graph automorphism that maps y to x. (c) is trivial. (d) Since (q, d) = (2, n), the set S d indeed generates the group Z n q . Even more, the vectors (1, 1, . . . , 1), (2, 1, . . . , 1), (1, 2, 1 . . . , 1), . . . , (1, . . . , 1, 2, 1) form a basis of the Z qmodule Z n q and are in S d for any admissible d. By the very definition of the Hamming graph, x, y ∈ Z n q are adjacent in H q (n, d) iff y = x + v for some v ∈ S d . This shows that the graph is the stated Cayley graph. (e) follows from (d). Proof. (a) Let x, y ∈ Z n q be any distinct vertices. Since q ≥ 3 there exist z i ∈ Z q such that x i = z i = y i for all i = 1, . . . , n. Thus (x, z), (z, y) ∈ E(G), and we have a path of length 2. The girth follows from the cycle 0, 1, (2, . . . , 2). (b) Consider the vertices 0, x, y, where x = (1, . . . , 1, 0, . . . , 0) and y = (0, . . . , 0, 1 . . . , 1) with both having exactly d entries equal to 1. If n ≥ 2d, then d(x, y) = 2d and thus 0, x, y form a cycle of length 3. Let n < 2d. Then x and y overlap in exactly 2d − n entries (which are equal to 1), and therefore d(x, y) = 2n − 2d ≥ 3d − 2d = d. Again, the three vertices form a cycle of length 3. (c) First of all, the vertices 0, 1, (1, 0, . . . , 0), (0, 1, . . . , 1) form a cycle of length 4 in the Hamming graph. By vertex-transitivity it now suffices to show that 0 is not contained in a cycle of length 3. Suppose x, y ∈ Z n q are adjacent to 0. Then wt(x), wt(y) ≥ d. Moreover, x i = 1 = y i for at least 2d − n > n 3 positions and therefore d(x, y) < n − n 3 = 2n 3 < d. Hence x, y are not adjacent, and this shows that the graph has no cycle of length 3. A cycle of odd length is obtained as follows. For i = 1, . . . , n set f i := (1, . . . , 1, 0, 1, . . . , 1), where 0 is at position i. If n is odd the vertices 0, f 1 , f 1 + f 2 , . . . , n i=1 f i = 0 form a cycle of length n. If n is even the cycle 0, f 1 , f 1 + f 2 , . . . , n i=1 f i = 1, 0 has length n + 1.

On the Chromatic Number of the Hamming Graph
There is an obvious way to color any Hamming graph, and it will play a central role in our investigation of colorings.
It is a proper q n−d+1 -coloring of H q (n, d).
The properness of K follows from the fact that adjacent vertices have Hamming distance at least d and therefore cannot agree on any n−d+1 coordinates. As a consequence, α(H q (n, d)) ≥ q d−1 and χ(H q (n, d)) ≤ q n−d+1 .
In this section we discuss existing results and several methods to determine the chromatic number explicitly, thereby answering the question in the affirmative for various sets of parameters.
First of all, we trivially have χ(H q (n, 1)) = q n because H q (n, 1) is the complete graph on q n vertices. Next, Payan [12] proved the surprising fact that no nonbipartite cube-like graph can have chromatic number less than 4. Since the binary Hamming graph H 2 (n, d) is the cube-like graph Q n [d, d + 1, . . . , n] we obtain from (3.1) Theorem 3.3. χ(H 2 (n, n − 1)) = 4. Now we turn to more general cases. For a proper r-coloring of H q (n, d) the color classes, that is, the set of all vertices with the same color, are independent sets, and thus the existence of a proper r-coloring implies the existence of an independent set of cardinality at least q n /r . This leads to the sufficient condition Furthermore, α(H q (n, d)) = q d−1 =⇒ each q n−d+1 -coloring of H q (n, d) is even.
One cannot expect (3.2) to be very fruitful in determining the chromatic number because it is only a sufficient condition. In other words, the existence of one independent set with at least q n /(q n−d+1 − 1) elements does not imply that χ(H q (n, d)) < q n−d+1 because the latter requires the existence of multiple independent sets (possibly of varying cardinality). Yet, some cases can indeed be settled this way as the independence number of the Hamming graph is known for most sets of parameters. This result is known as the Erdős-Ko-Rado Theorem for integer sequences and has been proven by Kleitman [9] for the binary case and Ahlswede/Khachatrian [1] as well as Frankl/Tokushige [3] for the general case. In our notation it states the following.
For d = n the very last part appears also in [2, Claim 4.1]. In Theorem 1.1 of the same paper it is then shown that each maximal independent set of H q (n, n) (where q ≥ 3) is of the form I i,α = {v ∈ Z n q | v i = α} for some i ∈ [n] and α ∈ Z q . This allows one to conclude that each q-coloring is a coordinate coloring. Below we will see that for general H q (n, d) the maximal independent sets do not have a nice structure. Moreover, for d < n, even if each maximal independent set is the color class of a coordinate coloring, this does not allow one to conclude that each minimal coloring is a coordinate coloring; see Proposition 3.6 and Example 4.5.
For d < n − q + 2, the upper bound in part (b) may not be sharp. For instance, for d = 1 and n = 2q − 1 one obtains q d−1−2r r i=0 n−d+1+2r i (q − 1) i = 2, whereas, of course, α(H q (n, 1)) = 1 since H q (n, 1) is the complete graph on q n vertices. Now we obtain the following affirmative answers to Question 3.2. It shows that the above method is not very fruitful for the binary case. Part (b) below can also be found in [11,Lem. 18].
Proof. In all given cases one easily verifies the left hand side of (3.2). The last part follows from (3.3).
The following case, where d = 2, is not fully covered by above considerations, but can easily be dealt with in a direct fashion.
Proof. We show that each maximal independent set is of the form {v + αe j | α ∈ Z q } for some v ∈ Z n q and some j, and where e j is the j-th standard basis vector. Suppose I is a maximal independent set containing the two distinct vertices v, w ∈ Z n q . Then d(v, w) < 2, and thus v, w differ in exactly one position. Without loss of generality let v 1 = w 1 . But then any other vertex contained in I, say z, satisfies d(z, v) = 1 = d(z, w), and therefore z also differs from v and w only in the first coordinate. As a consequence, maximality of I yields The proof shows that each maximal independent set of H q (n, 2) is the color class of a suitable coordinate coloring (based on n − 1 coordinates). However, this does not imply that each q n−1 -coloring is a coordinate coloring. We will see this explicitly in Example 4.5 below.
Since the chromatic number of any graph is always at least as large as the clique number, and cliques in H q (n, d) are codes in Z n q of distance d, an affirmative answer to Question 3.2 can be deduced from the existence of MDS codes. Recall that a q-ary code of length n, cardinality M , and distance d is called an (unrestricted) (n, M, d) qcode. The Singleton bound, see [6,Thm. 2.4.1], states that for such a code M ≤ q n−d+1 . Codes attaining this bound are called MDS codes, thus they are (n, q n−d+1 , d) q -codes. The existence of (unrestricted) MDS codes is a longstanding open problem for most parameters. We refer to the literature on details about the conjecture; see for instance [10] by Kokkala et al. and the references therein. We summarize the relation between existence of MDS codes and the chromatic number as follows.
Remark 3.7. If there exists an (n, q n−d+1 , d) q -code, then χ(H q (n, d)) = q n−d+1 because the MDS code in question forms a clique of size q n−d+1 in the Hamming graph. Again, this is only a sufficient condition for χ(H q (n, d)) = q n−d+1 . For instance, by Theorem 3.3 we have χ(H 2 (n, n − 1)) = 4 for all n, but there exists no (n, 4, n − 1) 2 -code for n > 3. The latter follows from the well-known non-existence of nontrivial binary MDS codes, but can also be deduced from the girth in Proposition 2.3(c). Similarly, we have seen already in Corollary 3.5(b) that χ(H 3 (n, n − 1)) = 9 for all n ≥ 2, but there exists no (n, 9, n − 1) 3 -code for n ≥ 5 thanks to the Plotkin bound [6, Thm. 2.2.1].
Of course, for a single Hamming graph, if not too big, one can determine its chromatic number, and actually its colorings, via its r-coloring ideal for given r. For a graph G = (V, E) this ideal is defined as where we associate independent indeterminates to the vertices of G. It is well knownand easy to see -that G is r-colorable if and only if In this case the zeros of I r (G) in C |V | correspond to the r-colorings of G (the ideal I r (G) is radical; see Hillar/Windfeldt [5,Lem. 3.2]). Using this method we obtain We will briefly return to the r-coloring ideal in the next section when considering all 4-colorings of H 2 (3, 2).
4 On the Minimal Colorings of H 2 (n, n − 1) In this section we study the 4-colorings of the graphs H 2 (n, n−1). Recall from Theorem 3.3 that these are indeed the minimal colorings. The motivation of this study arose from the following result by Alon et al. [2]. It has been proven already earlier by Greenwell/Lovász in [4], but Alon et al. provide an interesting new proof based on Fourier analysis on the group Z n q . In other words, the minimal colorings of H q (n, n) are exactly the coordinate colorings. It turns out that this is not the case for the Hamming graphs H q (n, n − 1) so that there are indeed more q 2 -colorings. We will show some small examples for q = 2 later in this section, and in Section 6 a 9-coloring of H 3 (4, 3) is given that is not a coordinate coloring.
The following notion will be central to our investigation.
is a proper k-coloring of G. In other words, (x, y) is a transition edge if we may swap the colors of x and y without destroying properness of the coloring. In this case, we call K the coloring obtained by swapping colors along the edge (x, y). We define as the transition space of the coloring K. For any x ∈ V we also define as the set of all neighbors of x that are adjacent to x via a transition edge.
We have the following simple characterization of transition edges. Then (x, y) is a transition edge for K iff x is the only neighbor of y with color K(x) and y is the only neighbor of x with color K(y). In other words, The number of transition edges of a given coloring may be regarded as a measure of robustness of that coloring in the sense that the coloring tolerates swaps of colors along such edges. We make this precise with the following notion.
Clearly, if k ≥ |V (G)| then rb k (G) = 1 because we may color each vertex differently. Now we are ready to consider some small examples. Using, for instance, the 4-coloring ideal from (3.4) one obtains the following 9 colorings of G. These are all colorings up to isomorphism. The first three rows represent the (1, 2)-, (1, 3)-, (2, 3)-coordinate colorings, respectively. The last 6 colorings are obtained from the coordinate colorings by swapping colors along a transition edge. For example, K 4 can be obtained from K 3 by swapping the colors of 011 and 101 or from K 2 be swapping the colors of 010 and 100. Similarly, K 5 can be obtained from K 3 by swapping the colors of 011 and 110 or from K 1 by swapping the color of 100 and 001. In the same way, each of K 6 , . . . , K 9 can be obtained from two different coordinate colorings by swapping colors along a certain transition edge. All of this shows that each minimal coloring of G is either a coordinate coloring or just one swap away from a coordinate coloring. In particular, each minimal coloring is even.
The following two figures display the graph with two different colorings and their transition edges shown in zigzag. The left one shows the (2, 3)-coordinate coloring (coloring K 3 ) and the right one shows coloring K 6 . Note that for the (2, 3)-coordinate coloring we have 8 transition edges, and they tile the graph in two 4-cycles (in the sense of Def. 5.1 later in this paper). In contrast, for coloring K 6 we only have 4 transition edges. Investigating all 9 minimal colorings we obtain rb(K i ) = 1 2 , for i = 1, 2, 3,   Figure 5. In this case one obtains an abundance of 4-colorings. We illustrate just a few particular phenomena. In addition to the 6 coordinate colorings we have for instance the colorings While the first one is an uneven coloring, the second one is even. Moreover, K 2 is more than one swap away from a coordinate coloring (of course, the uneven coloring K 1 cannot be obtained by any number of swaps from a coordinate coloring). Furthermore, one can check straightforwardly that coloring K 1 has 3 transition edges, and coloring K 2 has 8 transition edges. In addition, for K 2 one may move, for instance, 0000 into the first color class and/or 1111 into the second color class to obtain an uneven proper 4-coloring.
Similarly, moving 0000 to the third color class of K 1 leads to yet another uneven 4-coloring. color class and/or 1111 into the second color class to obtain an uneven proper 4-coloring.
Similarly, moving 0000 to the third color class of K 1 leads to yet another uneven 4-coloring. In Figure 6 we show the (1, 2)-coordinate coloring along with its transition edges. As for H 2 (3, 2) the latter tile the graph in 4-cycles (in the sense of Def. 5.1 later in this paper). In particular, it has 16 transition edges and thus highest robustness among all colorings discussed in this example.
We now return to the study of 4-colorings of general Hamming graphs H 2 (n, n − 1). As the examples above suggest, the coordinate colorings appear to be more robust (that is, have more transition edges) than other 4-colorings. We will see that this is indeed true for all Hamming graphs H 2 (n, n − 1). In the next section all maximally robust 4-colorings will be described explicitly. With one exception they are exactly the coordinate colorings.
Note that for binary Hamming graphs the edges carry a natural label. Indeed, we may assign the label x + y = x − y ∈ Z n 2 to the edge (x, y). For the following it is helpful to have this edge labeling in mind. Recall that the Hamming graph G := H 2 (n, d) is the Cayley graph of the group Z n q with generating set S d := {v ∈ Z n 2 | wt(v) ≥ d}. In other n Figure 5: H 2 (4, 3) In Figure 6 we show the (1, 2)-coordinate coloring along with its transition edges. As for H 2 (3, 2) the latter tile the graph in 4-cycles (in the sense of Def. 5.1 later in this paper). In particular, it has 16 transition edges and thus the highest robustness among all colorings discussed in this example. Recall from Definition 4.2 the set T x (K) of transition neighbors of a given vertex x. With above terminology we have As this identity indicates, the existence of such set B is quite a strong assumption. In particular, every vertex is incident to the same number of transition edges. In most cases the transition space of a coloring is not generated by a set B. We now return to the study of 4-colorings of general Hamming graphs H 2 (n, n − 1). As the examples above suggest, the coordinate colorings appear to be more robust (that is, have more transition edges) than other 4-colorings. We will see that this is indeed true for all Hamming graphs H 2 (n, n − 1). In the next section all maximally robust 4-colorings will be described explicitly. With one exception they are exactly the coordinate colorings.
Note that for binary Hamming graphs the edges carry a natural label. Indeed, we may assign the label x + y = x − y ∈ Z n 2 to the edge (x, y). For the following it is helpful to have this edge labeling in mind. Recall that the Hamming graph G := H 2 (n, d) is the Cayley graph of the group Z n q with generating set S d := {v ∈ Z n 2 | wt(v) ≥ d}. In other words, for all x, y ∈ Z n 2 we have x + y ∈ S d ⇐⇒ (x, y) ∈ E(G) ⇐⇒ (x + z, y + z) ∈ E(G) for all z ∈ Z n 2 . Recall from Definition 4.2 the set T x (K) of transition neighbors of a given vertex x. With above terminology we have As this identity indicates, the existence of such a set B is quite a strong assumption. In particular, every vertex is incident to the same number of transition edges. In most cases the transition space of a coloring is not generated by a set B. where 1 resp. 0 is at the i-th position. Then for any vertex x ∈ Z n 2 its set of neighbors in H 2 (n, n − 1) is given by Clearly, N (0) = S n−1 , with S d as in (4.1). Before describing the transition spaces of coordinate colorings we first derive an upper bound for the robustness of a 4-coloring of H 2 (n, n−1). The case n = 2 differs from n ≥ 3. Indeed, H 2 (2, 1) is the complete graph K 4 and thus each edge is a transition edge. As a consequence, its robustness is 1. From now on we will only be concerned with the case n ≥ 3. Proposition 4.9. Let n ≥ 3 and K be a proper 4-coloring of H 2 (n, n−1). Then |T x (K)| ≤ 2 for all x ∈ Z n 2 . As a consequence, rb(K) ≤ 2 n+1 with equality if and only if |T x (K)| = 2 for all x ∈ Z n 2 .
Proof. Fix any vertex x ∈ Z n 2 and consider its set of neighbors N (x), which consists of n + 1 ≥ 4 vertices; see (4.3). They can comprise at most 3 colors (those different from K(x)), and this means that there exist two neighbors that share a color. By Remark 4.3 only neighbors that do not share a color with another neighbor of x can be in T x (K). Since there are at most two colors that are not shared by distinct neighbors, we conclude For the second part we simply upper bound the number of transition edges. Since any edge is shared by two vertices we have immediately |T (K)| ≤ 2·2 n 2 = 2 n with equality iff |T x (K)| = 2 for all x ∈ Z n 2 . Moreover, Proposition 2.2(a) yields |E(H 2 (n, n − 1))| = (n + 1)2 n−1 . Now the statement follows from Definition 4.4.

13
Now we are ready to confirm what we have observed earlier in Example 4.6. The coordinate colorings are colorings with maximal robustness, that is, maximal number of transition edges. Proposition 4.10. Let n ≥ 3 and K be the (i, j)-coordinate coloring of H 2 (n, n − 1). Then T (K) = f i , f j and thus rb(K) = 2 n+1 . As a consequence, rb 4 (H 2 (n, n − 1)) = 2 n+1 .
Proof. Without loss of generality let (i, j) = (1, 2). Fix any vertex x ∈ Z n 2 . Since K is the (1, 2)-coordinate coloring, the neighbors x + 1, x + f 3 , . . . , x + f n have the same color, say A. Since n ≥ 3 these are at least two neighbors and therefore none of them can be incident to x via a transition edge. Furthermore, All of this shows that neither neighbor x + f 1 and x + f 2 shares a color with any other neighbor of x. Since this is true for all vertices x ∈ Z n 2 (and x = (x + f i ) + f i ), Remark 4.3 yields that (x, x + f 1 ) and (x, x + f 2 ) are the transition edges incident to x. Now (4.2) and Proposition 4.9 conclude the proof.
Remark 4.11. The previous result can be generalized to the coordinate colorings of general binary Hamming graphs H 2 (n, d). Precisely, let K be the (c 1 , . . . , c n−d+1 )-coordinate coloring of H 2 (n, d). Then one straightforwardly shows that This leads to the robustness rb(K) = n−d+1 . It is not clear whether this is the maximum robustness among all 2 n−d+1 -colorings of G.
In the next section we will describe explicitly the maximally robust 4-colorings of H 2 (n, n − 1).

Maximally Robust 4-Colorings of H 2 (n, n − 1)
A characterization of the maximally robust 4-colorings of H 2 (n, n−1) is derived in terms of their transition spaces and all these colorings are presented explicitly (up to isomorphism). In order to formulate these results, we need the following terminology. Now we are ready to present our main results. The first theorem provides a characterization of maximally robust colorings in terms of the transition spaces. The second theorem presents for each such transition space the unique coloring associated with it or shows that no such coloring exists. The proofs will be presented afterwards.
Recall from the paragraph right before Proposition 4.9 that the case n = 2 is trivial.
Theorem 5.2. Let n ≥ 3 and K be a 4-coloring of H 2 (n, n − 1). The following are equivalent. i) There exist v, w ∈ N (0) such that T (K) = v, w . ii) rb(K) = 2 n+1 . iii) The transition edges tile the graph in 4-cycles. If one, hence any of the above is true, then the coloring of a single 4-cycle uniquely determines the coloring of the entire graph.
Recall that if the transition space of a coloring is generated by a set B, then B is contained in N (0) = {1, f 1 , . . . , f n }. Therefore the requirement in i) that the vertices v, w be in N (0) is not a restriction.
Theorem 5.3. Let n ≥ 3 and K be a 4-coloring of H 2 (n, n − 1). 1) If T (K) = f i , f j for some 1 ≤ i < j ≤ n, then K is the (i, j)-coordinate coloring.
2) If T (K) = 1, f j for some j, then n is even and K is the coloring with color sets . As a consequence, any 4-coloring of H 2 (n, n − 1) with maximal robustness is even.
Note that Part 2) tells us that if n is odd, then sets of the form {1, f j } do not generate the transition space of a 4-coloring.
We prove the results in several steps and first need some preliminary results. Before doing so, let us point out that for any 4-coloring the graph H 2 (n, n−1) does not have cycles consisting of transition edges of length 3. For n ≥ 4 this is obvious by Proposition 2.3(c), while for n = 3 this can be verified via the Figures 3 and 4, which cover all 4-colorings of H 2 (3, 2) up to graph isomorphism. The following lemmas will lead to information about the existence, colors, and interrelation of 4-cycles consisting of transition edges.
Lemma 5.5. Let n ≥ 3 and let K be a 4-coloring of H 2 (n, n − 1). (a) Suppose there exists a path of length 3 consisting of transition edges and passing through the vertices x 1 , x 2 , x 3 , x 4 . Then the colors of x 1 , x 2 , x 3 , x 4 are distinct. (b) There exists no simple path in H 2 (n, n − 1) of length greater than 3 consisting of transition edges.
Proof. Both claims are easily verified if n = 3 as there are only 9 colorings to check; see Figure 2. Indeed, Figures 3 and 4 show (up to graph isomorphism) the only possible scenarios of transition edges. Thus we may assume n ≥ 4. (a) Since (x 1 , x 2 ), (x 2 , x 3 ), (x 3 , x 4 ) are transition edges, the only vertices that may share a color are x 1 and x 4 . Pick a vector y ∈ N (0) \ {x 1 + x 2 , x 2 + x 3 , x 3 + x 4 }. This is possible because n ≥ 3. By (4.1) the vertices x 2 + y and x 3 + y are adjacent. Since the girth is 4 thanks to Proposition 2.3(c), the choice of y implies that the vertices x 1 , x 2 , x 3 , x 4 , x 2 + y, x 3 + y are distinct. Thus we have the subgraph Since (x 1 , x 2 ) and (x 2 , x 3 ) are transition edges, we conclude K(x 2 + y) = K(x 4 ). In the same way K(x 3 + y) = K(x 1 ). Now the adjacency of x 2 + y and x 3 + y implies K(x 1 ) = K(x 4 ). All of this shows that x 1 , x 2 , x 3 , x 4 assume distinct colors. (b) Suppose there exists a path consisting of transition edges passing through the vertices x 1 , . . . , x 5 , and where x i = x j for i = j. From Part (a) we know that x 1 , x 2 , x 3 , x 4 have distinct colors and the same is true for x 2 , x 3 , x 4 , x 5 . Thus we conclude K(x 1 ) = K(x 5 ). Consider the vertex x 2 + x 3 + x 4 , which is adjacent to x 2 and x 4 by (4.1). Thus we have The fact that the upper row consists of transition edges implies that x 2 + x 3 + x 4 must equal x 1 or x 5 for otherwise there is no color left for x 2 + x 3 + x 4 . Assume without loss of generality that contradicting the fact that (x 4 , x 5 ) is a transition edge. Thus we have shown that no such path exists.
By the previous lemma there are no cycles of length greater than 4 in H 2 (n, n − 1) consisting of transition edges. The next lemma provides information about cycles of length 4 consisting of transition edges. Proof. Consider the given 4-cycle with its opposite vertices (a) follows from Lemma 5.5(a).
In the same way one shows that y cannot be adjacent to two opposite vertices of the 4-cycle. Assume now y ∼ x 1 . Then, again, because (x 1 , x 2 ) and (x 1 , x 4 ) are transition edges, y must have color K(x 3 ) = K(x 1 ).
Now we are ready to prove the main theorems. Proof of Theorem 5.2. i) ⇒ ii) follows from Proposition 4.9. ii) ⇒ iii) Example 4.5 tells us that the only colorings of H 2 (3, 2) with maximal robustness are the coordinate colorings. Therefore the implication is easily verified for n = 3; see Figure 3. Thus let n ≥ 4 and hence girth(H 2 (n, n − 1)) = 4 due to Proposition 2.3(c). Thanks to Proposition 4.9 we have |T x (K)| = 2 for all x ∈ Z n 2 , that is, every vertex is incident to exactly two transition edges. The finiteness of the graph then implies that every vertex is on a unique cycle consisting of transition edges, and due to Lemma 5.5(b) all these cycles have length 4. iii) ⇒ i) Let (0, v), (v, z), (z, w), (w, 0) be the 4-cycle consisting of transition edges containing the vertex 0. From Lemma 5.4 we obtain v = w + z, thus z = v + w. This shows that T x (K) = x + {v, w} for x ∈ {0, v, w, z}. Note also that wt(v), wt(w) ≥ n − 1.
Let now x ∈ V (H 2 (n, n − 1)) \{0, v, w, z} be any other vertex. We have to show that T x (K) = x + {v, w}. We consider two cases. Case 1: x is adjacent to one of the vertices {0, v, w, z}. In this case it is adjacent to exactly one of these vertices thanks to Lemma 5.6(b). Without loss of generality we may assume x ∼ 0, which then implies wt(x) ≥ n − 1. Then by (4.1) is a 4-cycle in H 2 (n, n − 1). It can be thought of as a shift by x of the original cycle. Again by (4.1) we obtain that x + y ∼ y for y ∈ {0, v, w, z}. Thus we have the subgraph x Now Lemma 5.6(b) tells us that Using that x ∼ 0 we see that x has neighbors of the three distinct colors K(0), K(w), K(v). Now we can identify the transition edges incident to x. The fact that T 0 (K) = {v, w} tells us that (x, 0) is not a transition edge. But then x cannot be incident to any transition edge (x, y) such that K(y) = K(0). Since K(v) and K(w) are neighboring colors of x and by assumption x is on a 4-cycle consisting of transition edges, we conclude that (x, x + v) and (x, x + w) are the transition edges incident to x. Thus T x (K) = x + {v, w}. By generality of x all edges in the cycle (5.3) are transition edges. Note also that the coloring of the cycle (5.3) is uniquely determined by (5.4). Case 2: x is not adjacent to any vertex of the original 4-cycle. As we have shown in Proposition 2.2(e) the graph H 2 (n, n − 1) is connected and therefore there exists a path from 0 to x. Assume the vertices of this path are 0, y 1 , . . . , y t = x. With the aid of this path, we can now translate the original cycle across the graph and obtain new 4-cycles consisting of transition edges and whose colors are uniquely determined by the coloring of the original 4-cycle. Case 1 guarantees that in each step we obtain T y i (K) = y i + {v, w}. Thus we conclude T x (K) = x + {v, w}, as desired. This part also showed that the coloring K is uniquely determined by a single 4-cycle, and thus the proof is complete. 2 Proof of Theorem 5.3. 1) From Theorem 5.2 we know that there exists (up to isomorphism) at most one 4-coloring K such that T (K) = f i , f j . Now the result follows from Proposition 4.10.
2) In what follows the parity of the Hamming weight will play a central role, and so we introduce wt 2 (x) := wt(x) mod 2 ∈ Z 2 for any x ∈ Z n 2 and thus compute with these weights modulo 2. Recall that in Z n 2 we have wt(x + y) = wt(x) + wt(y) − 2 {i | x i = 1 = y i } , and therefore wt 2 (x + y) = wt 2 (x) + wt 2 (y) for all x, y ∈ Z n 2 . (5.5) We will also compute modulo 2 with the indices of the set A ν µ introduced in the theorem. Case 1: Assume n is even. By Theorem 5.2 and Lemma 5.6(a) there is at most one coloring K such that T (K) = 1, f j . Thus it suffices to verify that the given K satisfies the statements. First of all, it is clear that the sets A ν µ are pairwise disjoint and partition the vertex set Z n 2 . Next, since n is even, we have wt 2 (1) = 0 and wt 2 (f i ) = 1 for all i = 1, . . . , n. This allows us to describe the behavior of the sets A ν µ along edges of the graph. Indeed, (5.5) leads to for all ν, µ ∈ Z 2 . This shows that the sets A ν µ are independent and thus form the color classes of a proper 4-coloring, say K. It remains to show that T x (K) = x + {1, f j } for all x ∈ Z n 2 . Due to (5.6) the vectors 1 and f j induce 4-cycles in H 2 (n, n − 1) of the form Furthermore, the last case in (5.6) tells us that the only other neighbors of a vertex in A ν µ are in A ν+1 µ+1 and thus all have the same color. Since this color is different from the neighboring colors in the cycle, the edges in these 4-cycles are indeed all the transition edges of K, that is, T (K) = 1, f j . Identity (5.6) shows that the sets A ν µ all have the same cardinality and hence K is an even coloring. Case 2: Assume n is odd. We have to show that there is no proper 4-coloring with transition space 1, f j . Without loss of generality let j = n. It will be beneficial to work again with the vertex partition Z n 2 = A 0 0 ∪ A 0 1 ∪ A 1 0 ∪ A 1 1 (which are not color classes at this point). As n is odd we have for all ν, µ ∈ Z 2 Thus 1, f j induces 4-cycles with vertices in the sets A ν µ as follows (5.9) Theorem 5.2 tells us that this determines uniquely the coloring of each other transition 4-cycle (and thus of every vertex), and Lemma 5.6 specifies how this is done. In order to describe this precisely, the following sets will be helpful. For ν, µ ∈ Z 2 and i = 0, . . . , n define This shows that the vertices in the 4-cycles in (5.8) specify to f n 1 1 f n (5.11) The cycles on the left (resp. right) hand side exist only if i is even (resp. odd). Let n = 2t + 1. We claim that the sets B ν µ (i) attain the following colors: K(B 0 0 (i)) = A, K(B 1 0 (n − 1 − i)) = A, K(B 1 1 (n − i)) = B, K(B 0 1 (i + 1)) = B, K(B 1 1 (i + 1)) = C, K(B 0 1 (n − i)) = C, K(B 0 0 (n − 1 − i)) = D, K(B 1 0 (i)) = D, for all 0 ≤ i ≤ t. (5.12) If we can prove this, we arrive at a contradiction because B 0 0 (t) = B 0 0 (n − 1 − t). In order to prove (5.12) we induct on i. For i = 0 we have and (5.9) establishes the left hand column of (5.12). The sets in the right hand column are all empty for i = 0. Let us now assume (5.12) for all i < i . Suppose i is even and let v ∈ B 0 0 (i ). Let α ∈ {1, . . . , n−1} be such that v α = 1. Then w := v+f α ∈ B 0 1 (n+1−i ) = B 0 1 (n−(i −1)). This means that w is the top vertex of a cycle as on the right hand side in (5.11), whereas v is the top vertex of a cycle as on the left hand side. These two cycles are obtained by a shift with f α . By assumption we know that the vertices of the right hand cycle assumes the colors C, D, A, B counterclockwise with K(w) = C. Now Lemma 5.6 establishes the colors of the left hand cycle as in the first column of (5.12). The same reasoning applies to the case where j is odd, in which one starts with an arbitrary element in B 1 0 (i ). This concludes the proof. 2

20
In this section we briefly address further questions pertaining to the coloring of the Hamming graphs.
Question 6.1. First of all, it remains to answer Question 3.2 for the cases not covered in Section 3.
Question 6.2. Can one describe the maximally robust 2 n−d+1 -colorings of H 2 (n, d)? Are their transition spaces generated? Remark 4.11 is but a first step in this direction. Question 6.3. From Corollary 3.5 we know that χ(H q (n, n−1)) = q 2 for all q ≥ 3 and all q 2 -colorings are even. Can one derive further information about these minimal colorings?
Not surprisingly, just as in the binary case not all minimal colorings are coordinate colorings. Here is a 9-coloring of H 3 (4, 3) that is not a coordinate coloring. Consider the independent set I := {x ∈ Z 4 3 | wt(x) ≤ 1} and the linear MDS code (see Remark 3.7 and the paragraph preceeding it) C = rowspace 0 1 1 1 1 0 1 2 := {a(0111) + b(1012) | a, b ∈ Z 3 } ⊆ Z 4 3 . (6.1) Then each of the shifts v + I, v ∈ C, is clearly an independent set, and these shifts are pairwise disjoint. Thus they form the color classes of a 9-coloring that is not a coordinate coloring. Note that I is the set of coset leaders of the code C (that is, each v ∈ I is the unique vector of smallest weight in the coset v + C, and these cosets partition Z 4 3 ). In fact, C is a perfect code, see [6,Sec. 1.12]. This example thus generalizes whenever we have a linear perfect MDS code over a finite field. The latter are exactly the Hamming codes with parameter r = 2, hence the q-ary Hamming codes of length n = q + 1, dimension q − 1, and distance d = 3 and where q is a prime power and the alphabet the finite field F q of order q; see for instance [6,Thm. 1.12.3]. As a consequence, we obtain a q q−1 -coloring of H q (q + 1, 3) that is not a coordinate coloring. As before, the color classes are the shifts of the independent set {x ∈ F q+1 q | wt(x) ≤ 1}. Incidentally, the example above can be utilized to create an uneven 27-coloring of H 3 (5, 3) (recall however, that it is not clear whether this graph has chromatic number 27). Using C as in (6.1) we define the setŝ Then J is an independent set of cardinality 11 (showing that the upper bound in Theorem 3.4(b) is attained for H 3 (5, 3)), and B 1 and B 2 are independent sets of size 8. It is straightforward to see that the 27 sets v + J , v + B 1 , v + B 2 , where v ∈Ĉ, form a partition of Z 5 3 and thus serve as the color classes of an uneven 27-coloring. Question 6.4. Do the q n−d+1 -colorings of H q (n, d) for q ≥ 3 have transition edges?