Anagram-free Graph Colouring

An anagram is a word of the form $WP$ where $W$ is a non-empty word and $P$ is a permutation of $W$. We study anagram-free graph colouring and give bounds on the chromatic number. Alon et al. (2002) asked whether anagram-free chromatic number is bounded by a function of the maximum degree. We answer this question in the negative by constructing graphs with maximum degree 3 and unbounded anagram-free chromatic number. We also prove upper and lower bounds on the anagram-free chromatic number of trees in terms of their radius and pathwidth. Finally, we explore extensions to edge colouring and $k$-anagram-free colouring.


Introduction
A square is a word of the form W W where W is a non-empty word. A word X is square-free if no subword of X is a square. Much of the study of squares involves avoiding squares or, equivalently, characterising the set of square-free words. An early result in this area is the construction, by Thue [22], of arbitrarily long square-free words on three symbols. More recently, Alon et. al. [1] generalized the concept of square-free words to graph colouring by requiring colourings to avoid square sequences along subpaths of a graph. A vertex colouring of a graph G is a function f : V (G) → C where C is a set of colours and V (G) is the vertex set of G. A vertex colouring of a graph G is square-free if the sequence of colours on each subpath of G is not a square. The square-chromatic number of a graph G is the minimum number of colours in a square-free colouring of G. Square-free graph colouring has been extensively studied and is often referred to as nonrepetitive colouring [3,11,13]. The square-free chromatic number of G is denoted π(G) and is also known as the Thue number or nonrepetitive chromatic number. With this notation, Thue's result is π(P ) 3 for every path P .
In this paper we introduce anagram-free graph colouring, which is a topic suggested for study by Alon et. al. [1]. This definition follows naturally from the established notion of anagrams in combinatorics on words [4]. An anagram is a word of the form W 1 W 2 where W 1 is a non-empty word and W 2 is a permutation of W 1 . A word is anagram-free if it contains no anagram as a subword. An anagram is also called an abelian square and an anagram-free word is also called an abelian square-free word or a strongly non-repetitive sequence. Our generalization to graph colouring follows the example set by square-free colouring. A vertex colouring of a graph G is anagram-free if the sequence of colours on each subpath of G is not an anagram. The anagram-free chromatic number of G is the minimum number of colours in an anagram-free colouring of G, denoted by φ(G).
Results analogous to Thue's exist for anagram-free words. Anagram-free words on three symbols have length at most 7, for example abcbabc [5]. Kerän [16,17] constructed anagram-free words of arbitrary length on four symbols. In the context of anagram-free graph colouring, Keränen's result is φ(P ) 4 for every path P . Throughout this paper we prove bounds on φ that demonstrate significant differences in the behaviour of φ and π. This is somewhat surprising considering the similarity of Keränen's and Thue's results.

Bounding by maximum degree
An area of study central to square-free colouring is bounding π(G) by functions of the maximum degree, ∆(G). Alon et. al. [1] proved a result that implies π(G) c∆(G) 2 for some constant c. Several subsequent works improved the value of c [9,12,14] with the best known value being c = 1 + o(1) [8]. Earlier proofs use the Lovász Local Lemma while the proof in [8] uses entropy compression.
Alon et. al. [1] states as an open problem whether φ is bounded by a function of maximum degree. We answer this question, thus finding the first significant difference between π and φ. We prove that, unlike π, no function of maximum degree is an upper bound on φ.
Theorem 1. Graphs of maximum degree 3 have unbounded anagram-free chromatic number.
Theorem 1 complements the result of Richmond and Shallit [19] regarding enumeration of anagrams. They counted anagrams with the aim of using the Lovász Local Lemma to prove that φ is bounded on paths. They concluded that the probability that a random word is an anagram is too large for this approach. A proof using the Lovász Local Lemma that φ is bounded on paths would likely apply to graphs of maximum degree 3, which Theorem 1 shows is impossible.
We also consider variations of square-free colouring and apply them to anagram-free colouring. An edge colouring of a graph is an assignment of colours to the edges of the graph. An edge colouring of G is square-free if every subpath of G has a square-free colour sequence along its edges. Alon et. al. [1] defined the square-chromatic index, denoted π ′ (G), as the minimum number of colours in a square-free edge colouring of G. We define anagram-free edge colouring similarly. An edge colouring of a graph G is anagram-free if every subpath of G has an anagram-free colour sequence along its edges. The corresponding anagram-free chromatic index is denoted φ ′ (G).
The obvious bound, φ ′ (G) ∆(G), follows from the observation that edges incident to a common vertex receive distinct colours in an anagram-free edge colouring. We prove a significant improvement on this bound with the following result.
Theorem 2. Trees of maximum degree 3 have unbounded anagram-free chromatic index.
Theorem 2 is for a more restricted class of graphs than Theorem 1, so Theorem 2 says more about φ ′ than Theorem 1 does about φ. The degree bound of 3 in Theorems 1 and 2 is best possible since φ(P ) 4 for all paths P , which implies φ(C) 5 for all cycles C. Indeed, to anagram-free 5-colour a cycle assign one vertex a unique colour and then anagram-free 4-colour the remaining vertices. The proof that φ ′ (C) 5 is analogous. Whether this bound can be improved to 4 is an open problem. The analogous problem for square-free colouring was solved by Currie [6], who showed that π(C) 3 for every cycle with the exception of order 5, 7, 9, 10, 14 and 17.

Bounding φ with given radius or pathwidth
Our initial bounds for φ and φ ′ motivate further study of φ for trees. First, note that Brešar et. al. [2] proved that π(T ) 4 for every tree T . In contrast, we prove the following: Theorem 3. Trees have unbounded anagram-free chromatic number.
We also study φ for trees as a function of radius. The radius of a tree T is the minimum, taken over all vertices v in T , of the maximum distance of a vertex from v. Such a vertex v is called a centre of T . We obtain the following tight bound on φ as a function of radius.
Theorem 4. Every tree T of radius h has φ(T ) h + 1. Moreover, for every h 0 there is a tree T of radius h such that φ(T ) h.
The bound in Theorem 4 is poor for paths since the radius of a path is roughly half its length. To address this, we prove a bound on φ for trees that is bounded for paths. To do so we use pathwidth, which is a well studied parameter in square-free colouring [8,10] as well as more generally. Let pw(T ) denote the pathwidth of a tree T .
Theorem 5. For every tree T , φ(T ) 4 pw(T ) + 1. Moreover, for every p 0 there is a tree T such that φ(T ) p pw(T ).
Note that since every tree T on n vertices has pathwidth O(log n), Theorem 5 implies that φ(T ) O(log n). It is open whether φ(G) 5 for graphs of pathwidth 1 because not all trees of pathwidth 1 are paths.

k-anagram-free colouring
We also consider the k-power generalisation of square-free colouring and apply it to anagramfree colouring. A k-power is a word W k where W is a non-empty word, for k 2. In this setting a square is a 2-power. A k-power-free colouring is a colouring avoiding paths with k-power colour sequences. This definition can be applied for vertex or edge colouring. The corresponding k-power-free chromatic number is π k (G) and the k-power-free chromatic index is π ′ k (G) [11]. In this paper, we introduce k-anagram-free colouring. k-anagrams, often called abelian k-powers, are an established object of study in combinatorics on words [7]. An k-anagram is a word W 1 W 2 . . . W k where each W i is a permutation of a non-empty word W , for k 2. A colouring of a graph G is k-anagram-free if the sequence of colours on each subpath of G is not a k-anagram. We apply this definition to both vertex and edge colourings. The corresponding k-anagram-free chromatic number is denoted by φ k (G) and the k-anagramfree chromatic index is denoted by φ ′ k (G). Every k-anagram contains an (k − 1)-anagram so a k-anagram-free colouring it is also (k + 1)-anagram-free. Thus, for every graph G, with an analogous expression for φ ′ k . Therefore we can immediately apply upper bounds for φ and φ ′ to φ k and φ ′ k respectively. With this in mind we first study lower bounds of φ k and φ ′ k and start by studying bounds as a function of maximum degree. We prove the following generalisation of Theorem 1.
Theorem 6. For k 2, k-anagram-free chromatic number is unbounded on graphs of maximum degree k + 1.
Theorem 1 is implied by Theorem 6 with k = 2. Note that the degree bound in Theorem 6 depends on k and it is open whether such a result holds for a degree bound independent of k. We also investigate upper bounds for k-anagram-free colouring and prove the following contrasting result. Theorem 7. If k 4 then φ k (T ) 4 and φ ′ k (T ) 4 for every tree T . This result is somewhat surprising given Theorems 1 and 3 which say that φ 2 and φ ′ 2 are unbounded on trees. Theorem 7 leaves a gap at k = 3, which motivates the question of whether φ 3 and φ ′ 3 are bounded on trees. We have upper bounds for φ 3 on trees, in terms of radius and pathwidth, due to Equation (1) and Theorems 4 and 5. We prove a similar upper bound for φ ′ 3 in the following theorem. Theorem 8. For every tree T , φ ′ 3 (T ) 4 pw(T ). These bounds for φ 3 and φ ′ 3 depend on pathwidth or radius. The question of whether φ 3 and φ ′ 3 are bounded on trees is an open problem. We also give tighter bounds than those in Theorem 7 for larger values of k. We improve the bound to 3 for k 6 and to 2 for k 8 by using results on 3-anagram-free and 4anagram-free words [7].

Lower Bounds
In this section we prove lower bounds for φ and φ ′ . Most of these bounds depend upon counting the occurrence of colours in each half of a path, which motivates the following definition. A colour multiset of size n on c colours is a multiset of size n with entries from [c] where [c] := {1, 2, . . . , c}. Let M n,c be the set of colour multisets of size n on c colours. Note that |M n,c | equals the number of ways to place n unlabelled balls in c labelled boxes, which is well known to equal n+c−1 c−1 ; see [20, Section 1.9]. We give a weaker bound by noting that the number of occurrences of each colour is in {0, 1, . . . , n}, therefore This simple bound suffices for our needs because we only require that, once c is fixed, |M n,c | is bounded by a polynomial in n. For a coloured graph G, let M (G) be the multiset of colours that occur in G and call M (G) the colour multiset of G. A c-colouring of a graph G is a colouring of G, either for vertices or edges, where the colour set has size c.
We intentionally allow the definition to apply to edge or vertex colouring and in each case the usage will be clear from the context. The function M is useful for the analysis of anagram-free colouring. Note that a vertex coloured path v 1 , . . . , v 2i is an anagram if and only if Similarly, for i 1, an edge coloured path v 1 , . . . , v 2i+1 is an anagram if and only if The indices in these equations highlight a distinction between φ and φ ′ . In a vertex colouring only the paths of even order can be anagrams. However, in an edge colouring only the paths of even length can be anagrams.

Edge colouring
We start with the proof of Theorem 2, which says that φ ′ is unbounded on trees of maximum degree 3. The proof uses the fact that the number of leaves in a complete binary tree grows exponentially with height while, for fixed c, |M n,c | is bounded by a polynomial in n. We then associate colour multisets to leaves and show that the tree contains an anagram if two leaves share a colour multiset. A complete binary tree is a rooted tree such that every non-leaf vertex has two children and the leaves have equal distance to the root. Proof. Fix c 1 and choose h ∈ Z + so that 2 h > (h + 1) c . Let T be the rooted complete binary tree of height h with root vertex r. Fix an arbitrary edge c-colouring of T . By our choice of h and Equation (2) Since each root-to-leaf path in T has h edges, the number of leaves in T is greater than the number of distinct colour multisets on root-to-leaf paths in T . Therefore there are two leaves, p and q, such that M (P ) = M (Q) where P is the rp-path and Q is the rq-path. As illustrated in Figure 1. Let v be the least common ancestor of p and q. Split these paths into three disjoint parts by defining R as the rv-path, P ′ as the vp-path and Q ′ as the vq-path. Note that E(R) is exactly the set of edges shared by P and Q. Therefore Thus M (P ′ ) = M (Q ′ ). Finally, note that P ′ ∪ Q ′ is a path and so T contains an anagram.

Vertex colouring
Using the line graph construction, φ is unbounded on graphs of maximum degree 4 as a corollary of Theorem 2. The line graph of a graph G, denoted L(G), is the graph with V (L(G)) = E(G) and an edge between vertices of L(G) which are incident to a common vertex in G. It is well known that for ordinary graph colouring χ ′ (G) = χ(L(G)). We have a similar relation for anagram-free colouring, however, equality does necessarily not hold. Line graphs satisfy φ ′ (G) φ(L(G)) because every paths edge sequence G correspond to a path L(G). Theorem 2 says φ ′ is unbounded for trees of maximum degree 3 and, for these trees, L(T ) has maximum degree at most 4. Also, as we have just shown, φ ′ (T ) φ(L(T )). Therefore φ is unbounded on graphs of maximum degree 4. Keränen's result [16] implies φ(G) 5 for graphs of maximum degree 2, thus there is a gap which motivates study of φ on graphs of maximum degree 3.
We prove Theorem 1, that φ is unbounded on graphs of maximum degree 3, with a method similar to the proof of Theorem 2. We construct a graph with an exponential number of leaves, associate each leaf to a colour multiset and show that the graph contains an anagram if two leaves share a colour multiset.
Theorem 1. Graphs of maximum degree 3 have unbounded anagram-free chromatic number.
Proof. Let c 1 and let h ∈ Z + be odd such that 2 (h+1)/2 > (h + 2) c . Let T be the rooted tree, with root r, such that: • vertices of depth h are leaves, • vertices of even depth have two children, • non-leaf vertices of odd depth have one child, where the depth of a vertex is its distance from the root. Let G be the graph obtained from T by adding an edge between every pair of vertices in T that share a parent, as illustrated in Figure 2.
p q Figure 2: The graph G with h = 5, a vertex 3-colouring. Vertces p and q have the same colour multiset so the pq-path is an anagram.
Fix an arbitrary c-colouring of G. We now show that G contains an anagram. By Equation (2) and our choice of h, So, because each root-to-leaf path in T has h + 1 vertices, the number of leaves in T is greater than the number of distinct colour multisets on root-to-leaf paths in T . Therefore there are two leaves, p and q in T , such that M (P ) = M (Q) where P and Q are the rp-path in T and rq-path in T respectively. Split the two paths into three vertex-disjoint ] is a path. Therefore G contains an anagram.
Theorem 1 only proves that φ is unbounded on graphs of maximum degree 3 without further reference to their structure. We prove below that φ is unbounded on trees. A particularly interesting question is whether there is a result analogous to Theorem 2: is φ bounded on trees of maximum degree 3? This motivates further investigation of φ on trees.

Vertex colouring trees
We now prove lower bounds for anagram-free vertex colourings of trees. These bounds follow from the following theorem. The complete d-ary tree of height h is the rooted tree such that every internal vertex has d children and all leaves are of distance h from the root. Proof. Let T be the complete d-ary tree of height h with root r. Let L be the leaves of T and fix an arbitrary c-colouring of T .
For each v ∈ L let S v be the sequence of colours on the rv-path. There are at most c h such colour sequences since each has length h + 1 and they share an initial colour (the colour of the root). Since |L| = d h there is a set C ⊆ L of size at least d h /c h such that S v = S w for all v, w ∈ C. Thus C is a large set of leaves that have equal colour sequence on each root-to-leaf path. As illistrated in Figure 3.
Let R be the subtree of T induced by the set of all ancestors of leaves in C. The remainder of the proof is concerned with finding an anagram in R. Observe that if two vertices of R have the same depth, then they also have the same colour. Define a level as a maximal set of vertices in R that all have equal depth. R is coloured by level. Denote the levels l 0 , l 1 , . . . , l h where l 0 = {r}. A level of R is bad if every vertex in the level has exactly one child in R. A level is good if it is not bad. Note that only level l h contains vertices with no children. Let g be the number of good levels and b be the number of bad levels. Then h + 1 = g + b. We now prove that there are at least c + 1 good levels and so at least two good levels share a colour.
We bound the number of bad levels by considering the number of good levels required to obtain at least (d/c) h leaves. If l i is bad then |l i | = |l i+1 | and if l i is good then |l i | d #preceding good levels since l h is the final good level, it is preceded by g − 1 good levels. Thus By assumption, d c+1 d h+1 c −h which is at most d g . Thus c + 1 g, there are two good levels with the same colour.
Let l a and l b be two good levels that have the same colour and, without loss of generality, let a < b. Let v ∈ l a be a vertex with at least two children. All vertices in the levels between l a and l b have at least one child so there are two vertices u, w ∈ B such that v is their least common ancestor.
Vertices p 0 and q n are in levels l a and l b respectively so they have the same colour. Thus M (p 1 , p 2 , . . . , p n ) = M (q 0 , q 1 , . . . , q n−1 ). Therefore p 0 , p 1 , . . . , p n−1 , p n , q n−1 , . . . , q 1 is an anagram. Theorem 9 implies Theorem 3, that φ is unbounded on trees, but it has uses beyond this result because it gives us control over the radius and maximum degree of the resulting trees. In particular, it implies the following two theorems each of which correspond to an extreme of radius or maximum degree.
Therefore the complete c c+1 -ary tree of height c + 1 does not have an anagram-free ccolouring.
Theorem 11. For every integer d ′ 1 there exists a tree T with maximum degree d ′ such that φ(T ) d ′ − 1.

Proof. Fix c and choose h so that
Thus Theorem 9 is satisfied with d = c+1. Therefore the complete (c+1)-ary tree of height h does not have an anagram-free c-colouring. This tree has maximum degree d ′ = c + 2 and so φ(T ) c + 1 = d ′ − 1.

Upper bounds for φ on trees
In this section we complement the results of the previous section with some upper bounds for φ on trees. Our first bound comes from centred colouring. A vertex colouring of a graph G is centred if every subtree T of G contains a vertex whose colour appears exactly once in T . Centred colourings are anagram-free since every anagram contains an even number of occurrences of each colour and in a centred colouring every path contains a colour that occurs exactly once. Therefore, for every graph G, the centred chromatic number of G is an upper bound on φ(G). It is easily seen that every tree T of radius h has centred chromatic number at most h + 1, see [18, Section 6.5], thus φ(T ) h + 1. This bound completes the first half of Theorem 4 and is attained by colouring each vertex by its distance from a centre of T . The second half of Theorem 4 follows from Theorem 10 and an inspection of the trees of radius 0 or 1.
We now work towards proving Theorem 5, which bounds φ by a function of pathwidth. While pathwidth is defined in terms of path decompositions, the only property we require is the following lemma.
We also require two trivial properties of pathwidth. The first is that edgeless graphs have pathwidth 0 and the second is that the pathwidth of a disconnected graph is the maximum pathwidth over each of its components. Theorem 13. Every tree of pathwidth m has an anagram-free vertex (4m + 1)-colouring.
Proof. The proof is an induction on m. The base case holds because every tree T of pathwidth 0 is edgeless and thus anagram-free 1-colourable. Now assume that every tree with pathwidth p m is anagram-free vertex (4p + 1)-colourable.
Let T be a tree of pathwidth m + 1. By Lemma 12, there exists a path P ⊆ T such that pw(T − V (P )) m. Each component of T − V (P ) has pathwidth at most m. By induction we may anagram-free colour each component of T − V (P ) with a common set of 4m + 1 colours. Then use four additional colours to anagram-free colour P , by [17].
We now show that this colouring is anagram-free. Let Q be a path in T . If Q is entirely contained within a component of T − V (P ), then by induction, Q is not an anagram. Otherwise, Q intersects P . The intersection of Q and P is an anagram-free subpath of P and the colours in Q ∩ P occur nowhere else in Q. Therefore Q is not an anagram.
We now use Theorems 13 and 10 to prove Theorem 5.
Theorem 5. For every tree T , φ(T ) 4 pw(T ) + 1. Moreover, for every p 0 there is a tree T such that φ(T ) p pw(T ).
Proof. The first part follows directly from Theorem 13. For the second part it is well known, and easily proved, that the pathwidth of a tree is at most its radius. Therefore, by Theorem 10, there exists a tree T with φ(T ) p pw(T ) for all p 2. For the remaining cases use the path of order 2 for p = 1 and the empty graph for p = 0.
The main open problem that arises from the above results is whether φ is bounded for trees of maximum degree 3. The complete binary tree of height h is the key example. Centred colourings provides a trivial upper bound of h + 1 (Theorem 4). We now give a non-trivial colouring of the complete binary tree to demonstrate that the bound from centred colouring is not best possible. and T t ⊆ T be the complete binary tree of height t with root r. T t is the top half of T , which we colour directly. Let b := h − t − 1, this is the height of each subtree which will be coloured by induction. Colour T t as follows: • All vertices with even depth receive the same colour. Call this colour c.
• Each odd level is allocated distinct set of two colours. Vertices of odd depth are coloured with one of the two colours allocated to their level, so that each vertex receives a colour different from their sibling.
Note that the leaves of T t have even depth so have colour c. This colouring is shown for h = 8 in Figure 4.
Colour each remaining subtree of T by induction, avoiding colours that occur on their ancestors in T t .
Claim. This colouring of T is anagram-free. Proof. Let P be a path in T with even order at least 2. Let u be the shallowest vertex in P . If u / ∈ V (T t ) then, by induction, P is not an anagram. Now consider the case where u ∈ V (T t ). If u has odd depth then its colour is unique in P . Indeed, in T t the colour of u only occurs in the level of u and in T − V (T t ) the ancestors of u avoid its colour. Similarly, if u has even depth and u is an endpoint of P then the child of u in P is uniquely coloured in P .
The remainder of the proof is concerned with the case where u ∈ V (T t ), u has even depth and neither endpoint of P is u. Let x 1 , x 2 ∈ V (P ) be the endpoints of P and let v 1 , v 2 ∈ V (P ) be the children of u such that v i is an ancestor of x i for i ∈ [2]. If both then v 1 (and indeed v 2 ) is uniquely coloured in P . In the remaining cases at least one of x 1 and x 2 are in V (T t ).
Without loss of generality let x 1 ∈ V (T t ). If x 2 / ∈ V (T t ) then x 1 is uniquely coloured in P . If x 2 ∈ V (T t ) then the colour c occurs an odd number of times in P . Indeed, u has colour c and x 1 , x 2 ∈ V (T t ) implies that both the v 1 x 1 -path and the v 2 x 2 -path contain the same number of vertices with colour c.
To complete the proof we show that this colouring satisfies Equation (3). Our colouring of T t uses t + 1 colours as the even levels share a colour and there are t 2 odd levels which each use 2 colours.
Let v be a child of a leaf of T t and T b be the subtree of T rooted at v. Recall that colours on the vr-path do not occur in T b . The number of distinct colours on the vr-path is t 2 + 1 because the path contains t + 1 vertices and t 2 + 1 of them have even depth so share colour c. Therefore the colouring of T b can reuse t 2 of the colours used to colour T t . So our colouring of T requires φ(T b ) − t 2 colours in addition to those used to colour T t . So

k-anagram-free colourings
Recall that a k-anagram consists of k independently permuted copies of a word. In terms of colour multisets, a word We defined k-anagram-free colouring as a generalisation of anagram-free colouring. Recall that φ k (G) and φ ′ k (G) are the k-anagram-free chromatic number and index respectively. In this section we show that φ k is unbounded on graphs of maximum degree k + 1 and that φ 4 and φ ′ 4 are bounded on trees. The first result is a generalisation of Theorem 1, that φ is unbounded on graphs of maximum degree 3. The second result contrasts with Theorems 2 and 3 because it shows a shift in behaviour from unbounded to bounded as k increases.

Lower bounds
We now prove Theorem 6, which says that φ k is not bounded by a function of maximum degree. The method is similar to that used in Theorem 1 to prove φ is not bounded by maximum degree. For each k and c we recursively construct a graph G such that every c-colouring of G contains a k-anagram. The proof generalises the k = 2 case in the sense that Theorem 1 is implied by Theorem 6.
Theorem 6. For k 2, the k-anagram-free chromatic number is unbounded on graphs of maximum degree k + 1.
Proof. Let S(t) be the statement that there exists a graph G with ∆(G) k + 1 and special vertices u and v with deg(u) = deg(v) = 1 such that for every vertex colouring of G at least one of the following holds: • G contains a k-anagram, or where D is the set of colour multisets on uv-paths with length 4t.
Claim. S(t) is true for all t 1.
Proof. We proceed by induction on t. First we prove S(1). Let G be the graph obtained from a path P of order k by adding vertices a and b, each adjacent to every vertex in P . Add vertices u and v to G as well as edges ua and vb. Note that G satisfies the degree u a b v Figure 5: A graph satisfying S(1) for k = 4. Figure 6: A graph satisfying S(t) for k = 4. G 1 , G 2 , G 3 and G 4 are graphs satisfying S(t − 1). Vertices v i and u i are the special vertices of degree 1 in G i .
requirements of S(1). Fix a colouring of G. If P is monochromatic then it is a k-anagram.
If P is not monochromatic, then there are two paths u, a, p 1 , b, v and u, a, p 2 , b, v with distinct colour multisets. Therefore |D| 2 k k−1 and so S(1) is true. This graph is shown in Figure 5 for k = 4.
Assume S(t) is true for some t 1. Let G 1 , . . . , G k be copies of the graph guaranteed to exist by S(t). Denote the two special vertices of G i by u i and v i . Let G be the graph with V (G) = {u, v, a, b} and E(G) = {ua, vb}. Add G 1 , . . . , G k to G as disjoint components. Finally, add the following edges to G: This construction is shown in Figure 6 for k = 4.
First we show that G satisfies the degree requirements of S(t + 1). Clearly, deg(u) = deg(v) = 1 and deg(a) = deg(b) = k +1. Each u i has degree 1 in G i so deg(u i ) 3 k +1. Similarly, deg(v i ) 3 k + 1. Every other vertex has the same degree as in G i , which is at most k + 1.
Now fix a colouring of G. If some G i contains a k-anagram then S(t + 1) is satisfied so assume that each G i is k-anagram-free. Let D i be the set of colour multisets on paths of length 4t in G i with endpoints u i and v i . By S(t), we have |D i | (k/(k − 1)) t for all i ∈ [k]. We now split the proof into two cases.
In the first case there exists a colour multiset M such that M ∈ D i for all i ∈ [k]. This means that each G i contains a u i v i -path P i with M (P i ) = M . Type (iii) and (iv) edges between special vertices of G i and G i+1 mean that the subgraph induced by P 1 ∪P 2 ∪. . .∪P k is a path. This path is a k-anagram and so the colouring satisfies S(t + 1).
In the second case there is no colour multiset that occurs in every D i . Define the union of colour multisets as U := i∈[k] D i . For a colour multiset M ∈ U let f (M ) be the number of sets from {D 1 , . . . , D k } that contain M . No colour multiset occurs in every D i so f (M ) k − 1 and therefore . There is a bijection from U to D because every uv-path of length 4t + 4 shares vertices a, b, u and v. Therefore |D| = |U | and so S(t + 1) is satisfied.
Let c 1 be a number of colours and let t be sufficiently large so that Let G be the graph guaranteed to exist by S(t) and fix an arbitrary c-colouring of G. Let D be the set of colour multisets as defined previously. By (2) there are at most (4t + 2) c colour multisets of size 4t + 1. Therefore |D| (4t + 2) c < k k−1 t . Thus G contains a k-anagram by S(t).
The following natural question arises: Does there exist a d such that φ k is unbounded on graphs of maximum degree d for all k 3? Also, the analogous problem for edge colouring is open. We know of no family of graphs for which φ ′ k is unbounded, except in the case of k = 2.

Upper bounds on trees
In this section we prove an upper bound on k-anagram-free colouring that contrasts with the results for anagram-free colouring.
Theorem 7. If T is a tree and k 4 then φ k (T ) 4 and φ ′ k (T ) 4. Proof. Root T at an arbitrary vertex r ∈ V (T ) and let h be the height of the resulting rooted tree. Let C = c o . . . c h be an anagram-free word on four symbols. Colour each vertex u ∈ V (T ) by c x where x is the distance between u and r.
Let P = P 1 . . . P k be a path in T such that, for some n 1, |V (P i )| = n for all i ∈ [k]. Note that P is a k-anagram if and only if M (P 1 ) = M (P 2 ) = . . . = M (P k ). We now show that P is not a k-anagram.
P contains a unique vertex v closest to r. If v ∈ V (P i ) with i 3 then the colour sequence along P 1 ∪ P 2 appears in C, so M (P 1 ) = M (P 2 ). In the other case, v ∈ V (P i ) with i 2. Then the colour sequence along P 3 ∪ P 4 appears in C, so M (P 3 ) = M (P 4 ). In each case, P is not a k-anagram. Hence φ k (T ) 4.
The proof can be repeated for φ ′ k by modifying the definition of P . In this case P has length nk and its subpaths P 1 , P 2 , . . . , P k are edge-disjoint such that P is a k-anagram if and only if M (P 1 ) = M (P 2 ) = . . . = M (P k ).
Theorem 7 demonstrates a qualitative change in behaviour as k increases. The case of k = 3 is an open problem that sits between bounded and unbounded behaviour. For φ 3 on trees we have upper bounds due to Equation (1) and Theorems 4 and 5. We prove similar upper bounds for φ ′ 3 using Dekking's [7] result φ 3 (P ) = 3. Theorem 8. For every tree T , φ ′ 3 (T ) 4 pw(T ). Proof. The proof is by induction on m. The base case is satisfied because trees of pathwidth 0 are edgeless. Now assume that every tree T with pathwidth at most m has φ ′ 3 (T ) 4m. Let T be a tree of pathwidth m + 1. By Lemma 12 there exists a path P ⊆ T such that pw(T − V (P )) m. Each component of T − V (P ) has pathwidth at most m, so can be 3-anagram-free edge-coloured with the same set of 4m colours, by induction. We now use four additional colours to colour the remaining edges. Dekking [7] proves φ 3 (P ) = 3 so we can 3-anagram-free edge-colour P with three colours. The fourth extra colour is used to colour the edges between P and T − V (P ).
We now show that this colouring is 3-anagram-free. Let Q be a path in T . If Q is entirely contained within a component of T − V (P ) then, by induction, Q is not a 3anagram. Otherwise Q intersects P . The intersection of Q and P is a 3-anagram-free subpath of P and the colours in Q ∩ P occur nowhere else in Q. Therefore Q is not a 3-anagram.
Note that no similar bound exists for φ ′ 2 because stars have pathwidth 1 and φ ′ 2 is unbounded on stars. A bound on φ ′ 3 (T ) as a function of radius follows from the relation between pathwidth and radius in trees. Note that since φ 3 (P ) 3 we are also able to prove that φ 3 (T ) 3 pw(T ) + 1 with a proof similar to the proof of Theorem 13.
Dekking also proves φ 4 (P ) = 2 and we use both results to improve upon Theorem 7 for larger k.
Theorem 15. For all z 1 and k 2z, if φ z (P ) y for all paths P then φ k (T ) y for all trees T .
Proof. Let T be a tree with root r and height h. Let C = c o . . . c h be a z-anagram-free word on y symbols. Colour each vertex u ∈ V (T ) by c x where x is the distance between u and r.
Let P = P 1 . . . P k be a path in T such that |V (P i )| = n for some n 1. Note that P is a k-anagram if and only if M (P 1 ) = M (P 2 ) = . . . = M (P k ). We now show that P is not a k-anagram.
P contains a unique vertex v closest to r. If v ∈ V (P i ) with i > z then the colour sequence along P 1 ∪ P 2 ∪ . . . ∪ P z appears in C. In the other case, v ∈ V (P i ) with i z, which implies the colour sequence along P z+1 ∪ P z+2 ∪ . . . ∪ P 2z appears in C. In each case there exist a, b such that M (P a ) = M (P b ) because C is z-anagram-free. Therefore P is not a k-anagram.

Open Problems
Throughout this paper we have posed many conjectures and open problems. In this section we provide a summary as well as some further questions.
The results of Sections 2 and 3 motivate further study of φ on trees. Whether φ is bounded on the complete binary tree is a particularly interesting question. We also conjecture the result analogous to [6], that φ(C) 4 for cycles with only finitely many exceptions. The tight bounds given in Theorems 4 and 5 motivate further investigation of pathwidth and radius. We ask whether pathwidth is tied to φ on trees, that is, whether there exists a functionf such that pw(T ) f (φ(T )) for every tree T . Pathwidth is unbounded on complete binary trees so the two questions are related. Section 4 contains two open problems. The first is whether φ ′ k is bounded by maximum degree for some k 3. The second is whether φ 3 and φ ′ 3 are bounded on trees.