{"paper_meta":{"paper_id":"arxiv:0709.4497","title":"0709.4497","authors":[],"year":null,"published":null,"updated":null,"venue_or_source":"arxiv-papers-shard","primary_category":"cs","secondary_categories":[],"doi":null,"license":"unknown","source_type":"pdf+shard","source_url":null,"pdf_url":null},"abstract":{"raw":"","cleaned":"","offsets":[]},"full_paper_text":{"raw_ordered_text":"arXiv:0709.4497v2 [cs.CC] 6 Dec 2007\nThe complexity of nonrepetitive edge coloring of graphs\nFedor Manin ∗\nOctober 25, 2018\nAbstract\nA squarefree word is a sequence w of symbols such that there are no strings x, y, and z for\nwhich w = xyyz. A nonrepetitive coloring of a graph is an edge coloring in which the sequence\nof colors along any open path is squarefree. The Thue number π(G) of a graph G is the least n\nfor which the graph can be nonrepetitively colored in n colors. A number of recent papers have\nshown both exact and approximation results for Thue numbers of various classes of graphs. We\nshow that determining whether a graph G has φ(G) ≤k is Σp\n2-complete.\nWhen we restrict to paths of length at most n, the problem becomes NP-complete for fixed\nn. For n = 2, this is the edge coloring problem; thus the bounded-path version can be thought\nof as a generalization of edge coloring.\n1\nIntroduction\nThe study of avoiding repetition in combinatorial structures stems from a 1906 paper by Axel Thue\n[12], which showed that a there is an infinite word in {0, 1, 2} that has no subword of the form xx\nfor some finite word x. Such a word is called squarefree.\nA paper by Alon, Grytczuk, Haluszczak, and Riordan [1] introduced the generalization to edge\ncolorings of graphs. An edge coloring of a graph is nonrepetitive if for any open path through the\ngraph, the pattern of colors along the path is squarefree. The Thue number π(G) is the smallest\nnumber k for which G can be nonrepetitively colored with k colors. Alon et al. also mentioned the\npossibility of studying vertex nonrepetitive colorings, i.e., vertex colorings with the same property.\nThis notion has been further studied in papers by Czerwi ́nski and Grytczuk [6] and by Bar ́at and\nVarj ́u [2]. Other similar notions involving walks rather than paths have been developed by Breˇsar\nand Klavˇzar [4] and again by Bar ́at and Varj ́u [3]. For a more detailed survey of results regarding\nvertex nonrepetitive colorings, we refer the reader to Grytczuk [7].\nThe many papers in this area employ various notations and terminologies; we will stick to the\noriginal terminology of Alon et al. whenever possible. Therefore, we refer to edge nonrepetitive\ncolorings simply as nonrepetitive colorings and denote the edge coloring Thue number as π(G). We\ncall a path square if it is of the form xx for some color-string x.\nOur goal is to study nonrepetitive colorings from the point of view of computational complexity.\nWhatever version of π(G) is used, deciding whether π(G) ≤k is an ∃∀problem: does there exist a\nk-coloring of the edges or vertices of G such that the pattern of colors along any open path, or one\n∗This research was conducted as part of the Summer Undergraduate Research Fellowship program at Caltech and\npartly supported by grant NSF CCF-0346991.\n1\n\nof the kinds of walks, is squarefree? Such questions usually belong in the class Σp\n2 = NPNP, a class\nin the second level of the polynomial hierarchy. This class and problems known to be complete for\nit are described in a survey by Schaefer and Umans [10].\nMany of the results of papers on nonrepetitive colorings which bound the Thue number of\nvarious classes of graphs—for example, Alon et al.[1] show that π(G) ≤c∆2 for constant c for any\ngraph of degree ∆. On the other hand, Alon et al. also show that for any ∆there is a graph G of\nmaximum degree ∆such that any nonrepetitive vertex coloring of G requires at least c∆2/ log ∆\ncolors. Both these results, and many others like them, are probabilistic and thus give us little\ninformation about specific graphs.\nThe complexity of vertex nonrepetitive colorings has recently been studied by Marx and Schaefer\n[9], who showed that deciding whether such a coloring is nonrepetitive is coNP-complete. In this\npaper we show that the corresponding problem for edge colorings is coNP-complete. We then show\nthat deciding whether π(G) ≤k is Σp\n2-complete.\nFinally, we turn to colorings that are nonrepetitive for bounded-length paths. Let χe\ni(G) be the\nleast number of colors required to color the edges of G so that no open path contains the square\nof a pattern of colors of length ≤i, and let χi(G) be the least number of colors required to color\nthe vertices of G under analogous conditions. Since the number of paths of length 2i is bounded\nby |V |2i, for fixed i each such problem is contained in NP. Then χ1(G) ≤k is simply graph\ncoloring and χe\n1(G) ≤k is edge coloring, shown to be NP-complete by Holyer in 1981 [8].\nχ2(G) is known as the symmetric chromatic number; the corresponding decision problem is shown\nto be NP-complete by Coleman and Mor ́e [5]. We show that the decision problems corresponding\nto χe\n2(G) and χe\n2k(G) for any k ≥4 are NP-complete.\n2\nMethods\nThe nonrepetitive colorability of a graph with k colors is a rather slippery property. In the con-\nstruction of a nonrepetitive coloring, changing the color of an edge may produce a square path of\narbitrary length and thus affected by colors of edges arbitrarily far away. Thus the local properties\nof a graph cannot guarantee that it is nonrepetitively colorable. On the other hand, if a graph does\nnot have a nonrepetitive coloring, then we must examine all of the colorings and find a square path\nin each, which also feels like a hard problem. Thus neither direction of the reduction is easy.\nThere are two immediately visible approaches to resolving this dilemma. Perhaps we could focus\non fairly sparse graphs, thus minimizing the number of paths we must make sure are nonrepetitive.\nBut this would greatly increase the number of colorings we must consider.\nWe thus use this\napproach only in determining whether a preassigned coloring is nonrepetitive. On the other hand,\nwe could focus on graphs in which the degree of every vertex is close to the maximal degree of the\ngraph. Although this allows us to easily discard most possible colorings, the number of distinct\npaths grows exponentially. Additionally, it becomes harder to create graphs which differ subtly in\nglobal structure in such a way that some of them are nonrepetitively colorable and others are not.\nIn our proof, we combine these two approaches, producing graphs that are locally dense, in the\nsense that the degree of most vertices is large and close to the maximal degree, but globally sparse,\nin the sense that long paths must traverse a number of bottlenecks with only a few connections.\nWhile a pattern of local structures, or gadgets, is common to many if not all graph-theoretic\ncomplexity proofs, in this case in particular it allows us to partially isolate each portion of the\nproblem: once we have established that the local structure is nonrepetitively colorable in a very\n2\n\nconstrained set of ways, we can us this to determine whether the global structure is nonrepetitively\ncolorable.\nWe will first construct the global structure, which is similar to the well-known reduction which\nshows that hampath is NP-complete. The local structure, added later, will be composed of several\ntypes of dense subgraphs. The simplest of these are the cliques of size 2n, which Alon et al. show\nto be nonrepetitively colorable with 2n colors. We also use the n-dimensional hypercube graphs,\nwhich have a number of useful properties which are discussed in the next section. Finally, in a\nnumber of cases we will saturate a vertex v by adding extra vertices only joined to v, called the\nplume of v, to artificially inflate the degree. This will allow us to more effectively use the saturation\nlemma below.\n3\nPreliminaries\nWe will now prove some results about nonrepetitive colorings that will aid in the complexity proofs.\nLemma 1 (Saturation lemma). Let a vertex of a graph be saturated if it is of maximal degree, and\nlet a diamond be a cycle of four vertices. Suppose two opposing vertices of a diamond, A and B,\nin a graph of degree k, are saturated and the saturating edges are not directly connected. Then the\ngraph may only be k-nonrepetitively colored if the diamond is colored with exactly two colors.\nProof. Let a and b be the colors of one path from A to B through the diamond. Then, since A and\nB are saturated, there must be an edge of color b at A and an edge of color a at B, forming a path\nof colors abab. If this path is not a cycle, then the coloring is not nonrepetitive. Thus, these colors\nmust form the other half of the diamond.\nLemma 2 (Properties of hypercubes). The nonrepetitive k-edge-coloring of a k-hypercube exists,\nis unique up to permutation, and has the following properties:\n(1) The shortest path between any two points consists of distinct colors.\n(2) Any permutation of the colors of a path between two points consisting of distinct colors also\ncolors a path between those two points, and no other sequence of distinct colors does.\n(3) Any path consisting of distinct colors is a shortest path between its endpoints.\n(4) There are\n k\ni\n \nvertices at distance i from a given vertex V .\nThe uniqueness of coloring also holds for portions of a k-hypercube whose distance from a chosen\nbase vertex V is at most m, which we call the first m layers of the hypercube.\nProof. We will identify the vertices of the hypercube with {0, 1}k, where there is an edge between\n(χ1, . . . , χk) and (χ1, . . . , χi−1, 1 −χi, χi+1, . . . , χk) for every i.\nWithout loss of generality, let us choose the vertex V identified with ̄0 to be a base vertex. V\nis saturated, so the coloring of the edges adjacent to it is unique up to permutation. Thus the\ncoloring of the first layer is unique. Now suppose that we have colored the first m layers. Every\nvertex is saturated and any two adjacent edges form a diamond (a face.) Hence by the previous\nlemma the coloring of the mth layer determines the coloring of the m + 1st layer. By induction,\nthe coloring of the first m layers is unique, and so is the coloring of the entire hypercube.\n3\n\nTo show that a coloring exists, let us use the color i for all edges for which χi changes between\nthe two vertices. For every i, the hypercube consists of two k −1-hypercubes, one in which the\nith coordinate is 0 for all vertices and one in which it is 1. Therefore, if we have a path containing\ntwo edges of color i, then we can create an alternate path with the same start and end vertices by\nremoving these two edges and reversing χi for the vertices in between them.\nNow suppose we have a square path. Then for every dimension, there is an even number of edges\nin that dimension on the path, and we can remove all these edges by pairs from the path. Thus\nthe path is equivalent to the empty path, is therefore a cycle, and all open paths are squarefree.\nWe will now use this construction to prove the rest of the properties. For (1), suppose that\nwe have a shortest path between two points that contains two edges of the same color. Then we\ncan remove these two edges and get a shorter path between the same two vertices. Therefore the\nshortest path must consist of distinct colors.\nFor (2), clearly a permutation of the changes to variables leads to the same result. On the other\nhand, for any two shortest paths whose sets of colors differ, there is an i such that χi is different\nbetween the two end vertices for one of the paths, but not for the other. Thus the end vertices are\ndifferent for the two paths.\n(3) follows directly from (1) and (2).\nA path of length i represents a change in i members of the k-tuple. There are\n k\ni\n \npossible such\nchanges, proving (4).\n4\nNonrepetitive coloring problems\nIn this section, we consider several related problems in which the coloring is entirely or almost\nentirely predetermined, and the main difficulty of the problem is in finding whether the coloring is\nnonrepetitive. The proofs in this section are all related and provide a framework for the proof of\nthe Σp\n2-completeness of Thue number. We first consider colorings of directed graphs.\nTheorem 1. Given a directed graph G and a coloring thereof, it is coNP-complete to determine\nwhether the coloring is nonrepetitive. We call this problem directed nonrepetitive coloring.\nProof. We reduce from co-3SAT. The reduction is similar to the standard reduction from 3SAT to\nhampath. The edges are given a large number of colors, with 4 or fewer edges per color. In effect,\nwe restrict possible square paths to those that go through two edges of every color, mimicking the\nrequirement that a Hamilton path must pass through every vertex.\nLet f(x1, . . . , xn) be an instance of 3SAT. The reduction will use two types of gadgets: a variable\ngadget and a clause gadget.\nThe variable gadget consists of two sets of M vertices, where M is the largest number of number\nof instances of a literal, together with a beginning vertex bi. A path of edges goes from bi through\neach of the vertices in a set to bi+1, or a vertex c if i = n. The sets of vertices and paths going\nthrough them correspond to a true assignment and a false assignment; thus each set signifies a\nliteral.\nSuppose f has clauses numbered C1, . . . , Cm. A clause gadget for clause Cj has one vertex ej,\nand we add an extra vertex d and an edge from c to e1. For each literal in Cj, we add an edge from\nej to a vertex on the path corresponding to this literal and an edge from this vertex to ej+1 or d if\nj = m, making sure that this is the only clause gadget that uses this vertex.\n4\n\nFigure 1: The graph generated by (x ∨y ∨z) ∧(¬x ∨¬y ∨¬z) ∧(x ∨¬y ∨¬z), with a square path\nhighlighted.\nTo complete the construction of the graph, we add a series of vertices a0, . . . , aMn+2m and edges\nconnecting ai to ai+1 and aMn+2m to b1. We call this structure the snout. We must now assign\na coloring to this graph. We will use a set w1, . . . , wMn+2m+1 of colors. Starting from the tip, we\ncolor the ith edge of the snout with wi. We color the kth edge of a path through the xi-gadget by\nwM(i−1)+k; an edge going into ej by wMn+2j−1; an edge leaving ej by wMn+2j; and an edge going\ninto d by wMn+2m+1.\nGiven a satisfying assignment to f, we can construct a square path by first traversing the snout,\nthen taking the path through each variable gadget corresponding to the opposite of its assignment\nand the path through each clause gadget corresponding to a true literal, as illustrated for an\nexample. Conversely, if we have such a path, then taking the opposite of a traversed literal-path\nto be true gives us a satisfying assignment.\nNow suppose that f is unsatisfiable, and that there is a square path p, which then cannot have\nthe form above. Suppose first that the edges of p are colored only by the colors of the variable\ngadgets. Since the colors of the variable gadgets form the tip, but not the base of the snout, p must\nconsist only of the variable gadgets themselves; but this is impossible since the variable gadgets\ncan only be traversed in the forward direction and thus a path through them has no two edges of\nthe same color.\n(*) Thus p must contain edges from clause gadgets. Since any two edges in a clause gadget\nthat share a color also share a vertex, an open path can contain only one of such a set. Thus,\nfor every color a that colors an edge of p contained in a clause gadget, p contains an edge in the\nsnout of color a. Since b1 is only the source of the two branches of the first variable gadget, one of\nthese two branches must also be contained in the path. Furthermore, since these branches share a\nvertex, only one of them may be contained in p. The only other edge colored by w1 is the edge at\nthe very tip of the snout; thus the entire snout must be contained in p, so p must contain a path\nbelonging to each variable and clause gadget. As above, this defines a satisfying assignment to f,\na contradiction.\nClearly, this reduction runs in polynomial, in fact quadratic, time.\nRemarks. The graph resulting from this reduction has maximum in- and out-degree 3. Each color\nis repeated at most four times.\nFrom this we can fairly easily show the same result for undirected graphs.\nTheorem 2. Given an undirected graph G and an edge-coloring thereof, it is coNP-complete to\ndetermine whether the coloring is nonrepetitive. We call this problem nonrepetitive coloring.\n5\n\nFigure 2: The graph that replaces a snout edge of color yj.\nProof. We will now modify the previous reduction to work with undirected graphs. Let us add the\ncolors aj\ni, bj\ni, cj\ni , dj\ni, for i ∈{1, 2, 3} and j ≤Mn + 2m + 1. We call these the direction-determining\ncolors and the rest the original colors. We replace every edge inside the snout with the graph in\nfigure 2 and every edge outside the snout with the path aj\nibj\niwjcj\nkdj\nk for some i, k ∈{1, 2, 3}. This\ncan be done in such a way that there are no trivial repetitions, that is, no two edges of the same\ncolor are incident to the same vertex, since the maximum in- and out-degree of the directed graph\nis 3. Clearly, this construction retains the property that each color colors no more than four edges,\nsince none of the direction-determining colors need color more than two edges. We will show that\nthis modification leaves the reduction valid.\nIf f has a satisfying assignment, we can traverse the graph as before, choosing the right path\nthrough the snout to produce the same ais, bis, cks, and bks as in the other half of the path.\nNow suppose that f is unsatisfiable. Suppose that the graph has a square path. Clearly, this\npath must contain direction-determining colors. Each such color is represented only once in the\nnon-snout edges, so we cannot make a square path without any snout edges. This means that the\nparagraph marked (*) in the previous proof still applies, and we are done.\nWe now modify the statement of the problem slightly in order to get a Σp\n2-complete problem.\nTheorem 3. Given an undirected graph G and a set S of pairs (e, Se) for each edge e, with Se a\nset of colors, it is Σp\n2-complete to determine whether there exists a nonrepetitive coloring of G that\nuses a color se ∈Se for each e. We call this problem restricted Thue number.\nIn our case, Ke will contain at most two colors for any edge, and only one color for most edges.\nProof. Clearly, the problem is in Σp\n2. To prove that it is Σp\n2-hard, we shall slightly modify the\nprevious reduction, reducing from co-∀∃3SAT. Let ∀x∃yf(x, y) be an instance of ∀∃3SAT. Our\ngraph G will be the graph constructed for ∃x, y f(x, y) in Theorem 2. For each universally quantified\nvariable, the two original edges that initially separate the variable gadget into a “true” and a “false”\nbranch are given the sets {w1\ni } and {w0\ni } respectively, where wi is the color given these edges in\nthe previous reduction. The corresponding edge in the snout is given the set {wt\ni, wf\ni }. The rest of\nthe edges are given singletons containing the color they were colored in the previous reduction.\nThus a coloring of the graph satisfying the restriction corresponds to an assignment of x, since it\nforces any potentially square path to go through the specified branch of the corresponding variable\ngadget. This means, by the previous construction, that there is such a nonrepetitive coloring of G\niffthere is an assignment to x for which ∃yf(x, y) is unsatisfiable.\nThis proof provides the final incarnation of the global structure which we will later harness to\nshow that Thue number is Σp\n2-complete.\n6\n\nFigure 3: A clam.\n5\nProblems concerning bounded-length paths\nIn this section, we explore two problems in which we consider a polynomial number of possibly\nsquare paths, and therefore only the existential quantifier in the statement of the problems is over\nan exponentially large domain. Together, the problems form a generalization of edge coloring,\na problem which was shown to be NP-complete by Holyer in 1980 [8].\nIn these proofs, we employ several tricks to find graphs whose small-diameter subgraphs are\nrestricted in the ways they can be colored nonrepetitively. These tricks will later find applications\nin the proof of the Σp\n2-completeness of Thue number. Thus although this material is not directly\nrelated to the main result, it builds some machinery for its proof. Still, a reader interested only in\nthe main proof may go on to the next section.\nTheorem 4. It is NP-complete to determine whether χe\n2(G) ≤6.\nProof. We reduce from edge coloring for cubic graphs (graphs with 3 edges incident to every\nvertex) and 3 colors, which is shown to be NP-complete in [8]. The reduction consists of replacing\neach edge of graph G with the graph depicted in Fig. 3, which we shall call a clam. The vertices\nincident to the edge are mapped to A and B. We shall argue that the resulting graph H can be\n6-colored with nonrepetitive 4-paths iffG can be 3-colored. Suppose that we have such a coloring,\nand call the six colors a, b, c, d, e, f.\nNote first that vertices A and B are both saturated, since they are images of vertices of G of\ndegree 3, so the outer diamond of the clam only has two colors—without loss of generality, a and\nb. Now suppose that one of the inner four edges (let us call them the gills) is colored a. Then if\nthe color of an edge of the inner diamond connected to this edge is c, there is a path acac through\ngill, inner diamond, outer diamond, and an edge of another clam. Thus the gills must be colored\ndifferently from the outer diamond, as must the inner diamond since it is adjacent to the outer one.\nThis means that the vertex labeled V and the one symmetric to it are saturated for the four colors\nother than a and b, and thus the inner diamond must be colored with exactly two colors (c and d.)\nNow let us add two more clams, incident to vertices C and D respectively, at vertex A. Suppose\nthat the outer colors of the clams are ce and df respectively. Then to prevent square paths of the\ntype acac from the inner diamond of clam AC to the inner diamond of clam AB, the inner diamonds\nof clams AC and AD must consist of the colors df and ce respectively. But then we get square\npaths of the form dcdc from the inner diamond of clam AC to the inner diamond of clam AD. Thus\nthe outer colors of AC and AD must be cd and ef, in some order. Furthermore, the inner colors\nof AC must be ef to prevent acac-type repetitions. This forces the inner colors of AD to be ab.\nThis means that the coloring of one clam at a vertex of G determines the sets of colors available\n7\n\nto the other clams; by induction, each clam in the graph must be colored using one of these three\npatterns.\nThis means that if we have a 3-coloring of G, we can map the three colors onto the three clam-\ncoloring patterns to produce a 2-nonrepetitive 6-coloring of H; conversely, with a nonrepetitive\n6-coloring of H, we can map the three clam-coloring patterns onto three colors with which we can\nedge-color G.\nTheorem 5. For any natural number k ≥4 and graph G, it is NP-complete to determine whether\nχe\n2k(G) ≤6k.\nProof. This is a generalization of the previous reduction. However, one must view the clam not\nas a unified gadget, but as a combination of elements of three gadgets. The two edges incident\nto vertex A belong to vertex gadget A, and likewise for vertex B. The edge gadget proper, then,\nconsists of the inner diamond and the gills.\nWe again reduce from edge coloring for cubic graphs in 3 colors. Let G be a cubic graph.\nWe associate to G a 3-coloring C(e) of the edges. As we construct the gadgets in the reduction,\nwe will also construct a 6k-coloring of the edges based on C(e). Later, we will show that this\ncoloring is 4k-nonrepetitive iffC(e) is a valid edge coloring, and that no other coloring of the edges\nis 4k-nonrepetitive. We shall now enumerate the elements of the reduction, which reduces G to a\ngraph H.\nThe vertex gadget consists of the first k layers of a 6k-hypercube with respect to a central vertex\nK. By the hypercube lemma, this has a unique nonrepetitive coloring.\nNow let us divide the 6k colors into three groups of 2k, called red, green, and blue. We shall\nuse the term grue to refer to the union of the sets blue and green. The elements of the sets will be\nreferred to as shades. For each of the groups, there are\n 2k\nk\n \nvertices whose distance from K is k\nsuch that the path to them from K consists of edges of colors from that group. We identify these\nvertices with an analogous group from another vertex gadget (with central vertex L) in order to\nform an edge.\nClaim 1. In a 4k-nonrepetitive coloring, the colors of the edges on either side of this connection\nare in the same set of 2k.\nProof. Suppose we have a 4k-nonrepetitive coloring that does not have this property. Then take\nan arbitrary path from K to L of length 2k, say with color pattern r1, . . . , rk, b1, . . . , bk. By the\nproperties of the 6k-hypercube, there must be a path starting with K of pattern bk, . . . , b1 and a\npath starting with L of pattern r1, . . . , rk. This forms a square path of length 4k, which must then\nbe a cycle. This means that the sets of colors on either side of the inter-vertex interface are the\nsame. Assume they are both red. Then, since the fully-red paths from K to L form a 2k-hypercube,\nthey can be colored nonrepetitively.\nWe assume now that we are working with two vertices, K and L, that are joined by a red edge.\nThe construction for the other two sets is analogous.\nIt remains to add a gadget that will force the green and blue sets of one vertex to be the same\nas the green and blue sets of the other. To this end, we take two vertices, A and B, on the interface\nbetween two vertex gadgets, whose distance from each other is 2k, to be two ends of a consistency\ngadget.\nThe consistency gadget is a 4k-hypercube modified in two ways.\nFirst, every vertex whose\ndistance from A and B is 2 or more has a plume of 2k additional edges leading to disconnected\n8\n\nvertices. A red edge separated by one edge from A or B generates a square path of length 4, so this\nmeans all the vertices of the hypercube are effectively saturated. This implies that the hypercube\nis entirely grue and the plumes are red. On the other hand, the farther red plume edges do not\ngenerate such a path, since it would have to repeat a red edge followed by two or more grue edges\nas a path from the red interface vertices, and thus required by hypercube property (3) to stray a\ndistance more than k from the central vertex of the vertex gadget.\nNext, for every path starting at A or B and consisting of k edges of distinct shades of green, we\nremove the last edge. We then do the same for blue. We also remove all red plume edges incident\nto the vertices that are left unsaturated by this removal. We call the kth layer of the hypercube\nfrom either A or B the gap layer.\nClaim 2. This consistency gadget is uniquely 4k-nonrepetitively 6k-colorable up to isomorphism.\nThis coloring is such that the hypercube edges are grue and colored as the restriction of a full\nhypercube, and the plumes are red.\nProof. Any diamond containing edges in the layer adjacent to the gap layer has two saturated\nvertices at equal distance from the vertex gadget. Suppose there is an edge between two vertices\nthat are both unsaturated due to the removal. If those two vertices both became unsaturated from\nthe removal of edges of the same color, then the edge would have to be of that color, and thus\nalso removed. On the other hand, an edge between two vertices that are unsaturated due to the\nremoval of different colors would not exist by hypercube property (2). Thus any diamond that has\nedges in the gap layer has saturated vertices either laterally or vertically, and so by the saturation\nlemma the coloring is a restriction of the full hypercube.\nWe then add a second, identical consistency gadget at vertices C and D whose distances from\nA and B are at least 4. (This distance prevents a square path consisting of a red plume edge in\nthe first consistency gadget, then some path through it, then two red edges, the same path through\nthe second consistency gadget, and another red plume edge.)\nWe refer to the set of colors that form the interface between two vertex gadgets as an edge set.\nClaim 3. If the original graph is not 3-edge-colorable, the resulting graph is not 4k-nonrepetitively\n6k-edge-colorable.\nProof. Given a red edge set, suppose that another edge set of the same vertex gadget with central\nvertex K, belonging to edge e of G, has both green and blue parts. This means that that one of\nits consistency gadgets will have a path to it that contains both green and blue, since if one of the\nconsistency gadgets has an all-blue side and an all-green side, then the other one does not. Thus\nwe can find a square path consisting of:\n1. a red plume edge that duplicates the last edge of (3),\n2. a path of length k in a consistency gadget of the red edge that duplicates (4),\n3. a path from the consistency gadget of the red edge set to K,\n4. a mixed blue-green path from K to one of the blue-green edge set’s consistency gadgets, and\n5. a path of length k −1 in this consistency gadget that duplicates the first k −1 edges of (3).\n9\n\nTherefore, the edge sets cannot be of mixed colors with respect to the red edge set’s consistency\ngadget.\nClaim 4. If G is 3-edge-colorable, then the coloring of H which we have described is 4k-nonrepetitive.\nProof. Suppose that G is 3-edge-colorable, and let p = qr be a square path in H of length at\nmost 4k, where q and r are the repetitions of the pattern. The portion of p inside a gadget G\nwill be called pG. Clearly, p cannot be wholly inside a consistency gadget. We have also already\nestablished that p cannot be wholly outside any consistency gadgets. Thus it include edges from\nboth consistency and vertex gadgets. Since a consistency gadget has distance 4k between its two\nattachment points, p cannot have a consistency gadget in the middle. In introducing the red plumes\nin the consistency gadget, we also showed that the whose middle vertex of p cannot be a junction\nbetween a consistency gadget and a vertex.\nThus at least one half-path of p (without loss of generality, q) contains parts of both a consistency\ngadget T and a vertex gadget J with center K. qT contains at most one of the colors that are\nfound on a shortest path to K from the juncture with the consistency gadget. If such a color is in\nqT , it must be a plume, which forces qT to be at least three edges long.\nSuppose now that the rest of p is contained in J. We will show that the distance from the last\nvertex V of p to K is greater than k, a contradiction. If a color has both of its repetitions inside\nJ, these cancel each other out, so we are left with the edges that repeat qT . But since there is at\nleast one more grue than red edge in qT, this means that our initial distance k from K increases\nby at least one.\nThis means that p must access either a consistency gadget or another vertex gadget. Without\nloss of generality, assume that T belongs to a red edge set.\nCase 1: p accesses a second consistency gadget that belongs the same edge set. Then there are\nat least four shades of red that are repeated an odd number of times in the vertex gadget portion of\nthe path. Since there is at most one red edge in each consistency gadget part of the path, nothing\ncan repeat these edges.\nCase 2: p accesses a different consistency gadget, without loss of generality from a blue edge\nset. Then pJ must contain at least 2k colors that color an odd number of edges, since the distance\nbetween the two consistency gadgets is 2k. This is the maximal number of distinct colors in the path\nwe are considering, so each of the 2k must be repeated in one of the two consistency gadgets. This\nmeans that one of the consistency gadgets contains a red-blue path of length at least k. However,\nthis must pass through edges that we have removed, so no such path exists.\nCase 3: p accesses a vertex gadget J′ ̸= J which interfaces J at a non-red edge set. This again\nmeans that there are 2k distinct colors in pJ, and the 2k edges in pT and pJ′ must repeat these. In\nparticular this means that the edge that repeats the edge of pJ adjacent to T must be the edge of\npJ′ adjacent to J, and so this edge must be colored a shade of red, which is a contradiction.\nCase 4: p accesses a vertex gadget J′ which interfaces J at the red edge set. Each time that\npJ or pJ′ traverses a grue edge before the last vertex in p that belongs to both J and J′, another\nedge of the same color must be accessed, by hypercube property (3). Since there must be an even\nnumber of edges of any color, this means that unrepeated edges in the consistency gadget must be\nrepeated by similar edges in the portion after this last crossover. Also, since all but at most one\nshade of red has to be traversed twice within the non-consistency-gadget portion, all the red colors\ntogether bring the path to within one edge of the border of a vertex gadget. But in that case there\n10\n\nare at least two grue edges in the consistency gadget portion, again pushing the path beyond the\nradius of the vertex gadget.\nThus there is no way for such a p to exist.\nThis means that the resulting graph may be 4k-nonrepetitively 6k-edge-colored iffthe original\ngraph can be 3-edge-colored. Note that there is nothing special about the original graph being\nof degree 3.\nIf the original graph is regular of degree d, then we can construct a similar new\ngraph with a vertex gadget being a slice of a 2dk-hypercube, a consistency gadget being a modified\n2(d −1)k-hypercube, and so on.\nTaking into account the vertex and consistency gadgets, for an original graph with a edges, the\nresulting graph of this reduction has Θ(2a\nd ·22dk +a·22(d−1)k) = Θ(a\nd22dk) edges. This means that if\nk depends logarithmically on a, then the reduction still runs in polynomial time with respect to a.\nThis raises questions about other versions of the problem where k is not constant, but a sub-linear\nfunction of |G|.\n6\nTHUE NUMBER\nWe now proceed to the main result of the paper, showing that Thue number is Σp\n2-complete.\nWe use a reduction based on that of Theorem 3, taking a graph very similar to that produced in\nTheorem 3 and replace the edges with various gadgets depending on their function in that reduction.\nWe also add constraint gadgets in order to force the edge gadgets that would have been colored\nthe same in Theorem 3 to still have similar patterns of colors. After we show that a nonrepetitive\ncoloring of this graph must satisfy a large number of constraints stemming from this local structure,\nwe can use the global structure from Theorem 3 to show that an actual nonrepetitive coloring exists\nif and only if the ancestral instance of co-∀∃3SAT is positive.\nWhile this is the idea of the proof, in reality, the local structure is not cleanly separated from\nthe global structure: the format of the latter helps constrain the former.\nTheorem 6. Thue number is Σp\n2-complete.\nProof. Given an instance ∀x∃y f(x, y) of co-∀∃3SAT, we will refer to the instance (G, S) of re-\nstricted Thue number constructed in Theorem 3. Let c = |S S| be the number of colors coloring\nG, u = |y|, and let lbe the smallest integer such that 2l≥c + u + 1 and m = 4l+ 3.\nLet w0\ni , w1\ni be the two colors corresponding to the universally quantified variable xi. Then we\nmodify G by introducing new colors wI\ni and wF\ni and replacing each edge colored by A ⊆{w0\ni , w1\ni }\nby three edges in series colored {wI\ni }A{wF\ni }. Clearly, this graph (G′, S′) ∈restricted Thue\nnumber iff(G, S) is. We construct from this graph an instance (H, 2m + 6) of Thue number.\nLet S∗be the set of colors that are not wj\ni for j ∈2. For every edge e of G′ whose color is\nfrom S∗, we add to H a 7-hypercube Ee with two opposing vertices (v0 for the one closer to the\ntip of the snout along a potentially square path and v1 for the other one) acting as the vertices of\nthe edge gadget. For each color s ∈S∗and for each pair Xi = {x0\ni , x1\ni }, we also add a consistency\ngadget Qs (respectively Qi\nX). This consists of a 2m-clique with every vertex identified either with\nthe central vertex of the first two layers of a 7-hypercube, called the plume emanating from this\nvertex, or with a vertex of an edge gadget. For each edge e whose color is s, two vertices of Ee are\nidentified with vertices of Qs: u0 for one that is distance 3 from v0 and u1 for one that is distance\n4 from v0.\n11\n\nFigure 4: A C-gadget.\nIt may be thought of as a sequence of strung-together hypercubes of\ndimensions 2, 1, 1, and 3, together with plumes that inflate the degree of some vertices.\nFigure 5: A C-gadget. It may be thought of as two hypercubes of dimensions 3 and 4 together\nwith plumes that inflate the degree of some vertices.\n12\n\nFor the edges colored by subsets of {x0\ni , x1\ni }, the choice edge in the snout becomes the gadget\ndepicted in Fig. 4, which we call a C-gadget or Ci. The negative edge in the variable gadget becomes\nthe gadget depicted in Fig. 5, which we call an N-gadget or N i. In both cases, the asterisked vertex\nu is identified with a vertex of QXi and v0 and v1 are connected to other edge gadgets.\nFinally, the other edge becomes a P-gadget P i. This is a 7-hypercube attached to the consistency\ngadget in the same way as Ee, but is modified in several ways. In order to explain this, let us first\nlabel the dimensions of the hypercube a, b, c, d, ab, ac, ad. (This labeling will be explained later.)\nLet a, b, ab span the distance from u0 to v0, and, correspondingly, let c, d, ac, ad span the distance\nfrom u0 to v1. Let us eliminate the edges c, d, ac, ad adjacent to v1. We then nearly saturate the\nvertices that are separated from u0 by the paths (a, c, ac) and (a, d, ad) (call them u−1 and u−2\nrespectively) with 2m −2 additional edges, but then remove the original edges corresponding to b\nfrom both and c and d from u−1 and u−2 respectively.\nNow that we have constructed a graph, we will attempt to color it nonrepetitively with k colors,\nand show that it has a nonrepetitive coloring iffthe instance of ∀∃3SAT is negative. Let us call the\nset of colors K and call the color of an edge e under a hypothetical coloring C(e). Conversely, we\ndenote by [c] an edge of color c if its more precise identity is irrelevant.\nClaim 1. Let e1, . . . , en be the set of edges of color s ∈S∗. Then in a nonrepetitive coloring, Eei\nmust all be colored with the same 7 colors. Similarly, for every i, Ci, N i, and the hypercube portion\nof P i must all be colored with the same 7 colors.\nProof. Suppose we have a nonrepetitive coloring C(e).\nInside each consistency gadget Q, each vertex of the 2m-clique is saturated. Let u, v, and w be\nsuch vertices, and suppose that C(uv) is the same as the color of the edge of a plume adjacent to\nw. Then there is an edge of color C(uw) adjacent to v. Together with uw, these four edges then\nform a square path. To avoid this, the set Z(Q) of 7 colors that colors the first layer of each plume\nmust be disjoint from the set G∗(Q) of 2m −1 colors that colors the clique. By a similar argument,\nthe second layer of every plume must also have a color in Z(Q). According to [1], the coloring can\nbe constructed in such a way that G∗(Q) consists of the nonzero elements of the group Zm\n2 . (From\nnow on we will refer to just Z and G∗when Q is clear from the context.)\nBy the same token, the edges in the edge gadgets of distance at most two from ui must be\ncolored with colors from Z.\nNow suppose we have an edge e that has distance 3 from ui.\nIf\nC(e) ∈G∗, then the path consisting of e and the two edges that connect it to ui can be duplicated\ninside the consistency gadget, so C(e) ∈Z.\nThe maximum distance of an edge in any edge gadget from the closer ui is 4. Let us first\nconsider a gadget Ee, and let Z = {c1, . . . , c7}. We know that edges in the first three layers from\nu0 have colors in Z, so they must be arranged according to the hypercube lemma. Let wijk be\nseparated from u0 by edges [ci][cj][ck]. Let e4 be the edge incident to w123 that would be colored\nc4 if Ee were nonrepetitively colored by Z, and let e3 be the edge incident to w124 that would be\ncolored c3. These edges are adjacent.\nNow we have four cases, since both C(e3) and C(e4) can be either in Z or in G∗. Suppose that\nC(e3), C(e4) ∈Z. Then if it is not true that C(e3) = c, C(e4) = d, and we don’t have a trivial\nrepetition, then we have a square path of the form [c1][c2]e4e3[c1][c2][C(e4)][C(e3)]. So suppose that\nC(e4) ∈G∗. But we have a square path [C(e3)][C(e4)][c2][c4][c1]e3e4[c2][c4][c1] that starts with two\nedges of the consistency gadget. Finally, if C(e4) ∈Z but C(e3) ∈G∗, we have the analogous path\n[C(e4)][C(e3)][c2][c3][c1]e4e3[c2][c3][c1].\n13\n\nHence in a nonrepetitive coloring the fourth layer is also colored by Z according to the hypercube\nlemma. Since we can prove the same thing starting from u1, this means the colorings from the two\nuis match, and so the entire hypercube is colored in this way.\nThis is also valid for the P-gadget.\nLet us start from u1.\nNone of the removed edges has\ndistance less than 4 from this vertex, and six have distance 4. Since none of them are joined at a\nvertex whose distance from u1 is 4, we can apply the previous argument to the ones that are not\nremoved. This leaves only the edges whose hypercube distance from u0 is at most 3; but since no\nremoved edges have distance less than 3 from u0, this is the same as their actual distance, so we\nare done.\nIf the color of the edge in QX between u0 and u1 is represented in the plume of u−j, there is\na square path of length 8 going through u−j, u0, and u1. Hence this must be the one color in G∗\nthat is missing from the plume.\nIn the other two gadgets, all the edges except the clump closest to v1 have distance at most 3\nfrom the vertex u attaching them to QX, and thus are known to have colors from Z.\nNow, in P X we have paths τ0 = [a][b][ab], τ1 = [c][d][ac][ad], τ2 = [b][c][ab][ac], τ3 = [b][d][ab][ad]\neach between u±j and v0, and paths σ0 = [a][b][ab], σ1 = [c][ac][a], σ2 = [d][ad][a] each between\nu±j and v1. Now, vertex v0 is also vertex v1 of an E-gadget Ee′, and the color of e′ in G is xi\ni.\nSome path [k0][k1][k2] leads us to the vertex u1 of this gadget. Now, this means that we have a\npath [k2]τi[k0][k1][k2][C(τi)][k0][k1] through the two gadgets and Qxi\ni, which a nonrepetitive coloring\nwould require to have a loop. Hence in the group G = (G∗(Qxi\ni) ∪{0}, +) ∼= Zm\n2\nwe must have\na + b + ab = 0. Furthermore, since a possible Ti is (d, b, ab, ad), having a loop of size 3 means\nthat b + ab + d = 0 or b + ab + ad = 0, which contradicts the previous statement. Hence we have\nb + d + ab + ad = 0, and by the same argument b + c + ab + ac = 0. By addition we then have the\nstatements c + d + ac + ad = 0, a + c + ac = 0, and a + d + ad = 0. It is easy to see that we can\ncreate no more such identities using colors from Z(QX). By a similar argument, each σi must form\na loop in Qxf\ni , which gives us the same six identities.\nBy construction, the other two gadgets attached to QX are also preceded by xi\ni edge gadgets,\nso each path from v0 to u in these gadgets must have one of the three sets of colors {a, b, ab},\n{a, c, ac}, {a, d, ad}.\nNow, in N X, the edges whose distance from u is at most 3 are known to be in Z(QX). Further-\nmore, the two paths [ac][c][a] and [ad][d][a], if they were present starting from u, would create a\nsquare path where an edge adjacent to some u−j of P X repeats the edge between u0 and u. Now,\nif A is the set of colors coloring the cube in N X, it must be that P A = 0 in G(Qxi\ni). Thus it\nmust be that A = {a, b, ab} and that the vertices of the 4-hypercube that are adjacent to u and\nthose that are distance 2 away are effectively saturated. Hence by the saturation lemma all of the\n4-hypercube, except maybe the edges adjacent to v1, is colored from {c, d, ac, ad}. But to prevent\na square path through Qxf\ni , these last edges must also be colored from that set.\nWe apply a slightly different argument to CX. To prevent a repetition going through u−j and\nu1 of P X, either the set A0 of colors of the paths from v0 to u must be {a, ab, b}, or the edge labeled\nn must be colored b. Furthermore, if A0 = {a, ab, b}, to prevent a repetition going through u−j and\nu0, the edge labeled n must be colored c or d, and otherwise the edge labeled m must be colored c\nor d. The plumes at wi and y clearly cannot contain an edge of the same color as m, and the plumes\nat zi cannot contain an edge of the same color as n. Thus these vertices are effectively saturated,\nand we can apply the saturation lemma to the faces of the cube closer to u. Furthermore, if some\npj is the same color as an edge in the square, then we have a square path of length 6 through the\n14\n\ncorresponding wi and zk. Thus except for the edges adjacent to v1, we know that the paths from u\nto v1 must be colored from the set A1 = Z(QX) \\ A0. Now, by the argument above, G(Qxi\ni) must\nhave P A0 = 0, and thus so does G(Qxf\ni ). So P A1 = 0 in G(Qxf\ni ). Then to prevent a square path\nthrough Qxf\ni , the last edges of paths from u to v1 must also be colored from A1.\nClaim 2. Given a nonrepetitive coloring of H, for every existentially quantified variable x, there\nis a path from v0 to v1 of CX that has the same pattern of colors as a path from v0 to v1 of either\nN X or P X, but not both.\nProof. Let us assume the coloring of P X that we have implied: we have already shown that this\nis unique up to permutation. We have also already shown that given this coloring, N X must have\ncolors a, b, ab in the cube and c, d, ac, ad in the hypercube, and that CX must have one of the\nzero-sum sets of 3 colors on the shorter side and one of the zero-sum sets of 4 colors on the longer\nside.\nIf the shorter set is {a, b, ab} then clearly there is a path through the gadget that is the same\nas a path through N X. On the other hand, there is not a path that is the same as a path through\nP X, since no path through P X ends in c, d, ac, or ad.\nOtherwise the gadget contains either the path (a, ac, c, b, d, ad, ab) or the path (a, ad, d, b, c, ac, ab).\nThe removed edges in the P-gadget are all in either fourth or last position. Now, the edge ab ad-\njacent to v1 is present. Furthermore, the removed b-edges are preceded by the sets {ab, c, ac} and\n{ab, d, ad}, so they are not the b-edges in these paths. Hence, these paths are present in P X. Since\nthe first three colors cannot be a permutation of {a, b, ab}, there is no path that is the same as a\npath through N X.\nClaim 3. If ∀x∃y f(x, y), then every coloring of H has a square path.\nProof. Let us assume that we have a nonrepetitive coloring. It must then agree with claims 1\nand 2. From claim 1, the path c1 . . . c7 from v0 to v1 exists for all the E-gadgets. On the other\nhand, claim 2 tells us that a nonrepetitive coloring of a C-gadget is effectively a choice between\nthe corresponding N-gadget and P-gadget. So by choosing a y that satisfies f for the choice of x\nprovided by the coloring, we can create a long square path analogous to the one for G.\nNow, assuming that ∃x∀y ̸ f(x, y), we construct a coloring we claim to be nonrepetitive.\nLet x1, . . . , xp be an assignment to the universally quantified variables such that ∃y f(x, y) is not\nsatisfiable. We set aside 7 colors ai, bi, ci, di, abi, aci, adi for each consistency gadget Qwi, all of them\ndistinct. We color the E-gadgets so that for one, {ai, bi, abi} spans the distance from u0 to v0 and\n{ci, di, aci, adi} spans the distance from u0 to v1; for another, {ai, ci, aci} and {bi, di, abi, adi}; and\nfor the third, {ai, di, adi} and {bi, ci, abi, aci}. If G′ has a fourth edge of that color, then we make\nsure that the coloring of the gadget corresponding to the edge in the snout is different from all the\nothers, but color the fourth edge gadget in one of these three ways.\nFor a consistency gadget that controls a universally quantified variable xj, we color N xj and P xj\nin the way already described. We then color Cxj so that it contains the path (ai, bi, abi, ci, di, aci, adi)\nif xj = 1 and the path (ai, aci, ci, bi, di, adi, abi) if xj = 0.\nLet us set aside a set of 7 colors β1, . . . , β7 distinct from the ones enumerated so far.\nNow we need to color the consistency gadgets, which we do using the group method in [1]. First,\nwe assign the elements of the subgroup of Zm\n2\ngenerated by the first three generators to the set\ncontaining each edge gadget’s u0 and u1, whose cardinality clearly is at most 8. Furthermore, we\n15\n\nset the numbers of the vertices so that the sum of the colors of u0 and u1 within an edge gadget does\nnot depend on the edge gadget. Thus the colors of the edges between these vertices are nonzero\nmembers of this subgroup, and the edge between u0 and u1 is the same color for each edge gadget.\nWe assign to these edges the colors β1, . . . , β7, with β1 being the color between u0 and u1 for every\nE- and P-gadget.\nFor a consistency gadget corresponding to a universally quantified variable xi, we label the\nvertex u0 of P xi with 0 and the other three u-vertices with a generator of the subgroup. This\nensures that all the edges that connect two u-vertices are colored differently.\nNow, using the rest of the generators, we can find 2l−1 ≥c+2u subgroups Gg of Zm\n2 isomorphic\nto Z4\n2, one for each nonzero element g ∈Zm/4\n2\n, by taking the generators g0, g1, g2, g3 to have ith\ndigit gj\ni = g(j−i−3)/4 if 4 | j −i −3 and 0 otherwise.\nWe next arbitrarily assign group elements to the rest of the vertices, and hence edges. However,\nwe assign colors to the group elements in such a way that for each set Z(Qi) we take a distinct\nsubgroup of the kind described and assign ai, bi, ci, di to the generators and abi, aci, adi to the\nelements ai + bi, ai + ci, and ai + di, respectively.\nSince the first three digits are zero for all elements of these sets, we have guaranteed that we\ncan never get βi by adding together colors of edge gadgets.\nClaim 4. This coloring is nonrepetitive when restricted to a consistency gadget Q together with its\nedge gadgets.\nProof. We have already shown that the coloring of each gadget is nonrepetitive.\nA path within Q whose colors are contained in Z(Q) cannot reach a vertex at a distance of\nmore than 2 from the interface with colors in G∗. On the other hand, by construction, no colors\nin G∗(Q) are present in the edge gadgets within distance 2 of ui. Thus a portion of a square path\nwithin an edge gadget must be repeated at least partially in another edge gadget.\nFor an E-gadget, this means that one such portion must not be at the end of a path. Thus,\nsince the path is open, it goes through the edge gadget from u0 to u1, and contains an odd number\nof edges of each color in Z(Q). If some such portion is repeated by sections at both the beginning\nand end of the path, then one of these sections must be in an E-gadget, and therefore we can splice\nthe other section onto that one to create another open square path. Thus we can build a shorter\nsquare open path by replacing each such portion with the edge between u0 and u1, which we know\nhas the same color β1 for each gadget. But this substitution produces a square path entirely inside\nQ, which must be a loop.\nAssume now that Q corresponds to a universally quantified variable. We have already con-\nstructed our coloring so that a path starting from one of the edges adjacent to u−j and continuing\nto either C or N cannot repeat. Now, we did not color an edge adjacent to u−j by β1, so a path\nfrom u0 to u1 that is repeated by edges within P must be at least two edges long. But a path from\nu−j in colors from G∗(Q) may only be one edge long. Now, the set of colors separating u−j and ui\nis different from the set of colors separating u−3+j and u1−i. Therefore, we cannot find a square\npath that traverses both. So any square path must contain at least two sections within Q. Such\nsections, if they are each between two u-vertices, cannot repeat each other since by our construction\nthe group element leading between each pair of u-vertices is different. But such a path also cannot\nuse the plumes because any vertex in N and C has distance at most 4 from u, so this together with\nthe plumes would not be enough to repeat a path through P containing 7 distinct colors.\n16\n\nClaim 5. In a square path, colors in edge gadgets cannot be duplicated by the same colors in\nconsistency gadgets, except perhaps in one plume.\nProof. Suppose we have a square path that serves as a counterexample to this, with some sequence\nof colors occurring in an edge gadget E0 repeated by a sequence in a consistency gadget Q1. We\ngive the name p to this path and pΓ to the portion of it that goes through a gadget Γ. We orient\np so that pE0 comes before pQ1; we therefore refer to the first and second halves of p, and to ends\nand beginnings of sections.\nWe start with case 1: E0 does not belong to Q1 and pE0 is not at the beginning of p. Then\nthe ends of pE0 are vertices from the set {u±j}∪{vi}. By construction, the colors of any such path\nform a loop in Q1, so the path cannot be open.\nThus if E0 does not belong to Q1, then pE0 is the beginning of p. Then the edges following pE0\nmust come either from a consistency gadget Q0 (case 2) or another edge gadget E∗(case 3.)\nCase 2: In order to link the two half-paths, the first half must eventually leave Q0. If it leaves\nearly, so that an adjacent edge gadget is repeated in Q1, then we are back in case 1. If it leaves\nlate, so that it is repeated by an edge gadget adjacent to Q0, then we are also back in case 1: if the\npath ended in that edge gadget, then there would be nothing to repeat the edge gadgets between\nQ0 and Q1. Finally, if the vertex ui at which the path leaves Q0 is repeated by a vertex uj at which\nthe path leaves Q1, then since we are in different consistency gadgets, the edges we traverse have\ndifferent sets Z of colors, a contradiction.\nCase 3: If E∗does not belong to Q1, then it must be duplicated inside Q0, since the other\noption is an edge gadget belonging to Q0, which does not match colors. Therefore, substituting E∗\nfor E0, we get case 1 and a contradiction.\nSo E∗belongs to Q1. This means that the end of pE0 is vi. Furthermore, since pE∗must have\nodd numbers of at least three colors, and since pE0 is the beginning of p and therefore all of pE∗is\nin the first half, pE∗cannot be repeated in a plume of Q1. Thus Q1 must end with uj of an edge\ngadget E1 which repeats vi. If pE∗ends with v1−i, then pE1 ends with u1−j and we are again in\ncase 1. On the other hand, if pE∗ends at uk, then PE1 ends with vl, and so either we are back in\ncase 1 or the path ends after PE1. But that would mean that the colors of pE0 and pE1 would add\nup in G(Q1) to βi for some i, which contradicts the construction.\nThe remaining possibility, case 4, is that E0 belongs to Q1. Then for colors to match, the\npart of pQ1 that repeats pE0 must be contained in a plume of Q1 and therefore be the end of the\npath.\nClaim 6. No square path in this coloring goes through a consistency gadget.\nProof. By claim 5, colors in edge gadgets must be duplicated by colors in edge gadgets. Now,\nsuppose we have a square path p that goes through a consistency gadget Q. We use the notation of\nclaim 5 to denote portions of this path. On both sides of pQ, we have paths through edge gadgets\nE1 and E2. We now enumerate cases once again.\nCase 1 occurs when pE1 is a path between u0 and u1. Then there must be a subpath repeating\nit, which, by claim 5, then also goes from ui to u1−i in an edge gadget E∗\n1 of Q. We can create\nanother square path by replacing pE1 and pE∗\n1 by single edges within Q, reducing the problem to\nany of the other cases.\nSo we can assume that both pE1 and pE2 go to a vi. Then if we orient the path, one subpath\ngoes from an edge gadget to Q and the other goes from Q to an edge gadget. Therefore, by claim\n17\n\n5, one cannot be the repetition of the other. Thus p must traverse Q twice and associated edge\ngadgets four times, at least three of these times passing between a ui and a vi. (The fourth time\nit does not have to do this since a traversal may be split between the beginning and the end of p.)\nFurthermore, the edge subpaths must be in two pairs, each of which has one set of colors, and at\nleast one of the pairs must have both its subpaths continue in other edge gadgets.\nSuppose now that Q is not associated with a universally quantified variable. Case 2 occurs\nwhen the two subpaths are in the same E-gadget. Since no edge in G′ is adjacent to edges of one\ncolor through both incident vertices, the colors of the neighboring edge gadgets must be different\nand the path cannot be square.\nIn case 3, the two subpaths are in different E-gadgets. In order for them to be colored the\nsame, we must assume that Q controls four E-gadgets and neither of the E-gadgets traversed by\nthe subpaths corresponds to an edge in the snout of G′. But the edges not in the snout all border\ndifferent colors, so the path once again cannot be square.\nCase 4: We are left with the possibility of Qxj being associated with a universally quantified\nvariable xj. We colored Qxj in such a way, however, that the sets of paths within it between every\npair of u-vertices are disjoint. Therefore, if we orient p in a certain way, the second pQxj must be\nat the end of the path. By the same token, p must begin with a section in one of the edge gadgets\nbelonging to Qxj.\nAll the v0s of the edge gadgets of Qxj are incident to E-gadgets of colors Z(Qxi\nj) and all the\nv1s are incident to E-gadgets of colors Z(Qxf\nj ). Hence paths to v1 can be repeated by paths to v1\nand paths to v0 can be repeated by paths to v0. By construction, the possible repetitions of paths\nbetween uj and vi are then\n1. if xj = 0, a path between v0 and u in N xj with a path between v0 and u0 in P xj\n2. if xj = 1:\n(a) A path between v0 and u in Cxj with a path between v0 and u in N xj and a path\nbetween v0 and u0 in P xj\n(b) A path between v1 and u in Cxj with a path between v1 and u in N xj.\nIn each case, therefore, there can be only one such repetition in an open path. Since gadgets be-\nlonging to Qxj occupy both the beginning and the end of p, there may be no traversal of consistency\ngadgets other than Qxj within p.\nA path through N xj cannot repeat a path through P xj since these paths would have to go\nthrough edge gadgets corresponding to different direction-determining colors of G′. Also, a path\ngoing through v0 of Cxj is going towards the tip of the snout, and therefore cannot meet any more\ngadgets belonging to xj. This gives us a contradiction if v0 is part of one of the square sections.\nThus we are left with possibility 2(b).\nThis means that there must be a subpath consisting only of edge gadgets from v1 of Cxj to\nsome other vi of an edge gadget belonging to Qxj. If the path is from Cxj, then it must traverse an\nedge gadget belonging to Qa1\ni , which must be repeated by an edge gadget at the tip of the snout,\nwhich p cannot reach.\nThis restricts any potential square paths to going through a chain of edge gadgets. But this\nmeans that a square path maps to a square path in G′, which does not exist if ¬∀x∃y f(x, y). Hence\nthis is a reduction.\n18\n\nIt is easy to see that the reduction runs in polynomial time, specifically O(n8).\n7\nAcknowledgements\nWe would like to thank Chris Umans for his mentoring and helpful suggestions at every stage of\nthe research; and Grigori Mints and Yuri Manin for reviewing the proofs.\nReferences\n[1] N. Alon, J. Grytczuk, M. Hauszczak, and O. Riordan. “Nonrepetitive colorings of graphs.”\nIn M. K ́aronski, J. Spencer, and A. Ruci ́nski, editors, Proceedings of the 10th International\nConference on Random Structures and Algorithms (RS&A-01), volume 21, 3–4 of Random\nStructures and Algorithms, pages 336–346, Danvers, MA, Aug. 6–10 2002. Wiley Periodicals.\n[2] J. Bar ́at and P.P. Varj ́u. “On square-free vertex colorings of graphs.” Studia Scientiarum Math-\nematicarum Hungarica (to appear).\n[3] J. Bar ́at and P.P. Varj ́u. “On square-free edge colorings of graphs.” Ars Comb. (to appear).\n[4] B. Breˇsar and S. Klavˇzar. “Square-free colorings of graphs.” Ars Comb. 70:3–13, Jan. 2004.\n[5] Thomas F. Coleman and Jorge J. Mor ́e. “Estimation of sparse Hessian matrices and graph\ncoloring problems.” Math. Programming, 28(3):243—270, 1984.\n[6] S. Czerwi ́nski and J. Grytczuk. “Nonrepetitive colorings of graphs.” Electronic Notes in Discrete\nMathematics 28:453–459, 2007.\n[7] J. Grytczuk. “Nonrepetitive Colorings of Graphs—A Survey.” International Journal of Mathe-\nmatics and Mathematical Sciences, 2007.\n[8] Ian Holyer. “The NP-Completeness of Edge-Coloring.” SIAM J. Comput. 10:718–720, 1981.\n[9] D ́aniel Marx and Marcus Schaefer. “The Complexity of Nonrepetitive Coloring.” DePaul Uni-\nversity Technical Report, TR 07-007, 2007.\n[10] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hierar-\nchy:\na compendium” (updated version). SIGACT News, September 2002. Retrieved from\n.\n[11] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hi-\nerarchy:\nPart II” (updated version). SIGACT News,\nDecember 2002. Retrieved from\n.\n[12] Axel Thue. “ ̈Uber unendliche Zeichenreihen.” Norske Vid. Selsk. Skr. I, Mat. Nat. Kl. Chris-\ntiana 7, 1-22, 1906. Reprinted in Nagell, T.; Selberg, A.; Selberg, S.; and Thalberg, K. (Eds.).\nSelected Mathematical Papers of Axel Thue. Oslo, Norway: Universitetsforlaget, pp. 139-158,\n1977.\n19","paragraphs":[{"paragraph_id":"p1","order":1,"text":"arXiv:0709.4497v2 [cs.CC] 6 Dec 2007\nThe complexity of nonrepetitive edge coloring of graphs\nFedor Manin ∗\nOctober 25, 2018\nAbstract\nA squarefree word is a sequence w of symbols such that there are no strings x, y, and z for\nwhich w = xyyz. A nonrepetitive coloring of a graph is an edge coloring in which the sequence\nof colors along any open path is squarefree. The Thue number π(G) of a graph G is the least n\nfor which the graph can be nonrepetitively colored in n colors. A number of recent papers have\nshown both exact and approximation results for Thue numbers of various classes of graphs. We\nshow that determining whether a graph G has φ(G) ≤k is Σp\n2-complete.\nWhen we restrict to paths of length at most n, the problem becomes NP-complete for fixed\nn. For n = 2, this is the edge coloring problem; thus the bounded-path version can be thought\nof as a generalization of edge coloring.\n1\nIntroduction\nThe study of avoiding repetition in combinatorial structures stems from a 1906 paper by Axel Thue\n[12], which showed that a there is an infinite word in {0, 1, 2} that has no subword of the form xx\nfor some finite word x. Such a word is called squarefree.\nA paper by Alon, Grytczuk, Haluszczak, and Riordan [1] introduced the generalization to edge\ncolorings of graphs. An edge coloring of a graph is nonrepetitive if for any open path through the\ngraph, the pattern of colors along the path is squarefree. The Thue number π(G) is the smallest\nnumber k for which G can be nonrepetitively colored with k colors. Alon et al. also mentioned the\npossibility of studying vertex nonrepetitive colorings, i.e., vertex colorings with the same property.\nThis notion has been further studied in papers by Czerwi ́nski and Grytczuk [6] and by Bar ́at and\nVarj ́u [2]. Other similar notions involving walks rather than paths have been developed by Breˇsar\nand Klavˇzar [4] and again by Bar ́at and Varj ́u [3]. For a more detailed survey of results regarding\nvertex nonrepetitive colorings, we refer the reader to Grytczuk [7].\nThe many papers in this area employ various notations and terminologies; we will stick to the\noriginal terminology of Alon et al. whenever possible. Therefore, we refer to edge nonrepetitive\ncolorings simply as nonrepetitive colorings and denote the edge coloring Thue number as π(G). We\ncall a path square if it is of the form xx for some color-string x.\nOur goal is to study nonrepetitive colorings from the point of view of computational complexity.\nWhatever version of π(G) is used, deciding whether π(G) ≤k is an ∃∀problem: does there exist a\nk-coloring of the edges or vertices of G such that the pattern of colors along any open path, or one\n∗This research was conducted as part of the Summer Undergraduate Research Fellowship program at Caltech and\npartly supported by grant NSF CCF-0346991.\n1"},{"paragraph_id":"p2","order":2,"text":"of the kinds of walks, is squarefree? Such questions usually belong in the class Σp\n2 = NPNP, a class\nin the second level of the polynomial hierarchy. This class and problems known to be complete for\nit are described in a survey by Schaefer and Umans [10].\nMany of the results of papers on nonrepetitive colorings which bound the Thue number of\nvarious classes of graphs—for example, Alon et al.[1] show that π(G) ≤c∆2 for constant c for any\ngraph of degree ∆. On the other hand, Alon et al. also show that for any ∆there is a graph G of\nmaximum degree ∆such that any nonrepetitive vertex coloring of G requires at least c∆2/ log ∆\ncolors. Both these results, and many others like them, are probabilistic and thus give us little\ninformation about specific graphs.\nThe complexity of vertex nonrepetitive colorings has recently been studied by Marx and Schaefer\n[9], who showed that deciding whether such a coloring is nonrepetitive is coNP-complete. In this\npaper we show that the corresponding problem for edge colorings is coNP-complete. We then show\nthat deciding whether π(G) ≤k is Σp\n2-complete.\nFinally, we turn to colorings that are nonrepetitive for bounded-length paths. Let χe\ni(G) be the\nleast number of colors required to color the edges of G so that no open path contains the square\nof a pattern of colors of length ≤i, and let χi(G) be the least number of colors required to color\nthe vertices of G under analogous conditions. Since the number of paths of length 2i is bounded\nby |V |2i, for fixed i each such problem is contained in NP. Then χ1(G) ≤k is simply graph\ncoloring and χe\n1(G) ≤k is edge coloring, shown to be NP-complete by Holyer in 1981 [8].\nχ2(G) is known as the symmetric chromatic number; the corresponding decision problem is shown\nto be NP-complete by Coleman and Mor ́e [5]. We show that the decision problems corresponding\nto χe\n2(G) and χe\n2k(G) for any k ≥4 are NP-complete.\n2\nMethods\nThe nonrepetitive colorability of a graph with k colors is a rather slippery property. In the con-\nstruction of a nonrepetitive coloring, changing the color of an edge may produce a square path of\narbitrary length and thus affected by colors of edges arbitrarily far away. Thus the local properties\nof a graph cannot guarantee that it is nonrepetitively colorable. On the other hand, if a graph does\nnot have a nonrepetitive coloring, then we must examine all of the colorings and find a square path\nin each, which also feels like a hard problem. Thus neither direction of the reduction is easy.\nThere are two immediately visible approaches to resolving this dilemma. Perhaps we could focus\non fairly sparse graphs, thus minimizing the number of paths we must make sure are nonrepetitive.\nBut this would greatly increase the number of colorings we must consider.\nWe thus use this\napproach only in determining whether a preassigned coloring is nonrepetitive. On the other hand,\nwe could focus on graphs in which the degree of every vertex is close to the maximal degree of the\ngraph. Although this allows us to easily discard most possible colorings, the number of distinct\npaths grows exponentially. Additionally, it becomes harder to create graphs which differ subtly in\nglobal structure in such a way that some of them are nonrepetitively colorable and others are not.\nIn our proof, we combine these two approaches, producing graphs that are locally dense, in the\nsense that the degree of most vertices is large and close to the maximal degree, but globally sparse,\nin the sense that long paths must traverse a number of bottlenecks with only a few connections.\nWhile a pattern of local structures, or gadgets, is common to many if not all graph-theoretic\ncomplexity proofs, in this case in particular it allows us to partially isolate each portion of the\nproblem: once we have established that the local structure is nonrepetitively colorable in a very\n2"},{"paragraph_id":"p3","order":3,"text":"constrained set of ways, we can us this to determine whether the global structure is nonrepetitively\ncolorable.\nWe will first construct the global structure, which is similar to the well-known reduction which\nshows that hampath is NP-complete. The local structure, added later, will be composed of several\ntypes of dense subgraphs. The simplest of these are the cliques of size 2n, which Alon et al. show\nto be nonrepetitively colorable with 2n colors. We also use the n-dimensional hypercube graphs,\nwhich have a number of useful properties which are discussed in the next section. Finally, in a\nnumber of cases we will saturate a vertex v by adding extra vertices only joined to v, called the\nplume of v, to artificially inflate the degree. This will allow us to more effectively use the saturation\nlemma below.\n3\nPreliminaries\nWe will now prove some results about nonrepetitive colorings that will aid in the complexity proofs.\nLemma 1 (Saturation lemma). Let a vertex of a graph be saturated if it is of maximal degree, and\nlet a diamond be a cycle of four vertices. Suppose two opposing vertices of a diamond, A and B,\nin a graph of degree k, are saturated and the saturating edges are not directly connected. Then the\ngraph may only be k-nonrepetitively colored if the diamond is colored with exactly two colors.\nProof. Let a and b be the colors of one path from A to B through the diamond. Then, since A and\nB are saturated, there must be an edge of color b at A and an edge of color a at B, forming a path\nof colors abab. If this path is not a cycle, then the coloring is not nonrepetitive. Thus, these colors\nmust form the other half of the diamond.\nLemma 2 (Properties of hypercubes). The nonrepetitive k-edge-coloring of a k-hypercube exists,\nis unique up to permutation, and has the following properties:\n(1) The shortest path between any two points consists of distinct colors.\n(2) Any permutation of the colors of a path between two points consisting of distinct colors also\ncolors a path between those two points, and no other sequence of distinct colors does.\n(3) Any path consisting of distinct colors is a shortest path between its endpoints.\n(4) There are\n k\ni"},{"paragraph_id":"p4","order":4,"text":"vertices at distance i from a given vertex V .\nThe uniqueness of coloring also holds for portions of a k-hypercube whose distance from a chosen\nbase vertex V is at most m, which we call the first m layers of the hypercube.\nProof. We will identify the vertices of the hypercube with {0, 1}k, where there is an edge between\n(χ1, . . . , χk) and (χ1, . . . , χi−1, 1 −χi, χi+1, . . . , χk) for every i.\nWithout loss of generality, let us choose the vertex V identified with ̄0 to be a base vertex. V\nis saturated, so the coloring of the edges adjacent to it is unique up to permutation. Thus the\ncoloring of the first layer is unique. Now suppose that we have colored the first m layers. Every\nvertex is saturated and any two adjacent edges form a diamond (a face.) Hence by the previous\nlemma the coloring of the mth layer determines the coloring of the m + 1st layer. By induction,\nthe coloring of the first m layers is unique, and so is the coloring of the entire hypercube.\n3"},{"paragraph_id":"p5","order":5,"text":"To show that a coloring exists, let us use the color i for all edges for which χi changes between\nthe two vertices. For every i, the hypercube consists of two k −1-hypercubes, one in which the\nith coordinate is 0 for all vertices and one in which it is 1. Therefore, if we have a path containing\ntwo edges of color i, then we can create an alternate path with the same start and end vertices by\nremoving these two edges and reversing χi for the vertices in between them.\nNow suppose we have a square path. Then for every dimension, there is an even number of edges\nin that dimension on the path, and we can remove all these edges by pairs from the path. Thus\nthe path is equivalent to the empty path, is therefore a cycle, and all open paths are squarefree.\nWe will now use this construction to prove the rest of the properties. For (1), suppose that\nwe have a shortest path between two points that contains two edges of the same color. Then we\ncan remove these two edges and get a shorter path between the same two vertices. Therefore the\nshortest path must consist of distinct colors.\nFor (2), clearly a permutation of the changes to variables leads to the same result. On the other\nhand, for any two shortest paths whose sets of colors differ, there is an i such that χi is different\nbetween the two end vertices for one of the paths, but not for the other. Thus the end vertices are\ndifferent for the two paths.\n(3) follows directly from (1) and (2).\nA path of length i represents a change in i members of the k-tuple. There are\n k\ni"},{"paragraph_id":"p6","order":6,"text":"possible such\nchanges, proving (4).\n4\nNonrepetitive coloring problems\nIn this section, we consider several related problems in which the coloring is entirely or almost\nentirely predetermined, and the main difficulty of the problem is in finding whether the coloring is\nnonrepetitive. The proofs in this section are all related and provide a framework for the proof of\nthe Σp\n2-completeness of Thue number. We first consider colorings of directed graphs.\nTheorem 1. Given a directed graph G and a coloring thereof, it is coNP-complete to determine\nwhether the coloring is nonrepetitive. We call this problem directed nonrepetitive coloring.\nProof. We reduce from co-3SAT. The reduction is similar to the standard reduction from 3SAT to\nhampath. The edges are given a large number of colors, with 4 or fewer edges per color. In effect,\nwe restrict possible square paths to those that go through two edges of every color, mimicking the\nrequirement that a Hamilton path must pass through every vertex.\nLet f(x1, . . . , xn) be an instance of 3SAT. The reduction will use two types of gadgets: a variable\ngadget and a clause gadget.\nThe variable gadget consists of two sets of M vertices, where M is the largest number of number\nof instances of a literal, together with a beginning vertex bi. A path of edges goes from bi through\neach of the vertices in a set to bi+1, or a vertex c if i = n. The sets of vertices and paths going\nthrough them correspond to a true assignment and a false assignment; thus each set signifies a\nliteral.\nSuppose f has clauses numbered C1, . . . , Cm. A clause gadget for clause Cj has one vertex ej,\nand we add an extra vertex d and an edge from c to e1. For each literal in Cj, we add an edge from\nej to a vertex on the path corresponding to this literal and an edge from this vertex to ej+1 or d if\nj = m, making sure that this is the only clause gadget that uses this vertex.\n4"},{"paragraph_id":"p7","order":7,"text":"Figure 1: The graph generated by (x ∨y ∨z) ∧(¬x ∨¬y ∨¬z) ∧(x ∨¬y ∨¬z), with a square path\nhighlighted.\nTo complete the construction of the graph, we add a series of vertices a0, . . . , aMn+2m and edges\nconnecting ai to ai+1 and aMn+2m to b1. We call this structure the snout. We must now assign\na coloring to this graph. We will use a set w1, . . . , wMn+2m+1 of colors. Starting from the tip, we\ncolor the ith edge of the snout with wi. We color the kth edge of a path through the xi-gadget by\nwM(i−1)+k; an edge going into ej by wMn+2j−1; an edge leaving ej by wMn+2j; and an edge going\ninto d by wMn+2m+1.\nGiven a satisfying assignment to f, we can construct a square path by first traversing the snout,\nthen taking the path through each variable gadget corresponding to the opposite of its assignment\nand the path through each clause gadget corresponding to a true literal, as illustrated for an\nexample. Conversely, if we have such a path, then taking the opposite of a traversed literal-path\nto be true gives us a satisfying assignment.\nNow suppose that f is unsatisfiable, and that there is a square path p, which then cannot have\nthe form above. Suppose first that the edges of p are colored only by the colors of the variable\ngadgets. Since the colors of the variable gadgets form the tip, but not the base of the snout, p must\nconsist only of the variable gadgets themselves; but this is impossible since the variable gadgets\ncan only be traversed in the forward direction and thus a path through them has no two edges of\nthe same color.\n(*) Thus p must contain edges from clause gadgets. Since any two edges in a clause gadget\nthat share a color also share a vertex, an open path can contain only one of such a set. Thus,\nfor every color a that colors an edge of p contained in a clause gadget, p contains an edge in the\nsnout of color a. Since b1 is only the source of the two branches of the first variable gadget, one of\nthese two branches must also be contained in the path. Furthermore, since these branches share a\nvertex, only one of them may be contained in p. The only other edge colored by w1 is the edge at\nthe very tip of the snout; thus the entire snout must be contained in p, so p must contain a path\nbelonging to each variable and clause gadget. As above, this defines a satisfying assignment to f,\na contradiction.\nClearly, this reduction runs in polynomial, in fact quadratic, time.\nRemarks. The graph resulting from this reduction has maximum in- and out-degree 3. Each color\nis repeated at most four times.\nFrom this we can fairly easily show the same result for undirected graphs.\nTheorem 2. Given an undirected graph G and an edge-coloring thereof, it is coNP-complete to\ndetermine whether the coloring is nonrepetitive. We call this problem nonrepetitive coloring.\n5"},{"paragraph_id":"p8","order":8,"text":"Figure 2: The graph that replaces a snout edge of color yj.\nProof. We will now modify the previous reduction to work with undirected graphs. Let us add the\ncolors aj\ni, bj\ni, cj\ni , dj\ni, for i ∈{1, 2, 3} and j ≤Mn + 2m + 1. We call these the direction-determining\ncolors and the rest the original colors. We replace every edge inside the snout with the graph in\nfigure 2 and every edge outside the snout with the path aj\nibj\niwjcj\nkdj\nk for some i, k ∈{1, 2, 3}. This\ncan be done in such a way that there are no trivial repetitions, that is, no two edges of the same\ncolor are incident to the same vertex, since the maximum in- and out-degree of the directed graph\nis 3. Clearly, this construction retains the property that each color colors no more than four edges,\nsince none of the direction-determining colors need color more than two edges. We will show that\nthis modification leaves the reduction valid.\nIf f has a satisfying assignment, we can traverse the graph as before, choosing the right path\nthrough the snout to produce the same ais, bis, cks, and bks as in the other half of the path.\nNow suppose that f is unsatisfiable. Suppose that the graph has a square path. Clearly, this\npath must contain direction-determining colors. Each such color is represented only once in the\nnon-snout edges, so we cannot make a square path without any snout edges. This means that the\nparagraph marked (*) in the previous proof still applies, and we are done.\nWe now modify the statement of the problem slightly in order to get a Σp\n2-complete problem.\nTheorem 3. Given an undirected graph G and a set S of pairs (e, Se) for each edge e, with Se a\nset of colors, it is Σp\n2-complete to determine whether there exists a nonrepetitive coloring of G that\nuses a color se ∈Se for each e. We call this problem restricted Thue number.\nIn our case, Ke will contain at most two colors for any edge, and only one color for most edges.\nProof. Clearly, the problem is in Σp\n2. To prove that it is Σp\n2-hard, we shall slightly modify the\nprevious reduction, reducing from co-∀∃3SAT. Let ∀x∃yf(x, y) be an instance of ∀∃3SAT. Our\ngraph G will be the graph constructed for ∃x, y f(x, y) in Theorem 2. For each universally quantified\nvariable, the two original edges that initially separate the variable gadget into a “true” and a “false”\nbranch are given the sets {w1\ni } and {w0\ni } respectively, where wi is the color given these edges in\nthe previous reduction. The corresponding edge in the snout is given the set {wt\ni, wf\ni }. The rest of\nthe edges are given singletons containing the color they were colored in the previous reduction.\nThus a coloring of the graph satisfying the restriction corresponds to an assignment of x, since it\nforces any potentially square path to go through the specified branch of the corresponding variable\ngadget. This means, by the previous construction, that there is such a nonrepetitive coloring of G\niffthere is an assignment to x for which ∃yf(x, y) is unsatisfiable.\nThis proof provides the final incarnation of the global structure which we will later harness to\nshow that Thue number is Σp\n2-complete.\n6"},{"paragraph_id":"p9","order":9,"text":"Figure 3: A clam.\n5\nProblems concerning bounded-length paths\nIn this section, we explore two problems in which we consider a polynomial number of possibly\nsquare paths, and therefore only the existential quantifier in the statement of the problems is over\nan exponentially large domain. Together, the problems form a generalization of edge coloring,\na problem which was shown to be NP-complete by Holyer in 1980 [8].\nIn these proofs, we employ several tricks to find graphs whose small-diameter subgraphs are\nrestricted in the ways they can be colored nonrepetitively. These tricks will later find applications\nin the proof of the Σp\n2-completeness of Thue number. Thus although this material is not directly\nrelated to the main result, it builds some machinery for its proof. Still, a reader interested only in\nthe main proof may go on to the next section.\nTheorem 4. It is NP-complete to determine whether χe\n2(G) ≤6.\nProof. We reduce from edge coloring for cubic graphs (graphs with 3 edges incident to every\nvertex) and 3 colors, which is shown to be NP-complete in [8]. The reduction consists of replacing\neach edge of graph G with the graph depicted in Fig. 3, which we shall call a clam. The vertices\nincident to the edge are mapped to A and B. We shall argue that the resulting graph H can be\n6-colored with nonrepetitive 4-paths iffG can be 3-colored. Suppose that we have such a coloring,\nand call the six colors a, b, c, d, e, f.\nNote first that vertices A and B are both saturated, since they are images of vertices of G of\ndegree 3, so the outer diamond of the clam only has two colors—without loss of generality, a and\nb. Now suppose that one of the inner four edges (let us call them the gills) is colored a. Then if\nthe color of an edge of the inner diamond connected to this edge is c, there is a path acac through\ngill, inner diamond, outer diamond, and an edge of another clam. Thus the gills must be colored\ndifferently from the outer diamond, as must the inner diamond since it is adjacent to the outer one.\nThis means that the vertex labeled V and the one symmetric to it are saturated for the four colors\nother than a and b, and thus the inner diamond must be colored with exactly two colors (c and d.)\nNow let us add two more clams, incident to vertices C and D respectively, at vertex A. Suppose\nthat the outer colors of the clams are ce and df respectively. Then to prevent square paths of the\ntype acac from the inner diamond of clam AC to the inner diamond of clam AB, the inner diamonds\nof clams AC and AD must consist of the colors df and ce respectively. But then we get square\npaths of the form dcdc from the inner diamond of clam AC to the inner diamond of clam AD. Thus\nthe outer colors of AC and AD must be cd and ef, in some order. Furthermore, the inner colors\nof AC must be ef to prevent acac-type repetitions. This forces the inner colors of AD to be ab.\nThis means that the coloring of one clam at a vertex of G determines the sets of colors available\n7"},{"paragraph_id":"p10","order":10,"text":"to the other clams; by induction, each clam in the graph must be colored using one of these three\npatterns.\nThis means that if we have a 3-coloring of G, we can map the three colors onto the three clam-\ncoloring patterns to produce a 2-nonrepetitive 6-coloring of H; conversely, with a nonrepetitive\n6-coloring of H, we can map the three clam-coloring patterns onto three colors with which we can\nedge-color G.\nTheorem 5. For any natural number k ≥4 and graph G, it is NP-complete to determine whether\nχe\n2k(G) ≤6k.\nProof. This is a generalization of the previous reduction. However, one must view the clam not\nas a unified gadget, but as a combination of elements of three gadgets. The two edges incident\nto vertex A belong to vertex gadget A, and likewise for vertex B. The edge gadget proper, then,\nconsists of the inner diamond and the gills.\nWe again reduce from edge coloring for cubic graphs in 3 colors. Let G be a cubic graph.\nWe associate to G a 3-coloring C(e) of the edges. As we construct the gadgets in the reduction,\nwe will also construct a 6k-coloring of the edges based on C(e). Later, we will show that this\ncoloring is 4k-nonrepetitive iffC(e) is a valid edge coloring, and that no other coloring of the edges\nis 4k-nonrepetitive. We shall now enumerate the elements of the reduction, which reduces G to a\ngraph H.\nThe vertex gadget consists of the first k layers of a 6k-hypercube with respect to a central vertex\nK. By the hypercube lemma, this has a unique nonrepetitive coloring.\nNow let us divide the 6k colors into three groups of 2k, called red, green, and blue. We shall\nuse the term grue to refer to the union of the sets blue and green. The elements of the sets will be\nreferred to as shades. For each of the groups, there are\n 2k\nk"},{"paragraph_id":"p11","order":11,"text":"vertices whose distance from K is k\nsuch that the path to them from K consists of edges of colors from that group. We identify these\nvertices with an analogous group from another vertex gadget (with central vertex L) in order to\nform an edge.\nClaim 1. In a 4k-nonrepetitive coloring, the colors of the edges on either side of this connection\nare in the same set of 2k.\nProof. Suppose we have a 4k-nonrepetitive coloring that does not have this property. Then take\nan arbitrary path from K to L of length 2k, say with color pattern r1, . . . , rk, b1, . . . , bk. By the\nproperties of the 6k-hypercube, there must be a path starting with K of pattern bk, . . . , b1 and a\npath starting with L of pattern r1, . . . , rk. This forms a square path of length 4k, which must then\nbe a cycle. This means that the sets of colors on either side of the inter-vertex interface are the\nsame. Assume they are both red. Then, since the fully-red paths from K to L form a 2k-hypercube,\nthey can be colored nonrepetitively.\nWe assume now that we are working with two vertices, K and L, that are joined by a red edge.\nThe construction for the other two sets is analogous.\nIt remains to add a gadget that will force the green and blue sets of one vertex to be the same\nas the green and blue sets of the other. To this end, we take two vertices, A and B, on the interface\nbetween two vertex gadgets, whose distance from each other is 2k, to be two ends of a consistency\ngadget.\nThe consistency gadget is a 4k-hypercube modified in two ways.\nFirst, every vertex whose\ndistance from A and B is 2 or more has a plume of 2k additional edges leading to disconnected\n8"},{"paragraph_id":"p12","order":12,"text":"vertices. A red edge separated by one edge from A or B generates a square path of length 4, so this\nmeans all the vertices of the hypercube are effectively saturated. This implies that the hypercube\nis entirely grue and the plumes are red. On the other hand, the farther red plume edges do not\ngenerate such a path, since it would have to repeat a red edge followed by two or more grue edges\nas a path from the red interface vertices, and thus required by hypercube property (3) to stray a\ndistance more than k from the central vertex of the vertex gadget.\nNext, for every path starting at A or B and consisting of k edges of distinct shades of green, we\nremove the last edge. We then do the same for blue. We also remove all red plume edges incident\nto the vertices that are left unsaturated by this removal. We call the kth layer of the hypercube\nfrom either A or B the gap layer.\nClaim 2. This consistency gadget is uniquely 4k-nonrepetitively 6k-colorable up to isomorphism.\nThis coloring is such that the hypercube edges are grue and colored as the restriction of a full\nhypercube, and the plumes are red.\nProof. Any diamond containing edges in the layer adjacent to the gap layer has two saturated\nvertices at equal distance from the vertex gadget. Suppose there is an edge between two vertices\nthat are both unsaturated due to the removal. If those two vertices both became unsaturated from\nthe removal of edges of the same color, then the edge would have to be of that color, and thus\nalso removed. On the other hand, an edge between two vertices that are unsaturated due to the\nremoval of different colors would not exist by hypercube property (2). Thus any diamond that has\nedges in the gap layer has saturated vertices either laterally or vertically, and so by the saturation\nlemma the coloring is a restriction of the full hypercube.\nWe then add a second, identical consistency gadget at vertices C and D whose distances from\nA and B are at least 4. (This distance prevents a square path consisting of a red plume edge in\nthe first consistency gadget, then some path through it, then two red edges, the same path through\nthe second consistency gadget, and another red plume edge.)\nWe refer to the set of colors that form the interface between two vertex gadgets as an edge set.\nClaim 3. If the original graph is not 3-edge-colorable, the resulting graph is not 4k-nonrepetitively\n6k-edge-colorable.\nProof. Given a red edge set, suppose that another edge set of the same vertex gadget with central\nvertex K, belonging to edge e of G, has both green and blue parts. This means that that one of\nits consistency gadgets will have a path to it that contains both green and blue, since if one of the\nconsistency gadgets has an all-blue side and an all-green side, then the other one does not. Thus\nwe can find a square path consisting of:\n1. a red plume edge that duplicates the last edge of (3),\n2. a path of length k in a consistency gadget of the red edge that duplicates (4),\n3. a path from the consistency gadget of the red edge set to K,\n4. a mixed blue-green path from K to one of the blue-green edge set’s consistency gadgets, and\n5. a path of length k −1 in this consistency gadget that duplicates the first k −1 edges of (3).\n9"},{"paragraph_id":"p13","order":13,"text":"Therefore, the edge sets cannot be of mixed colors with respect to the red edge set’s consistency\ngadget.\nClaim 4. If G is 3-edge-colorable, then the coloring of H which we have described is 4k-nonrepetitive.\nProof. Suppose that G is 3-edge-colorable, and let p = qr be a square path in H of length at\nmost 4k, where q and r are the repetitions of the pattern. The portion of p inside a gadget G\nwill be called pG. Clearly, p cannot be wholly inside a consistency gadget. We have also already\nestablished that p cannot be wholly outside any consistency gadgets. Thus it include edges from\nboth consistency and vertex gadgets. Since a consistency gadget has distance 4k between its two\nattachment points, p cannot have a consistency gadget in the middle. In introducing the red plumes\nin the consistency gadget, we also showed that the whose middle vertex of p cannot be a junction\nbetween a consistency gadget and a vertex.\nThus at least one half-path of p (without loss of generality, q) contains parts of both a consistency\ngadget T and a vertex gadget J with center K. qT contains at most one of the colors that are\nfound on a shortest path to K from the juncture with the consistency gadget. If such a color is in\nqT , it must be a plume, which forces qT to be at least three edges long.\nSuppose now that the rest of p is contained in J. We will show that the distance from the last\nvertex V of p to K is greater than k, a contradiction. If a color has both of its repetitions inside\nJ, these cancel each other out, so we are left with the edges that repeat qT . But since there is at\nleast one more grue than red edge in qT, this means that our initial distance k from K increases\nby at least one.\nThis means that p must access either a consistency gadget or another vertex gadget. Without\nloss of generality, assume that T belongs to a red edge set.\nCase 1: p accesses a second consistency gadget that belongs the same edge set. Then there are\nat least four shades of red that are repeated an odd number of times in the vertex gadget portion of\nthe path. Since there is at most one red edge in each consistency gadget part of the path, nothing\ncan repeat these edges.\nCase 2: p accesses a different consistency gadget, without loss of generality from a blue edge\nset. Then pJ must contain at least 2k colors that color an odd number of edges, since the distance\nbetween the two consistency gadgets is 2k. This is the maximal number of distinct colors in the path\nwe are considering, so each of the 2k must be repeated in one of the two consistency gadgets. This\nmeans that one of the consistency gadgets contains a red-blue path of length at least k. However,\nthis must pass through edges that we have removed, so no such path exists.\nCase 3: p accesses a vertex gadget J′ ̸= J which interfaces J at a non-red edge set. This again\nmeans that there are 2k distinct colors in pJ, and the 2k edges in pT and pJ′ must repeat these. In\nparticular this means that the edge that repeats the edge of pJ adjacent to T must be the edge of\npJ′ adjacent to J, and so this edge must be colored a shade of red, which is a contradiction.\nCase 4: p accesses a vertex gadget J′ which interfaces J at the red edge set. Each time that\npJ or pJ′ traverses a grue edge before the last vertex in p that belongs to both J and J′, another\nedge of the same color must be accessed, by hypercube property (3). Since there must be an even\nnumber of edges of any color, this means that unrepeated edges in the consistency gadget must be\nrepeated by similar edges in the portion after this last crossover. Also, since all but at most one\nshade of red has to be traversed twice within the non-consistency-gadget portion, all the red colors\ntogether bring the path to within one edge of the border of a vertex gadget. But in that case there\n10"},{"paragraph_id":"p14","order":14,"text":"are at least two grue edges in the consistency gadget portion, again pushing the path beyond the\nradius of the vertex gadget.\nThus there is no way for such a p to exist.\nThis means that the resulting graph may be 4k-nonrepetitively 6k-edge-colored iffthe original\ngraph can be 3-edge-colored. Note that there is nothing special about the original graph being\nof degree 3.\nIf the original graph is regular of degree d, then we can construct a similar new\ngraph with a vertex gadget being a slice of a 2dk-hypercube, a consistency gadget being a modified\n2(d −1)k-hypercube, and so on.\nTaking into account the vertex and consistency gadgets, for an original graph with a edges, the\nresulting graph of this reduction has Θ(2a\nd ·22dk +a·22(d−1)k) = Θ(a\nd22dk) edges. This means that if\nk depends logarithmically on a, then the reduction still runs in polynomial time with respect to a.\nThis raises questions about other versions of the problem where k is not constant, but a sub-linear\nfunction of |G|.\n6\nTHUE NUMBER\nWe now proceed to the main result of the paper, showing that Thue number is Σp\n2-complete.\nWe use a reduction based on that of Theorem 3, taking a graph very similar to that produced in\nTheorem 3 and replace the edges with various gadgets depending on their function in that reduction.\nWe also add constraint gadgets in order to force the edge gadgets that would have been colored\nthe same in Theorem 3 to still have similar patterns of colors. After we show that a nonrepetitive\ncoloring of this graph must satisfy a large number of constraints stemming from this local structure,\nwe can use the global structure from Theorem 3 to show that an actual nonrepetitive coloring exists\nif and only if the ancestral instance of co-∀∃3SAT is positive.\nWhile this is the idea of the proof, in reality, the local structure is not cleanly separated from\nthe global structure: the format of the latter helps constrain the former.\nTheorem 6. Thue number is Σp\n2-complete.\nProof. Given an instance ∀x∃y f(x, y) of co-∀∃3SAT, we will refer to the instance (G, S) of re-\nstricted Thue number constructed in Theorem 3. Let c = |S S| be the number of colors coloring\nG, u = |y|, and let lbe the smallest integer such that 2l≥c + u + 1 and m = 4l+ 3.\nLet w0\ni , w1\ni be the two colors corresponding to the universally quantified variable xi. Then we\nmodify G by introducing new colors wI\ni and wF\ni and replacing each edge colored by A ⊆{w0\ni , w1\ni }\nby three edges in series colored {wI\ni }A{wF\ni }. Clearly, this graph (G′, S′) ∈restricted Thue\nnumber iff(G, S) is. We construct from this graph an instance (H, 2m + 6) of Thue number.\nLet S∗be the set of colors that are not wj\ni for j ∈2. For every edge e of G′ whose color is\nfrom S∗, we add to H a 7-hypercube Ee with two opposing vertices (v0 for the one closer to the\ntip of the snout along a potentially square path and v1 for the other one) acting as the vertices of\nthe edge gadget. For each color s ∈S∗and for each pair Xi = {x0\ni , x1\ni }, we also add a consistency\ngadget Qs (respectively Qi\nX). This consists of a 2m-clique with every vertex identified either with\nthe central vertex of the first two layers of a 7-hypercube, called the plume emanating from this\nvertex, or with a vertex of an edge gadget. For each edge e whose color is s, two vertices of Ee are\nidentified with vertices of Qs: u0 for one that is distance 3 from v0 and u1 for one that is distance\n4 from v0.\n11"},{"paragraph_id":"p15","order":15,"text":"Figure 4: A C-gadget.\nIt may be thought of as a sequence of strung-together hypercubes of\ndimensions 2, 1, 1, and 3, together with plumes that inflate the degree of some vertices.\nFigure 5: A C-gadget. It may be thought of as two hypercubes of dimensions 3 and 4 together\nwith plumes that inflate the degree of some vertices.\n12"},{"paragraph_id":"p16","order":16,"text":"For the edges colored by subsets of {x0\ni , x1\ni }, the choice edge in the snout becomes the gadget\ndepicted in Fig. 4, which we call a C-gadget or Ci. The negative edge in the variable gadget becomes\nthe gadget depicted in Fig. 5, which we call an N-gadget or N i. In both cases, the asterisked vertex\nu is identified with a vertex of QXi and v0 and v1 are connected to other edge gadgets.\nFinally, the other edge becomes a P-gadget P i. This is a 7-hypercube attached to the consistency\ngadget in the same way as Ee, but is modified in several ways. In order to explain this, let us first\nlabel the dimensions of the hypercube a, b, c, d, ab, ac, ad. (This labeling will be explained later.)\nLet a, b, ab span the distance from u0 to v0, and, correspondingly, let c, d, ac, ad span the distance\nfrom u0 to v1. Let us eliminate the edges c, d, ac, ad adjacent to v1. We then nearly saturate the\nvertices that are separated from u0 by the paths (a, c, ac) and (a, d, ad) (call them u−1 and u−2\nrespectively) with 2m −2 additional edges, but then remove the original edges corresponding to b\nfrom both and c and d from u−1 and u−2 respectively.\nNow that we have constructed a graph, we will attempt to color it nonrepetitively with k colors,\nand show that it has a nonrepetitive coloring iffthe instance of ∀∃3SAT is negative. Let us call the\nset of colors K and call the color of an edge e under a hypothetical coloring C(e). Conversely, we\ndenote by [c] an edge of color c if its more precise identity is irrelevant.\nClaim 1. Let e1, . . . , en be the set of edges of color s ∈S∗. Then in a nonrepetitive coloring, Eei\nmust all be colored with the same 7 colors. Similarly, for every i, Ci, N i, and the hypercube portion\nof P i must all be colored with the same 7 colors.\nProof. Suppose we have a nonrepetitive coloring C(e).\nInside each consistency gadget Q, each vertex of the 2m-clique is saturated. Let u, v, and w be\nsuch vertices, and suppose that C(uv) is the same as the color of the edge of a plume adjacent to\nw. Then there is an edge of color C(uw) adjacent to v. Together with uw, these four edges then\nform a square path. To avoid this, the set Z(Q) of 7 colors that colors the first layer of each plume\nmust be disjoint from the set G∗(Q) of 2m −1 colors that colors the clique. By a similar argument,\nthe second layer of every plume must also have a color in Z(Q). According to [1], the coloring can\nbe constructed in such a way that G∗(Q) consists of the nonzero elements of the group Zm\n2 . (From\nnow on we will refer to just Z and G∗when Q is clear from the context.)\nBy the same token, the edges in the edge gadgets of distance at most two from ui must be\ncolored with colors from Z.\nNow suppose we have an edge e that has distance 3 from ui.\nIf\nC(e) ∈G∗, then the path consisting of e and the two edges that connect it to ui can be duplicated\ninside the consistency gadget, so C(e) ∈Z.\nThe maximum distance of an edge in any edge gadget from the closer ui is 4. Let us first\nconsider a gadget Ee, and let Z = {c1, . . . , c7}. We know that edges in the first three layers from\nu0 have colors in Z, so they must be arranged according to the hypercube lemma. Let wijk be\nseparated from u0 by edges [ci][cj][ck]. Let e4 be the edge incident to w123 that would be colored\nc4 if Ee were nonrepetitively colored by Z, and let e3 be the edge incident to w124 that would be\ncolored c3. These edges are adjacent.\nNow we have four cases, since both C(e3) and C(e4) can be either in Z or in G∗. Suppose that\nC(e3), C(e4) ∈Z. Then if it is not true that C(e3) = c, C(e4) = d, and we don’t have a trivial\nrepetition, then we have a square path of the form [c1][c2]e4e3[c1][c2][C(e4)][C(e3)]. So suppose that\nC(e4) ∈G∗. But we have a square path [C(e3)][C(e4)][c2][c4][c1]e3e4[c2][c4][c1] that starts with two\nedges of the consistency gadget. Finally, if C(e4) ∈Z but C(e3) ∈G∗, we have the analogous path\n[C(e4)][C(e3)][c2][c3][c1]e4e3[c2][c3][c1].\n13"},{"paragraph_id":"p17","order":17,"text":"Hence in a nonrepetitive coloring the fourth layer is also colored by Z according to the hypercube\nlemma. Since we can prove the same thing starting from u1, this means the colorings from the two\nuis match, and so the entire hypercube is colored in this way.\nThis is also valid for the P-gadget.\nLet us start from u1.\nNone of the removed edges has\ndistance less than 4 from this vertex, and six have distance 4. Since none of them are joined at a\nvertex whose distance from u1 is 4, we can apply the previous argument to the ones that are not\nremoved. This leaves only the edges whose hypercube distance from u0 is at most 3; but since no\nremoved edges have distance less than 3 from u0, this is the same as their actual distance, so we\nare done.\nIf the color of the edge in QX between u0 and u1 is represented in the plume of u−j, there is\na square path of length 8 going through u−j, u0, and u1. Hence this must be the one color in G∗\nthat is missing from the plume.\nIn the other two gadgets, all the edges except the clump closest to v1 have distance at most 3\nfrom the vertex u attaching them to QX, and thus are known to have colors from Z.\nNow, in P X we have paths τ0 = [a][b][ab], τ1 = [c][d][ac][ad], τ2 = [b][c][ab][ac], τ3 = [b][d][ab][ad]\neach between u±j and v0, and paths σ0 = [a][b][ab], σ1 = [c][ac][a], σ2 = [d][ad][a] each between\nu±j and v1. Now, vertex v0 is also vertex v1 of an E-gadget Ee′, and the color of e′ in G is xi\ni.\nSome path [k0][k1][k2] leads us to the vertex u1 of this gadget. Now, this means that we have a\npath [k2]τi[k0][k1][k2][C(τi)][k0][k1] through the two gadgets and Qxi\ni, which a nonrepetitive coloring\nwould require to have a loop. Hence in the group G = (G∗(Qxi\ni) ∪{0}, +) ∼= Zm\n2\nwe must have\na + b + ab = 0. Furthermore, since a possible Ti is (d, b, ab, ad), having a loop of size 3 means\nthat b + ab + d = 0 or b + ab + ad = 0, which contradicts the previous statement. Hence we have\nb + d + ab + ad = 0, and by the same argument b + c + ab + ac = 0. By addition we then have the\nstatements c + d + ac + ad = 0, a + c + ac = 0, and a + d + ad = 0. It is easy to see that we can\ncreate no more such identities using colors from Z(QX). By a similar argument, each σi must form\na loop in Qxf\ni , which gives us the same six identities.\nBy construction, the other two gadgets attached to QX are also preceded by xi\ni edge gadgets,\nso each path from v0 to u in these gadgets must have one of the three sets of colors {a, b, ab},\n{a, c, ac}, {a, d, ad}.\nNow, in N X, the edges whose distance from u is at most 3 are known to be in Z(QX). Further-\nmore, the two paths [ac][c][a] and [ad][d][a], if they were present starting from u, would create a\nsquare path where an edge adjacent to some u−j of P X repeats the edge between u0 and u. Now,\nif A is the set of colors coloring the cube in N X, it must be that P A = 0 in G(Qxi\ni). Thus it\nmust be that A = {a, b, ab} and that the vertices of the 4-hypercube that are adjacent to u and\nthose that are distance 2 away are effectively saturated. Hence by the saturation lemma all of the\n4-hypercube, except maybe the edges adjacent to v1, is colored from {c, d, ac, ad}. But to prevent\na square path through Qxf\ni , these last edges must also be colored from that set.\nWe apply a slightly different argument to CX. To prevent a repetition going through u−j and\nu1 of P X, either the set A0 of colors of the paths from v0 to u must be {a, ab, b}, or the edge labeled\nn must be colored b. Furthermore, if A0 = {a, ab, b}, to prevent a repetition going through u−j and\nu0, the edge labeled n must be colored c or d, and otherwise the edge labeled m must be colored c\nor d. The plumes at wi and y clearly cannot contain an edge of the same color as m, and the plumes\nat zi cannot contain an edge of the same color as n. Thus these vertices are effectively saturated,\nand we can apply the saturation lemma to the faces of the cube closer to u. Furthermore, if some\npj is the same color as an edge in the square, then we have a square path of length 6 through the\n14"},{"paragraph_id":"p18","order":18,"text":"corresponding wi and zk. Thus except for the edges adjacent to v1, we know that the paths from u\nto v1 must be colored from the set A1 = Z(QX) \\ A0. Now, by the argument above, G(Qxi\ni) must\nhave P A0 = 0, and thus so does G(Qxf\ni ). So P A1 = 0 in G(Qxf\ni ). Then to prevent a square path\nthrough Qxf\ni , the last edges of paths from u to v1 must also be colored from A1.\nClaim 2. Given a nonrepetitive coloring of H, for every existentially quantified variable x, there\nis a path from v0 to v1 of CX that has the same pattern of colors as a path from v0 to v1 of either\nN X or P X, but not both.\nProof. Let us assume the coloring of P X that we have implied: we have already shown that this\nis unique up to permutation. We have also already shown that given this coloring, N X must have\ncolors a, b, ab in the cube and c, d, ac, ad in the hypercube, and that CX must have one of the\nzero-sum sets of 3 colors on the shorter side and one of the zero-sum sets of 4 colors on the longer\nside.\nIf the shorter set is {a, b, ab} then clearly there is a path through the gadget that is the same\nas a path through N X. On the other hand, there is not a path that is the same as a path through\nP X, since no path through P X ends in c, d, ac, or ad.\nOtherwise the gadget contains either the path (a, ac, c, b, d, ad, ab) or the path (a, ad, d, b, c, ac, ab).\nThe removed edges in the P-gadget are all in either fourth or last position. Now, the edge ab ad-\njacent to v1 is present. Furthermore, the removed b-edges are preceded by the sets {ab, c, ac} and\n{ab, d, ad}, so they are not the b-edges in these paths. Hence, these paths are present in P X. Since\nthe first three colors cannot be a permutation of {a, b, ab}, there is no path that is the same as a\npath through N X.\nClaim 3. If ∀x∃y f(x, y), then every coloring of H has a square path.\nProof. Let us assume that we have a nonrepetitive coloring. It must then agree with claims 1\nand 2. From claim 1, the path c1 . . . c7 from v0 to v1 exists for all the E-gadgets. On the other\nhand, claim 2 tells us that a nonrepetitive coloring of a C-gadget is effectively a choice between\nthe corresponding N-gadget and P-gadget. So by choosing a y that satisfies f for the choice of x\nprovided by the coloring, we can create a long square path analogous to the one for G.\nNow, assuming that ∃x∀y ̸ f(x, y), we construct a coloring we claim to be nonrepetitive.\nLet x1, . . . , xp be an assignment to the universally quantified variables such that ∃y f(x, y) is not\nsatisfiable. We set aside 7 colors ai, bi, ci, di, abi, aci, adi for each consistency gadget Qwi, all of them\ndistinct. We color the E-gadgets so that for one, {ai, bi, abi} spans the distance from u0 to v0 and\n{ci, di, aci, adi} spans the distance from u0 to v1; for another, {ai, ci, aci} and {bi, di, abi, adi}; and\nfor the third, {ai, di, adi} and {bi, ci, abi, aci}. If G′ has a fourth edge of that color, then we make\nsure that the coloring of the gadget corresponding to the edge in the snout is different from all the\nothers, but color the fourth edge gadget in one of these three ways.\nFor a consistency gadget that controls a universally quantified variable xj, we color N xj and P xj\nin the way already described. We then color Cxj so that it contains the path (ai, bi, abi, ci, di, aci, adi)\nif xj = 1 and the path (ai, aci, ci, bi, di, adi, abi) if xj = 0.\nLet us set aside a set of 7 colors β1, . . . , β7 distinct from the ones enumerated so far.\nNow we need to color the consistency gadgets, which we do using the group method in [1]. First,\nwe assign the elements of the subgroup of Zm\n2\ngenerated by the first three generators to the set\ncontaining each edge gadget’s u0 and u1, whose cardinality clearly is at most 8. Furthermore, we\n15"},{"paragraph_id":"p19","order":19,"text":"set the numbers of the vertices so that the sum of the colors of u0 and u1 within an edge gadget does\nnot depend on the edge gadget. Thus the colors of the edges between these vertices are nonzero\nmembers of this subgroup, and the edge between u0 and u1 is the same color for each edge gadget.\nWe assign to these edges the colors β1, . . . , β7, with β1 being the color between u0 and u1 for every\nE- and P-gadget.\nFor a consistency gadget corresponding to a universally quantified variable xi, we label the\nvertex u0 of P xi with 0 and the other three u-vertices with a generator of the subgroup. This\nensures that all the edges that connect two u-vertices are colored differently.\nNow, using the rest of the generators, we can find 2l−1 ≥c+2u subgroups Gg of Zm\n2 isomorphic\nto Z4\n2, one for each nonzero element g ∈Zm/4\n2\n, by taking the generators g0, g1, g2, g3 to have ith\ndigit gj\ni = g(j−i−3)/4 if 4 | j −i −3 and 0 otherwise.\nWe next arbitrarily assign group elements to the rest of the vertices, and hence edges. However,\nwe assign colors to the group elements in such a way that for each set Z(Qi) we take a distinct\nsubgroup of the kind described and assign ai, bi, ci, di to the generators and abi, aci, adi to the\nelements ai + bi, ai + ci, and ai + di, respectively.\nSince the first three digits are zero for all elements of these sets, we have guaranteed that we\ncan never get βi by adding together colors of edge gadgets.\nClaim 4. This coloring is nonrepetitive when restricted to a consistency gadget Q together with its\nedge gadgets.\nProof. We have already shown that the coloring of each gadget is nonrepetitive.\nA path within Q whose colors are contained in Z(Q) cannot reach a vertex at a distance of\nmore than 2 from the interface with colors in G∗. On the other hand, by construction, no colors\nin G∗(Q) are present in the edge gadgets within distance 2 of ui. Thus a portion of a square path\nwithin an edge gadget must be repeated at least partially in another edge gadget.\nFor an E-gadget, this means that one such portion must not be at the end of a path. Thus,\nsince the path is open, it goes through the edge gadget from u0 to u1, and contains an odd number\nof edges of each color in Z(Q). If some such portion is repeated by sections at both the beginning\nand end of the path, then one of these sections must be in an E-gadget, and therefore we can splice\nthe other section onto that one to create another open square path. Thus we can build a shorter\nsquare open path by replacing each such portion with the edge between u0 and u1, which we know\nhas the same color β1 for each gadget. But this substitution produces a square path entirely inside\nQ, which must be a loop.\nAssume now that Q corresponds to a universally quantified variable. We have already con-\nstructed our coloring so that a path starting from one of the edges adjacent to u−j and continuing\nto either C or N cannot repeat. Now, we did not color an edge adjacent to u−j by β1, so a path\nfrom u0 to u1 that is repeated by edges within P must be at least two edges long. But a path from\nu−j in colors from G∗(Q) may only be one edge long. Now, the set of colors separating u−j and ui\nis different from the set of colors separating u−3+j and u1−i. Therefore, we cannot find a square\npath that traverses both. So any square path must contain at least two sections within Q. Such\nsections, if they are each between two u-vertices, cannot repeat each other since by our construction\nthe group element leading between each pair of u-vertices is different. But such a path also cannot\nuse the plumes because any vertex in N and C has distance at most 4 from u, so this together with\nthe plumes would not be enough to repeat a path through P containing 7 distinct colors.\n16"},{"paragraph_id":"p20","order":20,"text":"Claim 5. In a square path, colors in edge gadgets cannot be duplicated by the same colors in\nconsistency gadgets, except perhaps in one plume.\nProof. Suppose we have a square path that serves as a counterexample to this, with some sequence\nof colors occurring in an edge gadget E0 repeated by a sequence in a consistency gadget Q1. We\ngive the name p to this path and pΓ to the portion of it that goes through a gadget Γ. We orient\np so that pE0 comes before pQ1; we therefore refer to the first and second halves of p, and to ends\nand beginnings of sections.\nWe start with case 1: E0 does not belong to Q1 and pE0 is not at the beginning of p. Then\nthe ends of pE0 are vertices from the set {u±j}∪{vi}. By construction, the colors of any such path\nform a loop in Q1, so the path cannot be open.\nThus if E0 does not belong to Q1, then pE0 is the beginning of p. Then the edges following pE0\nmust come either from a consistency gadget Q0 (case 2) or another edge gadget E∗(case 3.)\nCase 2: In order to link the two half-paths, the first half must eventually leave Q0. If it leaves\nearly, so that an adjacent edge gadget is repeated in Q1, then we are back in case 1. If it leaves\nlate, so that it is repeated by an edge gadget adjacent to Q0, then we are also back in case 1: if the\npath ended in that edge gadget, then there would be nothing to repeat the edge gadgets between\nQ0 and Q1. Finally, if the vertex ui at which the path leaves Q0 is repeated by a vertex uj at which\nthe path leaves Q1, then since we are in different consistency gadgets, the edges we traverse have\ndifferent sets Z of colors, a contradiction.\nCase 3: If E∗does not belong to Q1, then it must be duplicated inside Q0, since the other\noption is an edge gadget belonging to Q0, which does not match colors. Therefore, substituting E∗\nfor E0, we get case 1 and a contradiction.\nSo E∗belongs to Q1. This means that the end of pE0 is vi. Furthermore, since pE∗must have\nodd numbers of at least three colors, and since pE0 is the beginning of p and therefore all of pE∗is\nin the first half, pE∗cannot be repeated in a plume of Q1. Thus Q1 must end with uj of an edge\ngadget E1 which repeats vi. If pE∗ends with v1−i, then pE1 ends with u1−j and we are again in\ncase 1. On the other hand, if pE∗ends at uk, then PE1 ends with vl, and so either we are back in\ncase 1 or the path ends after PE1. But that would mean that the colors of pE0 and pE1 would add\nup in G(Q1) to βi for some i, which contradicts the construction.\nThe remaining possibility, case 4, is that E0 belongs to Q1. Then for colors to match, the\npart of pQ1 that repeats pE0 must be contained in a plume of Q1 and therefore be the end of the\npath.\nClaim 6. No square path in this coloring goes through a consistency gadget.\nProof. By claim 5, colors in edge gadgets must be duplicated by colors in edge gadgets. Now,\nsuppose we have a square path p that goes through a consistency gadget Q. We use the notation of\nclaim 5 to denote portions of this path. On both sides of pQ, we have paths through edge gadgets\nE1 and E2. We now enumerate cases once again.\nCase 1 occurs when pE1 is a path between u0 and u1. Then there must be a subpath repeating\nit, which, by claim 5, then also goes from ui to u1−i in an edge gadget E∗\n1 of Q. We can create\nanother square path by replacing pE1 and pE∗\n1 by single edges within Q, reducing the problem to\nany of the other cases.\nSo we can assume that both pE1 and pE2 go to a vi. Then if we orient the path, one subpath\ngoes from an edge gadget to Q and the other goes from Q to an edge gadget. Therefore, by claim\n17"},{"paragraph_id":"p21","order":21,"text":"5, one cannot be the repetition of the other. Thus p must traverse Q twice and associated edge\ngadgets four times, at least three of these times passing between a ui and a vi. (The fourth time\nit does not have to do this since a traversal may be split between the beginning and the end of p.)\nFurthermore, the edge subpaths must be in two pairs, each of which has one set of colors, and at\nleast one of the pairs must have both its subpaths continue in other edge gadgets.\nSuppose now that Q is not associated with a universally quantified variable. Case 2 occurs\nwhen the two subpaths are in the same E-gadget. Since no edge in G′ is adjacent to edges of one\ncolor through both incident vertices, the colors of the neighboring edge gadgets must be different\nand the path cannot be square.\nIn case 3, the two subpaths are in different E-gadgets. In order for them to be colored the\nsame, we must assume that Q controls four E-gadgets and neither of the E-gadgets traversed by\nthe subpaths corresponds to an edge in the snout of G′. But the edges not in the snout all border\ndifferent colors, so the path once again cannot be square.\nCase 4: We are left with the possibility of Qxj being associated with a universally quantified\nvariable xj. We colored Qxj in such a way, however, that the sets of paths within it between every\npair of u-vertices are disjoint. Therefore, if we orient p in a certain way, the second pQxj must be\nat the end of the path. By the same token, p must begin with a section in one of the edge gadgets\nbelonging to Qxj.\nAll the v0s of the edge gadgets of Qxj are incident to E-gadgets of colors Z(Qxi\nj) and all the\nv1s are incident to E-gadgets of colors Z(Qxf\nj ). Hence paths to v1 can be repeated by paths to v1\nand paths to v0 can be repeated by paths to v0. By construction, the possible repetitions of paths\nbetween uj and vi are then\n1. if xj = 0, a path between v0 and u in N xj with a path between v0 and u0 in P xj\n2. if xj = 1:\n(a) A path between v0 and u in Cxj with a path between v0 and u in N xj and a path\nbetween v0 and u0 in P xj\n(b) A path between v1 and u in Cxj with a path between v1 and u in N xj.\nIn each case, therefore, there can be only one such repetition in an open path. Since gadgets be-\nlonging to Qxj occupy both the beginning and the end of p, there may be no traversal of consistency\ngadgets other than Qxj within p.\nA path through N xj cannot repeat a path through P xj since these paths would have to go\nthrough edge gadgets corresponding to different direction-determining colors of G′. Also, a path\ngoing through v0 of Cxj is going towards the tip of the snout, and therefore cannot meet any more\ngadgets belonging to xj. This gives us a contradiction if v0 is part of one of the square sections.\nThus we are left with possibility 2(b).\nThis means that there must be a subpath consisting only of edge gadgets from v1 of Cxj to\nsome other vi of an edge gadget belonging to Qxj. If the path is from Cxj, then it must traverse an\nedge gadget belonging to Qa1\ni , which must be repeated by an edge gadget at the tip of the snout,\nwhich p cannot reach.\nThis restricts any potential square paths to going through a chain of edge gadgets. But this\nmeans that a square path maps to a square path in G′, which does not exist if ¬∀x∃y f(x, y). Hence\nthis is a reduction.\n18"},{"paragraph_id":"p22","order":22,"text":"It is easy to see that the reduction runs in polynomial time, specifically O(n8).\n7\nAcknowledgements\nWe would like to thank Chris Umans for his mentoring and helpful suggestions at every stage of\nthe research; and Grigori Mints and Yuri Manin for reviewing the proofs.\nReferences\n[1] N. Alon, J. Grytczuk, M. Hauszczak, and O. Riordan. “Nonrepetitive colorings of graphs.”\nIn M. K ́aronski, J. Spencer, and A. Ruci ́nski, editors, Proceedings of the 10th International\nConference on Random Structures and Algorithms (RS&A-01), volume 21, 3–4 of Random\nStructures and Algorithms, pages 336–346, Danvers, MA, Aug. 6–10 2002. Wiley Periodicals.\n[2] J. Bar ́at and P.P. Varj ́u. “On square-free vertex colorings of graphs.” Studia Scientiarum Math-\nematicarum Hungarica (to appear).\n[3] J. Bar ́at and P.P. Varj ́u. “On square-free edge colorings of graphs.” Ars Comb. (to appear).\n[4] B. Breˇsar and S. Klavˇzar. “Square-free colorings of graphs.” Ars Comb. 70:3–13, Jan. 2004.\n[5] Thomas F. Coleman and Jorge J. Mor ́e. “Estimation of sparse Hessian matrices and graph\ncoloring problems.” Math. Programming, 28(3):243—270, 1984.\n[6] S. Czerwi ́nski and J. Grytczuk. “Nonrepetitive colorings of graphs.” Electronic Notes in Discrete\nMathematics 28:453–459, 2007.\n[7] J. Grytczuk. “Nonrepetitive Colorings of Graphs—A Survey.” International Journal of Mathe-\nmatics and Mathematical Sciences, 2007.\n[8] Ian Holyer. “The NP-Completeness of Edge-Coloring.” SIAM J. Comput. 10:718–720, 1981.\n[9] D ́aniel Marx and Marcus Schaefer. “The Complexity of Nonrepetitive Coloring.” DePaul Uni-\nversity Technical Report, TR 07-007, 2007.\n[10] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hierar-\nchy:\na compendium” (updated version). SIGACT News, September 2002. Retrieved from\n.\n[11] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hi-\nerarchy:\nPart II” (updated version). SIGACT News,\nDecember 2002. Retrieved from\n.\n[12] Axel Thue. “ ̈Uber unendliche Zeichenreihen.” Norske Vid. Selsk. Skr. I, Mat. Nat. Kl. Chris-\ntiana 7, 1-22, 1906. Reprinted in Nagell, T.; Selberg, A.; Selberg, S.; and Thalberg, K. (Eds.).\nSelected Mathematical Papers of Axel Thue. Oslo, Norway: Universitetsforlaget, pp. 139-158,\n1977.\n19"}],"pages":[{"page":1,"text":"arXiv:0709.4497v2 [cs.CC] 6 Dec 2007\nThe complexity of nonrepetitive edge coloring of graphs\nFedor Manin ∗\nOctober 25, 2018\nAbstract\nA squarefree word is a sequence w of symbols such that there are no strings x, y, and z for\nwhich w = xyyz. A nonrepetitive coloring of a graph is an edge coloring in which the sequence\nof colors along any open path is squarefree. The Thue number π(G) of a graph G is the least n\nfor which the graph can be nonrepetitively colored in n colors. A number of recent papers have\nshown both exact and approximation results for Thue numbers of various classes of graphs. We\nshow that determining whether a graph G has φ(G) ≤k is Σp\n2-complete.\nWhen we restrict to paths of length at most n, the problem becomes NP-complete for fixed\nn. For n = 2, this is the edge coloring problem; thus the bounded-path version can be thought\nof as a generalization of edge coloring.\n1\nIntroduction\nThe study of avoiding repetition in combinatorial structures stems from a 1906 paper by Axel Thue\n[12], which showed that a there is an infinite word in {0, 1, 2} that has no subword of the form xx\nfor some finite word x. Such a word is called squarefree.\nA paper by Alon, Grytczuk, Haluszczak, and Riordan [1] introduced the generalization to edge\ncolorings of graphs. An edge coloring of a graph is nonrepetitive if for any open path through the\ngraph, the pattern of colors along the path is squarefree. The Thue number π(G) is the smallest\nnumber k for which G can be nonrepetitively colored with k colors. Alon et al. also mentioned the\npossibility of studying vertex nonrepetitive colorings, i.e., vertex colorings with the same property.\nThis notion has been further studied in papers by Czerwi ́nski and Grytczuk [6] and by Bar ́at and\nVarj ́u [2]. Other similar notions involving walks rather than paths have been developed by Breˇsar\nand Klavˇzar [4] and again by Bar ́at and Varj ́u [3]. For a more detailed survey of results regarding\nvertex nonrepetitive colorings, we refer the reader to Grytczuk [7].\nThe many papers in this area employ various notations and terminologies; we will stick to the\noriginal terminology of Alon et al. whenever possible. Therefore, we refer to edge nonrepetitive\ncolorings simply as nonrepetitive colorings and denote the edge coloring Thue number as π(G). We\ncall a path square if it is of the form xx for some color-string x.\nOur goal is to study nonrepetitive colorings from the point of view of computational complexity.\nWhatever version of π(G) is used, deciding whether π(G) ≤k is an ∃∀problem: does there exist a\nk-coloring of the edges or vertices of G such that the pattern of colors along any open path, or one\n∗This research was conducted as part of the Summer Undergraduate Research Fellowship program at Caltech and\npartly supported by grant NSF CCF-0346991.\n1"},{"page":2,"text":"of the kinds of walks, is squarefree? Such questions usually belong in the class Σp\n2 = NPNP, a class\nin the second level of the polynomial hierarchy. This class and problems known to be complete for\nit are described in a survey by Schaefer and Umans [10].\nMany of the results of papers on nonrepetitive colorings which bound the Thue number of\nvarious classes of graphs—for example, Alon et al.[1] show that π(G) ≤c∆2 for constant c for any\ngraph of degree ∆. On the other hand, Alon et al. also show that for any ∆there is a graph G of\nmaximum degree ∆such that any nonrepetitive vertex coloring of G requires at least c∆2/ log ∆\ncolors. Both these results, and many others like them, are probabilistic and thus give us little\ninformation about specific graphs.\nThe complexity of vertex nonrepetitive colorings has recently been studied by Marx and Schaefer\n[9], who showed that deciding whether such a coloring is nonrepetitive is coNP-complete. In this\npaper we show that the corresponding problem for edge colorings is coNP-complete. We then show\nthat deciding whether π(G) ≤k is Σp\n2-complete.\nFinally, we turn to colorings that are nonrepetitive for bounded-length paths. Let χe\ni(G) be the\nleast number of colors required to color the edges of G so that no open path contains the square\nof a pattern of colors of length ≤i, and let χi(G) be the least number of colors required to color\nthe vertices of G under analogous conditions. Since the number of paths of length 2i is bounded\nby |V |2i, for fixed i each such problem is contained in NP. Then χ1(G) ≤k is simply graph\ncoloring and χe\n1(G) ≤k is edge coloring, shown to be NP-complete by Holyer in 1981 [8].\nχ2(G) is known as the symmetric chromatic number; the corresponding decision problem is shown\nto be NP-complete by Coleman and Mor ́e [5]. We show that the decision problems corresponding\nto χe\n2(G) and χe\n2k(G) for any k ≥4 are NP-complete.\n2\nMethods\nThe nonrepetitive colorability of a graph with k colors is a rather slippery property. In the con-\nstruction of a nonrepetitive coloring, changing the color of an edge may produce a square path of\narbitrary length and thus affected by colors of edges arbitrarily far away. Thus the local properties\nof a graph cannot guarantee that it is nonrepetitively colorable. On the other hand, if a graph does\nnot have a nonrepetitive coloring, then we must examine all of the colorings and find a square path\nin each, which also feels like a hard problem. Thus neither direction of the reduction is easy.\nThere are two immediately visible approaches to resolving this dilemma. Perhaps we could focus\non fairly sparse graphs, thus minimizing the number of paths we must make sure are nonrepetitive.\nBut this would greatly increase the number of colorings we must consider.\nWe thus use this\napproach only in determining whether a preassigned coloring is nonrepetitive. On the other hand,\nwe could focus on graphs in which the degree of every vertex is close to the maximal degree of the\ngraph. Although this allows us to easily discard most possible colorings, the number of distinct\npaths grows exponentially. Additionally, it becomes harder to create graphs which differ subtly in\nglobal structure in such a way that some of them are nonrepetitively colorable and others are not.\nIn our proof, we combine these two approaches, producing graphs that are locally dense, in the\nsense that the degree of most vertices is large and close to the maximal degree, but globally sparse,\nin the sense that long paths must traverse a number of bottlenecks with only a few connections.\nWhile a pattern of local structures, or gadgets, is common to many if not all graph-theoretic\ncomplexity proofs, in this case in particular it allows us to partially isolate each portion of the\nproblem: once we have established that the local structure is nonrepetitively colorable in a very\n2"},{"page":3,"text":"constrained set of ways, we can us this to determine whether the global structure is nonrepetitively\ncolorable.\nWe will first construct the global structure, which is similar to the well-known reduction which\nshows that hampath is NP-complete. The local structure, added later, will be composed of several\ntypes of dense subgraphs. The simplest of these are the cliques of size 2n, which Alon et al. show\nto be nonrepetitively colorable with 2n colors. We also use the n-dimensional hypercube graphs,\nwhich have a number of useful properties which are discussed in the next section. Finally, in a\nnumber of cases we will saturate a vertex v by adding extra vertices only joined to v, called the\nplume of v, to artificially inflate the degree. This will allow us to more effectively use the saturation\nlemma below.\n3\nPreliminaries\nWe will now prove some results about nonrepetitive colorings that will aid in the complexity proofs.\nLemma 1 (Saturation lemma). Let a vertex of a graph be saturated if it is of maximal degree, and\nlet a diamond be a cycle of four vertices. Suppose two opposing vertices of a diamond, A and B,\nin a graph of degree k, are saturated and the saturating edges are not directly connected. Then the\ngraph may only be k-nonrepetitively colored if the diamond is colored with exactly two colors.\nProof. Let a and b be the colors of one path from A to B through the diamond. Then, since A and\nB are saturated, there must be an edge of color b at A and an edge of color a at B, forming a path\nof colors abab. If this path is not a cycle, then the coloring is not nonrepetitive. Thus, these colors\nmust form the other half of the diamond.\nLemma 2 (Properties of hypercubes). The nonrepetitive k-edge-coloring of a k-hypercube exists,\nis unique up to permutation, and has the following properties:\n(1) The shortest path between any two points consists of distinct colors.\n(2) Any permutation of the colors of a path between two points consisting of distinct colors also\ncolors a path between those two points, and no other sequence of distinct colors does.\n(3) Any path consisting of distinct colors is a shortest path between its endpoints.\n(4) There are\n k\ni\n \nvertices at distance i from a given vertex V .\nThe uniqueness of coloring also holds for portions of a k-hypercube whose distance from a chosen\nbase vertex V is at most m, which we call the first m layers of the hypercube.\nProof. We will identify the vertices of the hypercube with {0, 1}k, where there is an edge between\n(χ1, . . . , χk) and (χ1, . . . , χi−1, 1 −χi, χi+1, . . . , χk) for every i.\nWithout loss of generality, let us choose the vertex V identified with ̄0 to be a base vertex. V\nis saturated, so the coloring of the edges adjacent to it is unique up to permutation. Thus the\ncoloring of the first layer is unique. Now suppose that we have colored the first m layers. Every\nvertex is saturated and any two adjacent edges form a diamond (a face.) Hence by the previous\nlemma the coloring of the mth layer determines the coloring of the m + 1st layer. By induction,\nthe coloring of the first m layers is unique, and so is the coloring of the entire hypercube.\n3"},{"page":4,"text":"To show that a coloring exists, let us use the color i for all edges for which χi changes between\nthe two vertices. For every i, the hypercube consists of two k −1-hypercubes, one in which the\nith coordinate is 0 for all vertices and one in which it is 1. Therefore, if we have a path containing\ntwo edges of color i, then we can create an alternate path with the same start and end vertices by\nremoving these two edges and reversing χi for the vertices in between them.\nNow suppose we have a square path. Then for every dimension, there is an even number of edges\nin that dimension on the path, and we can remove all these edges by pairs from the path. Thus\nthe path is equivalent to the empty path, is therefore a cycle, and all open paths are squarefree.\nWe will now use this construction to prove the rest of the properties. For (1), suppose that\nwe have a shortest path between two points that contains two edges of the same color. Then we\ncan remove these two edges and get a shorter path between the same two vertices. Therefore the\nshortest path must consist of distinct colors.\nFor (2), clearly a permutation of the changes to variables leads to the same result. On the other\nhand, for any two shortest paths whose sets of colors differ, there is an i such that χi is different\nbetween the two end vertices for one of the paths, but not for the other. Thus the end vertices are\ndifferent for the two paths.\n(3) follows directly from (1) and (2).\nA path of length i represents a change in i members of the k-tuple. There are\n k\ni\n \npossible such\nchanges, proving (4).\n4\nNonrepetitive coloring problems\nIn this section, we consider several related problems in which the coloring is entirely or almost\nentirely predetermined, and the main difficulty of the problem is in finding whether the coloring is\nnonrepetitive. The proofs in this section are all related and provide a framework for the proof of\nthe Σp\n2-completeness of Thue number. We first consider colorings of directed graphs.\nTheorem 1. Given a directed graph G and a coloring thereof, it is coNP-complete to determine\nwhether the coloring is nonrepetitive. We call this problem directed nonrepetitive coloring.\nProof. We reduce from co-3SAT. The reduction is similar to the standard reduction from 3SAT to\nhampath. The edges are given a large number of colors, with 4 or fewer edges per color. In effect,\nwe restrict possible square paths to those that go through two edges of every color, mimicking the\nrequirement that a Hamilton path must pass through every vertex.\nLet f(x1, . . . , xn) be an instance of 3SAT. The reduction will use two types of gadgets: a variable\ngadget and a clause gadget.\nThe variable gadget consists of two sets of M vertices, where M is the largest number of number\nof instances of a literal, together with a beginning vertex bi. A path of edges goes from bi through\neach of the vertices in a set to bi+1, or a vertex c if i = n. The sets of vertices and paths going\nthrough them correspond to a true assignment and a false assignment; thus each set signifies a\nliteral.\nSuppose f has clauses numbered C1, . . . , Cm. A clause gadget for clause Cj has one vertex ej,\nand we add an extra vertex d and an edge from c to e1. For each literal in Cj, we add an edge from\nej to a vertex on the path corresponding to this literal and an edge from this vertex to ej+1 or d if\nj = m, making sure that this is the only clause gadget that uses this vertex.\n4"},{"page":5,"text":"Figure 1: The graph generated by (x ∨y ∨z) ∧(¬x ∨¬y ∨¬z) ∧(x ∨¬y ∨¬z), with a square path\nhighlighted.\nTo complete the construction of the graph, we add a series of vertices a0, . . . , aMn+2m and edges\nconnecting ai to ai+1 and aMn+2m to b1. We call this structure the snout. We must now assign\na coloring to this graph. We will use a set w1, . . . , wMn+2m+1 of colors. Starting from the tip, we\ncolor the ith edge of the snout with wi. We color the kth edge of a path through the xi-gadget by\nwM(i−1)+k; an edge going into ej by wMn+2j−1; an edge leaving ej by wMn+2j; and an edge going\ninto d by wMn+2m+1.\nGiven a satisfying assignment to f, we can construct a square path by first traversing the snout,\nthen taking the path through each variable gadget corresponding to the opposite of its assignment\nand the path through each clause gadget corresponding to a true literal, as illustrated for an\nexample. Conversely, if we have such a path, then taking the opposite of a traversed literal-path\nto be true gives us a satisfying assignment.\nNow suppose that f is unsatisfiable, and that there is a square path p, which then cannot have\nthe form above. Suppose first that the edges of p are colored only by the colors of the variable\ngadgets. Since the colors of the variable gadgets form the tip, but not the base of the snout, p must\nconsist only of the variable gadgets themselves; but this is impossible since the variable gadgets\ncan only be traversed in the forward direction and thus a path through them has no two edges of\nthe same color.\n(*) Thus p must contain edges from clause gadgets. Since any two edges in a clause gadget\nthat share a color also share a vertex, an open path can contain only one of such a set. Thus,\nfor every color a that colors an edge of p contained in a clause gadget, p contains an edge in the\nsnout of color a. Since b1 is only the source of the two branches of the first variable gadget, one of\nthese two branches must also be contained in the path. Furthermore, since these branches share a\nvertex, only one of them may be contained in p. The only other edge colored by w1 is the edge at\nthe very tip of the snout; thus the entire snout must be contained in p, so p must contain a path\nbelonging to each variable and clause gadget. As above, this defines a satisfying assignment to f,\na contradiction.\nClearly, this reduction runs in polynomial, in fact quadratic, time.\nRemarks. The graph resulting from this reduction has maximum in- and out-degree 3. Each color\nis repeated at most four times.\nFrom this we can fairly easily show the same result for undirected graphs.\nTheorem 2. Given an undirected graph G and an edge-coloring thereof, it is coNP-complete to\ndetermine whether the coloring is nonrepetitive. We call this problem nonrepetitive coloring.\n5"},{"page":6,"text":"Figure 2: The graph that replaces a snout edge of color yj.\nProof. We will now modify the previous reduction to work with undirected graphs. Let us add the\ncolors aj\ni, bj\ni, cj\ni , dj\ni, for i ∈{1, 2, 3} and j ≤Mn + 2m + 1. We call these the direction-determining\ncolors and the rest the original colors. We replace every edge inside the snout with the graph in\nfigure 2 and every edge outside the snout with the path aj\nibj\niwjcj\nkdj\nk for some i, k ∈{1, 2, 3}. This\ncan be done in such a way that there are no trivial repetitions, that is, no two edges of the same\ncolor are incident to the same vertex, since the maximum in- and out-degree of the directed graph\nis 3. Clearly, this construction retains the property that each color colors no more than four edges,\nsince none of the direction-determining colors need color more than two edges. We will show that\nthis modification leaves the reduction valid.\nIf f has a satisfying assignment, we can traverse the graph as before, choosing the right path\nthrough the snout to produce the same ais, bis, cks, and bks as in the other half of the path.\nNow suppose that f is unsatisfiable. Suppose that the graph has a square path. Clearly, this\npath must contain direction-determining colors. Each such color is represented only once in the\nnon-snout edges, so we cannot make a square path without any snout edges. This means that the\nparagraph marked (*) in the previous proof still applies, and we are done.\nWe now modify the statement of the problem slightly in order to get a Σp\n2-complete problem.\nTheorem 3. Given an undirected graph G and a set S of pairs (e, Se) for each edge e, with Se a\nset of colors, it is Σp\n2-complete to determine whether there exists a nonrepetitive coloring of G that\nuses a color se ∈Se for each e. We call this problem restricted Thue number.\nIn our case, Ke will contain at most two colors for any edge, and only one color for most edges.\nProof. Clearly, the problem is in Σp\n2. To prove that it is Σp\n2-hard, we shall slightly modify the\nprevious reduction, reducing from co-∀∃3SAT. Let ∀x∃yf(x, y) be an instance of ∀∃3SAT. Our\ngraph G will be the graph constructed for ∃x, y f(x, y) in Theorem 2. For each universally quantified\nvariable, the two original edges that initially separate the variable gadget into a “true” and a “false”\nbranch are given the sets {w1\ni } and {w0\ni } respectively, where wi is the color given these edges in\nthe previous reduction. The corresponding edge in the snout is given the set {wt\ni, wf\ni }. The rest of\nthe edges are given singletons containing the color they were colored in the previous reduction.\nThus a coloring of the graph satisfying the restriction corresponds to an assignment of x, since it\nforces any potentially square path to go through the specified branch of the corresponding variable\ngadget. This means, by the previous construction, that there is such a nonrepetitive coloring of G\niffthere is an assignment to x for which ∃yf(x, y) is unsatisfiable.\nThis proof provides the final incarnation of the global structure which we will later harness to\nshow that Thue number is Σp\n2-complete.\n6"},{"page":7,"text":"Figure 3: A clam.\n5\nProblems concerning bounded-length paths\nIn this section, we explore two problems in which we consider a polynomial number of possibly\nsquare paths, and therefore only the existential quantifier in the statement of the problems is over\nan exponentially large domain. Together, the problems form a generalization of edge coloring,\na problem which was shown to be NP-complete by Holyer in 1980 [8].\nIn these proofs, we employ several tricks to find graphs whose small-diameter subgraphs are\nrestricted in the ways they can be colored nonrepetitively. These tricks will later find applications\nin the proof of the Σp\n2-completeness of Thue number. Thus although this material is not directly\nrelated to the main result, it builds some machinery for its proof. Still, a reader interested only in\nthe main proof may go on to the next section.\nTheorem 4. It is NP-complete to determine whether χe\n2(G) ≤6.\nProof. We reduce from edge coloring for cubic graphs (graphs with 3 edges incident to every\nvertex) and 3 colors, which is shown to be NP-complete in [8]. The reduction consists of replacing\neach edge of graph G with the graph depicted in Fig. 3, which we shall call a clam. The vertices\nincident to the edge are mapped to A and B. We shall argue that the resulting graph H can be\n6-colored with nonrepetitive 4-paths iffG can be 3-colored. Suppose that we have such a coloring,\nand call the six colors a, b, c, d, e, f.\nNote first that vertices A and B are both saturated, since they are images of vertices of G of\ndegree 3, so the outer diamond of the clam only has two colors—without loss of generality, a and\nb. Now suppose that one of the inner four edges (let us call them the gills) is colored a. Then if\nthe color of an edge of the inner diamond connected to this edge is c, there is a path acac through\ngill, inner diamond, outer diamond, and an edge of another clam. Thus the gills must be colored\ndifferently from the outer diamond, as must the inner diamond since it is adjacent to the outer one.\nThis means that the vertex labeled V and the one symmetric to it are saturated for the four colors\nother than a and b, and thus the inner diamond must be colored with exactly two colors (c and d.)\nNow let us add two more clams, incident to vertices C and D respectively, at vertex A. Suppose\nthat the outer colors of the clams are ce and df respectively. Then to prevent square paths of the\ntype acac from the inner diamond of clam AC to the inner diamond of clam AB, the inner diamonds\nof clams AC and AD must consist of the colors df and ce respectively. But then we get square\npaths of the form dcdc from the inner diamond of clam AC to the inner diamond of clam AD. Thus\nthe outer colors of AC and AD must be cd and ef, in some order. Furthermore, the inner colors\nof AC must be ef to prevent acac-type repetitions. This forces the inner colors of AD to be ab.\nThis means that the coloring of one clam at a vertex of G determines the sets of colors available\n7"},{"page":8,"text":"to the other clams; by induction, each clam in the graph must be colored using one of these three\npatterns.\nThis means that if we have a 3-coloring of G, we can map the three colors onto the three clam-\ncoloring patterns to produce a 2-nonrepetitive 6-coloring of H; conversely, with a nonrepetitive\n6-coloring of H, we can map the three clam-coloring patterns onto three colors with which we can\nedge-color G.\nTheorem 5. For any natural number k ≥4 and graph G, it is NP-complete to determine whether\nχe\n2k(G) ≤6k.\nProof. This is a generalization of the previous reduction. However, one must view the clam not\nas a unified gadget, but as a combination of elements of three gadgets. The two edges incident\nto vertex A belong to vertex gadget A, and likewise for vertex B. The edge gadget proper, then,\nconsists of the inner diamond and the gills.\nWe again reduce from edge coloring for cubic graphs in 3 colors. Let G be a cubic graph.\nWe associate to G a 3-coloring C(e) of the edges. As we construct the gadgets in the reduction,\nwe will also construct a 6k-coloring of the edges based on C(e). Later, we will show that this\ncoloring is 4k-nonrepetitive iffC(e) is a valid edge coloring, and that no other coloring of the edges\nis 4k-nonrepetitive. We shall now enumerate the elements of the reduction, which reduces G to a\ngraph H.\nThe vertex gadget consists of the first k layers of a 6k-hypercube with respect to a central vertex\nK. By the hypercube lemma, this has a unique nonrepetitive coloring.\nNow let us divide the 6k colors into three groups of 2k, called red, green, and blue. We shall\nuse the term grue to refer to the union of the sets blue and green. The elements of the sets will be\nreferred to as shades. For each of the groups, there are\n 2k\nk\n \nvertices whose distance from K is k\nsuch that the path to them from K consists of edges of colors from that group. We identify these\nvertices with an analogous group from another vertex gadget (with central vertex L) in order to\nform an edge.\nClaim 1. In a 4k-nonrepetitive coloring, the colors of the edges on either side of this connection\nare in the same set of 2k.\nProof. Suppose we have a 4k-nonrepetitive coloring that does not have this property. Then take\nan arbitrary path from K to L of length 2k, say with color pattern r1, . . . , rk, b1, . . . , bk. By the\nproperties of the 6k-hypercube, there must be a path starting with K of pattern bk, . . . , b1 and a\npath starting with L of pattern r1, . . . , rk. This forms a square path of length 4k, which must then\nbe a cycle. This means that the sets of colors on either side of the inter-vertex interface are the\nsame. Assume they are both red. Then, since the fully-red paths from K to L form a 2k-hypercube,\nthey can be colored nonrepetitively.\nWe assume now that we are working with two vertices, K and L, that are joined by a red edge.\nThe construction for the other two sets is analogous.\nIt remains to add a gadget that will force the green and blue sets of one vertex to be the same\nas the green and blue sets of the other. To this end, we take two vertices, A and B, on the interface\nbetween two vertex gadgets, whose distance from each other is 2k, to be two ends of a consistency\ngadget.\nThe consistency gadget is a 4k-hypercube modified in two ways.\nFirst, every vertex whose\ndistance from A and B is 2 or more has a plume of 2k additional edges leading to disconnected\n8"},{"page":9,"text":"vertices. A red edge separated by one edge from A or B generates a square path of length 4, so this\nmeans all the vertices of the hypercube are effectively saturated. This implies that the hypercube\nis entirely grue and the plumes are red. On the other hand, the farther red plume edges do not\ngenerate such a path, since it would have to repeat a red edge followed by two or more grue edges\nas a path from the red interface vertices, and thus required by hypercube property (3) to stray a\ndistance more than k from the central vertex of the vertex gadget.\nNext, for every path starting at A or B and consisting of k edges of distinct shades of green, we\nremove the last edge. We then do the same for blue. We also remove all red plume edges incident\nto the vertices that are left unsaturated by this removal. We call the kth layer of the hypercube\nfrom either A or B the gap layer.\nClaim 2. This consistency gadget is uniquely 4k-nonrepetitively 6k-colorable up to isomorphism.\nThis coloring is such that the hypercube edges are grue and colored as the restriction of a full\nhypercube, and the plumes are red.\nProof. Any diamond containing edges in the layer adjacent to the gap layer has two saturated\nvertices at equal distance from the vertex gadget. Suppose there is an edge between two vertices\nthat are both unsaturated due to the removal. If those two vertices both became unsaturated from\nthe removal of edges of the same color, then the edge would have to be of that color, and thus\nalso removed. On the other hand, an edge between two vertices that are unsaturated due to the\nremoval of different colors would not exist by hypercube property (2). Thus any diamond that has\nedges in the gap layer has saturated vertices either laterally or vertically, and so by the saturation\nlemma the coloring is a restriction of the full hypercube.\nWe then add a second, identical consistency gadget at vertices C and D whose distances from\nA and B are at least 4. (This distance prevents a square path consisting of a red plume edge in\nthe first consistency gadget, then some path through it, then two red edges, the same path through\nthe second consistency gadget, and another red plume edge.)\nWe refer to the set of colors that form the interface between two vertex gadgets as an edge set.\nClaim 3. If the original graph is not 3-edge-colorable, the resulting graph is not 4k-nonrepetitively\n6k-edge-colorable.\nProof. Given a red edge set, suppose that another edge set of the same vertex gadget with central\nvertex K, belonging to edge e of G, has both green and blue parts. This means that that one of\nits consistency gadgets will have a path to it that contains both green and blue, since if one of the\nconsistency gadgets has an all-blue side and an all-green side, then the other one does not. Thus\nwe can find a square path consisting of:\n1. a red plume edge that duplicates the last edge of (3),\n2. a path of length k in a consistency gadget of the red edge that duplicates (4),\n3. a path from the consistency gadget of the red edge set to K,\n4. a mixed blue-green path from K to one of the blue-green edge set’s consistency gadgets, and\n5. a path of length k −1 in this consistency gadget that duplicates the first k −1 edges of (3).\n9"},{"page":10,"text":"Therefore, the edge sets cannot be of mixed colors with respect to the red edge set’s consistency\ngadget.\nClaim 4. If G is 3-edge-colorable, then the coloring of H which we have described is 4k-nonrepetitive.\nProof. Suppose that G is 3-edge-colorable, and let p = qr be a square path in H of length at\nmost 4k, where q and r are the repetitions of the pattern. The portion of p inside a gadget G\nwill be called pG. Clearly, p cannot be wholly inside a consistency gadget. We have also already\nestablished that p cannot be wholly outside any consistency gadgets. Thus it include edges from\nboth consistency and vertex gadgets. Since a consistency gadget has distance 4k between its two\nattachment points, p cannot have a consistency gadget in the middle. In introducing the red plumes\nin the consistency gadget, we also showed that the whose middle vertex of p cannot be a junction\nbetween a consistency gadget and a vertex.\nThus at least one half-path of p (without loss of generality, q) contains parts of both a consistency\ngadget T and a vertex gadget J with center K. qT contains at most one of the colors that are\nfound on a shortest path to K from the juncture with the consistency gadget. If such a color is in\nqT , it must be a plume, which forces qT to be at least three edges long.\nSuppose now that the rest of p is contained in J. We will show that the distance from the last\nvertex V of p to K is greater than k, a contradiction. If a color has both of its repetitions inside\nJ, these cancel each other out, so we are left with the edges that repeat qT . But since there is at\nleast one more grue than red edge in qT, this means that our initial distance k from K increases\nby at least one.\nThis means that p must access either a consistency gadget or another vertex gadget. Without\nloss of generality, assume that T belongs to a red edge set.\nCase 1: p accesses a second consistency gadget that belongs the same edge set. Then there are\nat least four shades of red that are repeated an odd number of times in the vertex gadget portion of\nthe path. Since there is at most one red edge in each consistency gadget part of the path, nothing\ncan repeat these edges.\nCase 2: p accesses a different consistency gadget, without loss of generality from a blue edge\nset. Then pJ must contain at least 2k colors that color an odd number of edges, since the distance\nbetween the two consistency gadgets is 2k. This is the maximal number of distinct colors in the path\nwe are considering, so each of the 2k must be repeated in one of the two consistency gadgets. This\nmeans that one of the consistency gadgets contains a red-blue path of length at least k. However,\nthis must pass through edges that we have removed, so no such path exists.\nCase 3: p accesses a vertex gadget J′ ̸= J which interfaces J at a non-red edge set. This again\nmeans that there are 2k distinct colors in pJ, and the 2k edges in pT and pJ′ must repeat these. In\nparticular this means that the edge that repeats the edge of pJ adjacent to T must be the edge of\npJ′ adjacent to J, and so this edge must be colored a shade of red, which is a contradiction.\nCase 4: p accesses a vertex gadget J′ which interfaces J at the red edge set. Each time that\npJ or pJ′ traverses a grue edge before the last vertex in p that belongs to both J and J′, another\nedge of the same color must be accessed, by hypercube property (3). Since there must be an even\nnumber of edges of any color, this means that unrepeated edges in the consistency gadget must be\nrepeated by similar edges in the portion after this last crossover. Also, since all but at most one\nshade of red has to be traversed twice within the non-consistency-gadget portion, all the red colors\ntogether bring the path to within one edge of the border of a vertex gadget. But in that case there\n10"},{"page":11,"text":"are at least two grue edges in the consistency gadget portion, again pushing the path beyond the\nradius of the vertex gadget.\nThus there is no way for such a p to exist.\nThis means that the resulting graph may be 4k-nonrepetitively 6k-edge-colored iffthe original\ngraph can be 3-edge-colored. Note that there is nothing special about the original graph being\nof degree 3.\nIf the original graph is regular of degree d, then we can construct a similar new\ngraph with a vertex gadget being a slice of a 2dk-hypercube, a consistency gadget being a modified\n2(d −1)k-hypercube, and so on.\nTaking into account the vertex and consistency gadgets, for an original graph with a edges, the\nresulting graph of this reduction has Θ(2a\nd ·22dk +a·22(d−1)k) = Θ(a\nd22dk) edges. This means that if\nk depends logarithmically on a, then the reduction still runs in polynomial time with respect to a.\nThis raises questions about other versions of the problem where k is not constant, but a sub-linear\nfunction of |G|.\n6\nTHUE NUMBER\nWe now proceed to the main result of the paper, showing that Thue number is Σp\n2-complete.\nWe use a reduction based on that of Theorem 3, taking a graph very similar to that produced in\nTheorem 3 and replace the edges with various gadgets depending on their function in that reduction.\nWe also add constraint gadgets in order to force the edge gadgets that would have been colored\nthe same in Theorem 3 to still have similar patterns of colors. After we show that a nonrepetitive\ncoloring of this graph must satisfy a large number of constraints stemming from this local structure,\nwe can use the global structure from Theorem 3 to show that an actual nonrepetitive coloring exists\nif and only if the ancestral instance of co-∀∃3SAT is positive.\nWhile this is the idea of the proof, in reality, the local structure is not cleanly separated from\nthe global structure: the format of the latter helps constrain the former.\nTheorem 6. Thue number is Σp\n2-complete.\nProof. Given an instance ∀x∃y f(x, y) of co-∀∃3SAT, we will refer to the instance (G, S) of re-\nstricted Thue number constructed in Theorem 3. Let c = |S S| be the number of colors coloring\nG, u = |y|, and let lbe the smallest integer such that 2l≥c + u + 1 and m = 4l+ 3.\nLet w0\ni , w1\ni be the two colors corresponding to the universally quantified variable xi. Then we\nmodify G by introducing new colors wI\ni and wF\ni and replacing each edge colored by A ⊆{w0\ni , w1\ni }\nby three edges in series colored {wI\ni }A{wF\ni }. Clearly, this graph (G′, S′) ∈restricted Thue\nnumber iff(G, S) is. We construct from this graph an instance (H, 2m + 6) of Thue number.\nLet S∗be the set of colors that are not wj\ni for j ∈2. For every edge e of G′ whose color is\nfrom S∗, we add to H a 7-hypercube Ee with two opposing vertices (v0 for the one closer to the\ntip of the snout along a potentially square path and v1 for the other one) acting as the vertices of\nthe edge gadget. For each color s ∈S∗and for each pair Xi = {x0\ni , x1\ni }, we also add a consistency\ngadget Qs (respectively Qi\nX). This consists of a 2m-clique with every vertex identified either with\nthe central vertex of the first two layers of a 7-hypercube, called the plume emanating from this\nvertex, or with a vertex of an edge gadget. For each edge e whose color is s, two vertices of Ee are\nidentified with vertices of Qs: u0 for one that is distance 3 from v0 and u1 for one that is distance\n4 from v0.\n11"},{"page":12,"text":"Figure 4: A C-gadget.\nIt may be thought of as a sequence of strung-together hypercubes of\ndimensions 2, 1, 1, and 3, together with plumes that inflate the degree of some vertices.\nFigure 5: A C-gadget. It may be thought of as two hypercubes of dimensions 3 and 4 together\nwith plumes that inflate the degree of some vertices.\n12"},{"page":13,"text":"For the edges colored by subsets of {x0\ni , x1\ni }, the choice edge in the snout becomes the gadget\ndepicted in Fig. 4, which we call a C-gadget or Ci. The negative edge in the variable gadget becomes\nthe gadget depicted in Fig. 5, which we call an N-gadget or N i. In both cases, the asterisked vertex\nu is identified with a vertex of QXi and v0 and v1 are connected to other edge gadgets.\nFinally, the other edge becomes a P-gadget P i. This is a 7-hypercube attached to the consistency\ngadget in the same way as Ee, but is modified in several ways. In order to explain this, let us first\nlabel the dimensions of the hypercube a, b, c, d, ab, ac, ad. (This labeling will be explained later.)\nLet a, b, ab span the distance from u0 to v0, and, correspondingly, let c, d, ac, ad span the distance\nfrom u0 to v1. Let us eliminate the edges c, d, ac, ad adjacent to v1. We then nearly saturate the\nvertices that are separated from u0 by the paths (a, c, ac) and (a, d, ad) (call them u−1 and u−2\nrespectively) with 2m −2 additional edges, but then remove the original edges corresponding to b\nfrom both and c and d from u−1 and u−2 respectively.\nNow that we have constructed a graph, we will attempt to color it nonrepetitively with k colors,\nand show that it has a nonrepetitive coloring iffthe instance of ∀∃3SAT is negative. Let us call the\nset of colors K and call the color of an edge e under a hypothetical coloring C(e). Conversely, we\ndenote by [c] an edge of color c if its more precise identity is irrelevant.\nClaim 1. Let e1, . . . , en be the set of edges of color s ∈S∗. Then in a nonrepetitive coloring, Eei\nmust all be colored with the same 7 colors. Similarly, for every i, Ci, N i, and the hypercube portion\nof P i must all be colored with the same 7 colors.\nProof. Suppose we have a nonrepetitive coloring C(e).\nInside each consistency gadget Q, each vertex of the 2m-clique is saturated. Let u, v, and w be\nsuch vertices, and suppose that C(uv) is the same as the color of the edge of a plume adjacent to\nw. Then there is an edge of color C(uw) adjacent to v. Together with uw, these four edges then\nform a square path. To avoid this, the set Z(Q) of 7 colors that colors the first layer of each plume\nmust be disjoint from the set G∗(Q) of 2m −1 colors that colors the clique. By a similar argument,\nthe second layer of every plume must also have a color in Z(Q). According to [1], the coloring can\nbe constructed in such a way that G∗(Q) consists of the nonzero elements of the group Zm\n2 . (From\nnow on we will refer to just Z and G∗when Q is clear from the context.)\nBy the same token, the edges in the edge gadgets of distance at most two from ui must be\ncolored with colors from Z.\nNow suppose we have an edge e that has distance 3 from ui.\nIf\nC(e) ∈G∗, then the path consisting of e and the two edges that connect it to ui can be duplicated\ninside the consistency gadget, so C(e) ∈Z.\nThe maximum distance of an edge in any edge gadget from the closer ui is 4. Let us first\nconsider a gadget Ee, and let Z = {c1, . . . , c7}. We know that edges in the first three layers from\nu0 have colors in Z, so they must be arranged according to the hypercube lemma. Let wijk be\nseparated from u0 by edges [ci][cj][ck]. Let e4 be the edge incident to w123 that would be colored\nc4 if Ee were nonrepetitively colored by Z, and let e3 be the edge incident to w124 that would be\ncolored c3. These edges are adjacent.\nNow we have four cases, since both C(e3) and C(e4) can be either in Z or in G∗. Suppose that\nC(e3), C(e4) ∈Z. Then if it is not true that C(e3) = c, C(e4) = d, and we don’t have a trivial\nrepetition, then we have a square path of the form [c1][c2]e4e3[c1][c2][C(e4)][C(e3)]. So suppose that\nC(e4) ∈G∗. But we have a square path [C(e3)][C(e4)][c2][c4][c1]e3e4[c2][c4][c1] that starts with two\nedges of the consistency gadget. Finally, if C(e4) ∈Z but C(e3) ∈G∗, we have the analogous path\n[C(e4)][C(e3)][c2][c3][c1]e4e3[c2][c3][c1].\n13"},{"page":14,"text":"Hence in a nonrepetitive coloring the fourth layer is also colored by Z according to the hypercube\nlemma. Since we can prove the same thing starting from u1, this means the colorings from the two\nuis match, and so the entire hypercube is colored in this way.\nThis is also valid for the P-gadget.\nLet us start from u1.\nNone of the removed edges has\ndistance less than 4 from this vertex, and six have distance 4. Since none of them are joined at a\nvertex whose distance from u1 is 4, we can apply the previous argument to the ones that are not\nremoved. This leaves only the edges whose hypercube distance from u0 is at most 3; but since no\nremoved edges have distance less than 3 from u0, this is the same as their actual distance, so we\nare done.\nIf the color of the edge in QX between u0 and u1 is represented in the plume of u−j, there is\na square path of length 8 going through u−j, u0, and u1. Hence this must be the one color in G∗\nthat is missing from the plume.\nIn the other two gadgets, all the edges except the clump closest to v1 have distance at most 3\nfrom the vertex u attaching them to QX, and thus are known to have colors from Z.\nNow, in P X we have paths τ0 = [a][b][ab], τ1 = [c][d][ac][ad], τ2 = [b][c][ab][ac], τ3 = [b][d][ab][ad]\neach between u±j and v0, and paths σ0 = [a][b][ab], σ1 = [c][ac][a], σ2 = [d][ad][a] each between\nu±j and v1. Now, vertex v0 is also vertex v1 of an E-gadget Ee′, and the color of e′ in G is xi\ni.\nSome path [k0][k1][k2] leads us to the vertex u1 of this gadget. Now, this means that we have a\npath [k2]τi[k0][k1][k2][C(τi)][k0][k1] through the two gadgets and Qxi\ni, which a nonrepetitive coloring\nwould require to have a loop. Hence in the group G = (G∗(Qxi\ni) ∪{0}, +) ∼= Zm\n2\nwe must have\na + b + ab = 0. Furthermore, since a possible Ti is (d, b, ab, ad), having a loop of size 3 means\nthat b + ab + d = 0 or b + ab + ad = 0, which contradicts the previous statement. Hence we have\nb + d + ab + ad = 0, and by the same argument b + c + ab + ac = 0. By addition we then have the\nstatements c + d + ac + ad = 0, a + c + ac = 0, and a + d + ad = 0. It is easy to see that we can\ncreate no more such identities using colors from Z(QX). By a similar argument, each σi must form\na loop in Qxf\ni , which gives us the same six identities.\nBy construction, the other two gadgets attached to QX are also preceded by xi\ni edge gadgets,\nso each path from v0 to u in these gadgets must have one of the three sets of colors {a, b, ab},\n{a, c, ac}, {a, d, ad}.\nNow, in N X, the edges whose distance from u is at most 3 are known to be in Z(QX). Further-\nmore, the two paths [ac][c][a] and [ad][d][a], if they were present starting from u, would create a\nsquare path where an edge adjacent to some u−j of P X repeats the edge between u0 and u. Now,\nif A is the set of colors coloring the cube in N X, it must be that P A = 0 in G(Qxi\ni). Thus it\nmust be that A = {a, b, ab} and that the vertices of the 4-hypercube that are adjacent to u and\nthose that are distance 2 away are effectively saturated. Hence by the saturation lemma all of the\n4-hypercube, except maybe the edges adjacent to v1, is colored from {c, d, ac, ad}. But to prevent\na square path through Qxf\ni , these last edges must also be colored from that set.\nWe apply a slightly different argument to CX. To prevent a repetition going through u−j and\nu1 of P X, either the set A0 of colors of the paths from v0 to u must be {a, ab, b}, or the edge labeled\nn must be colored b. Furthermore, if A0 = {a, ab, b}, to prevent a repetition going through u−j and\nu0, the edge labeled n must be colored c or d, and otherwise the edge labeled m must be colored c\nor d. The plumes at wi and y clearly cannot contain an edge of the same color as m, and the plumes\nat zi cannot contain an edge of the same color as n. Thus these vertices are effectively saturated,\nand we can apply the saturation lemma to the faces of the cube closer to u. Furthermore, if some\npj is the same color as an edge in the square, then we have a square path of length 6 through the\n14"},{"page":15,"text":"corresponding wi and zk. Thus except for the edges adjacent to v1, we know that the paths from u\nto v1 must be colored from the set A1 = Z(QX) \\ A0. Now, by the argument above, G(Qxi\ni) must\nhave P A0 = 0, and thus so does G(Qxf\ni ). So P A1 = 0 in G(Qxf\ni ). Then to prevent a square path\nthrough Qxf\ni , the last edges of paths from u to v1 must also be colored from A1.\nClaim 2. Given a nonrepetitive coloring of H, for every existentially quantified variable x, there\nis a path from v0 to v1 of CX that has the same pattern of colors as a path from v0 to v1 of either\nN X or P X, but not both.\nProof. Let us assume the coloring of P X that we have implied: we have already shown that this\nis unique up to permutation. We have also already shown that given this coloring, N X must have\ncolors a, b, ab in the cube and c, d, ac, ad in the hypercube, and that CX must have one of the\nzero-sum sets of 3 colors on the shorter side and one of the zero-sum sets of 4 colors on the longer\nside.\nIf the shorter set is {a, b, ab} then clearly there is a path through the gadget that is the same\nas a path through N X. On the other hand, there is not a path that is the same as a path through\nP X, since no path through P X ends in c, d, ac, or ad.\nOtherwise the gadget contains either the path (a, ac, c, b, d, ad, ab) or the path (a, ad, d, b, c, ac, ab).\nThe removed edges in the P-gadget are all in either fourth or last position. Now, the edge ab ad-\njacent to v1 is present. Furthermore, the removed b-edges are preceded by the sets {ab, c, ac} and\n{ab, d, ad}, so they are not the b-edges in these paths. Hence, these paths are present in P X. Since\nthe first three colors cannot be a permutation of {a, b, ab}, there is no path that is the same as a\npath through N X.\nClaim 3. If ∀x∃y f(x, y), then every coloring of H has a square path.\nProof. Let us assume that we have a nonrepetitive coloring. It must then agree with claims 1\nand 2. From claim 1, the path c1 . . . c7 from v0 to v1 exists for all the E-gadgets. On the other\nhand, claim 2 tells us that a nonrepetitive coloring of a C-gadget is effectively a choice between\nthe corresponding N-gadget and P-gadget. So by choosing a y that satisfies f for the choice of x\nprovided by the coloring, we can create a long square path analogous to the one for G.\nNow, assuming that ∃x∀y ̸ f(x, y), we construct a coloring we claim to be nonrepetitive.\nLet x1, . . . , xp be an assignment to the universally quantified variables such that ∃y f(x, y) is not\nsatisfiable. We set aside 7 colors ai, bi, ci, di, abi, aci, adi for each consistency gadget Qwi, all of them\ndistinct. We color the E-gadgets so that for one, {ai, bi, abi} spans the distance from u0 to v0 and\n{ci, di, aci, adi} spans the distance from u0 to v1; for another, {ai, ci, aci} and {bi, di, abi, adi}; and\nfor the third, {ai, di, adi} and {bi, ci, abi, aci}. If G′ has a fourth edge of that color, then we make\nsure that the coloring of the gadget corresponding to the edge in the snout is different from all the\nothers, but color the fourth edge gadget in one of these three ways.\nFor a consistency gadget that controls a universally quantified variable xj, we color N xj and P xj\nin the way already described. We then color Cxj so that it contains the path (ai, bi, abi, ci, di, aci, adi)\nif xj = 1 and the path (ai, aci, ci, bi, di, adi, abi) if xj = 0.\nLet us set aside a set of 7 colors β1, . . . , β7 distinct from the ones enumerated so far.\nNow we need to color the consistency gadgets, which we do using the group method in [1]. First,\nwe assign the elements of the subgroup of Zm\n2\ngenerated by the first three generators to the set\ncontaining each edge gadget’s u0 and u1, whose cardinality clearly is at most 8. Furthermore, we\n15"},{"page":16,"text":"set the numbers of the vertices so that the sum of the colors of u0 and u1 within an edge gadget does\nnot depend on the edge gadget. Thus the colors of the edges between these vertices are nonzero\nmembers of this subgroup, and the edge between u0 and u1 is the same color for each edge gadget.\nWe assign to these edges the colors β1, . . . , β7, with β1 being the color between u0 and u1 for every\nE- and P-gadget.\nFor a consistency gadget corresponding to a universally quantified variable xi, we label the\nvertex u0 of P xi with 0 and the other three u-vertices with a generator of the subgroup. This\nensures that all the edges that connect two u-vertices are colored differently.\nNow, using the rest of the generators, we can find 2l−1 ≥c+2u subgroups Gg of Zm\n2 isomorphic\nto Z4\n2, one for each nonzero element g ∈Zm/4\n2\n, by taking the generators g0, g1, g2, g3 to have ith\ndigit gj\ni = g(j−i−3)/4 if 4 | j −i −3 and 0 otherwise.\nWe next arbitrarily assign group elements to the rest of the vertices, and hence edges. However,\nwe assign colors to the group elements in such a way that for each set Z(Qi) we take a distinct\nsubgroup of the kind described and assign ai, bi, ci, di to the generators and abi, aci, adi to the\nelements ai + bi, ai + ci, and ai + di, respectively.\nSince the first three digits are zero for all elements of these sets, we have guaranteed that we\ncan never get βi by adding together colors of edge gadgets.\nClaim 4. This coloring is nonrepetitive when restricted to a consistency gadget Q together with its\nedge gadgets.\nProof. We have already shown that the coloring of each gadget is nonrepetitive.\nA path within Q whose colors are contained in Z(Q) cannot reach a vertex at a distance of\nmore than 2 from the interface with colors in G∗. On the other hand, by construction, no colors\nin G∗(Q) are present in the edge gadgets within distance 2 of ui. Thus a portion of a square path\nwithin an edge gadget must be repeated at least partially in another edge gadget.\nFor an E-gadget, this means that one such portion must not be at the end of a path. Thus,\nsince the path is open, it goes through the edge gadget from u0 to u1, and contains an odd number\nof edges of each color in Z(Q). If some such portion is repeated by sections at both the beginning\nand end of the path, then one of these sections must be in an E-gadget, and therefore we can splice\nthe other section onto that one to create another open square path. Thus we can build a shorter\nsquare open path by replacing each such portion with the edge between u0 and u1, which we know\nhas the same color β1 for each gadget. But this substitution produces a square path entirely inside\nQ, which must be a loop.\nAssume now that Q corresponds to a universally quantified variable. We have already con-\nstructed our coloring so that a path starting from one of the edges adjacent to u−j and continuing\nto either C or N cannot repeat. Now, we did not color an edge adjacent to u−j by β1, so a path\nfrom u0 to u1 that is repeated by edges within P must be at least two edges long. But a path from\nu−j in colors from G∗(Q) may only be one edge long. Now, the set of colors separating u−j and ui\nis different from the set of colors separating u−3+j and u1−i. Therefore, we cannot find a square\npath that traverses both. So any square path must contain at least two sections within Q. Such\nsections, if they are each between two u-vertices, cannot repeat each other since by our construction\nthe group element leading between each pair of u-vertices is different. But such a path also cannot\nuse the plumes because any vertex in N and C has distance at most 4 from u, so this together with\nthe plumes would not be enough to repeat a path through P containing 7 distinct colors.\n16"},{"page":17,"text":"Claim 5. In a square path, colors in edge gadgets cannot be duplicated by the same colors in\nconsistency gadgets, except perhaps in one plume.\nProof. Suppose we have a square path that serves as a counterexample to this, with some sequence\nof colors occurring in an edge gadget E0 repeated by a sequence in a consistency gadget Q1. We\ngive the name p to this path and pΓ to the portion of it that goes through a gadget Γ. We orient\np so that pE0 comes before pQ1; we therefore refer to the first and second halves of p, and to ends\nand beginnings of sections.\nWe start with case 1: E0 does not belong to Q1 and pE0 is not at the beginning of p. Then\nthe ends of pE0 are vertices from the set {u±j}∪{vi}. By construction, the colors of any such path\nform a loop in Q1, so the path cannot be open.\nThus if E0 does not belong to Q1, then pE0 is the beginning of p. Then the edges following pE0\nmust come either from a consistency gadget Q0 (case 2) or another edge gadget E∗(case 3.)\nCase 2: In order to link the two half-paths, the first half must eventually leave Q0. If it leaves\nearly, so that an adjacent edge gadget is repeated in Q1, then we are back in case 1. If it leaves\nlate, so that it is repeated by an edge gadget adjacent to Q0, then we are also back in case 1: if the\npath ended in that edge gadget, then there would be nothing to repeat the edge gadgets between\nQ0 and Q1. Finally, if the vertex ui at which the path leaves Q0 is repeated by a vertex uj at which\nthe path leaves Q1, then since we are in different consistency gadgets, the edges we traverse have\ndifferent sets Z of colors, a contradiction.\nCase 3: If E∗does not belong to Q1, then it must be duplicated inside Q0, since the other\noption is an edge gadget belonging to Q0, which does not match colors. Therefore, substituting E∗\nfor E0, we get case 1 and a contradiction.\nSo E∗belongs to Q1. This means that the end of pE0 is vi. Furthermore, since pE∗must have\nodd numbers of at least three colors, and since pE0 is the beginning of p and therefore all of pE∗is\nin the first half, pE∗cannot be repeated in a plume of Q1. Thus Q1 must end with uj of an edge\ngadget E1 which repeats vi. If pE∗ends with v1−i, then pE1 ends with u1−j and we are again in\ncase 1. On the other hand, if pE∗ends at uk, then PE1 ends with vl, and so either we are back in\ncase 1 or the path ends after PE1. But that would mean that the colors of pE0 and pE1 would add\nup in G(Q1) to βi for some i, which contradicts the construction.\nThe remaining possibility, case 4, is that E0 belongs to Q1. Then for colors to match, the\npart of pQ1 that repeats pE0 must be contained in a plume of Q1 and therefore be the end of the\npath.\nClaim 6. No square path in this coloring goes through a consistency gadget.\nProof. By claim 5, colors in edge gadgets must be duplicated by colors in edge gadgets. Now,\nsuppose we have a square path p that goes through a consistency gadget Q. We use the notation of\nclaim 5 to denote portions of this path. On both sides of pQ, we have paths through edge gadgets\nE1 and E2. We now enumerate cases once again.\nCase 1 occurs when pE1 is a path between u0 and u1. Then there must be a subpath repeating\nit, which, by claim 5, then also goes from ui to u1−i in an edge gadget E∗\n1 of Q. We can create\nanother square path by replacing pE1 and pE∗\n1 by single edges within Q, reducing the problem to\nany of the other cases.\nSo we can assume that both pE1 and pE2 go to a vi. Then if we orient the path, one subpath\ngoes from an edge gadget to Q and the other goes from Q to an edge gadget. Therefore, by claim\n17"},{"page":18,"text":"5, one cannot be the repetition of the other. Thus p must traverse Q twice and associated edge\ngadgets four times, at least three of these times passing between a ui and a vi. (The fourth time\nit does not have to do this since a traversal may be split between the beginning and the end of p.)\nFurthermore, the edge subpaths must be in two pairs, each of which has one set of colors, and at\nleast one of the pairs must have both its subpaths continue in other edge gadgets.\nSuppose now that Q is not associated with a universally quantified variable. Case 2 occurs\nwhen the two subpaths are in the same E-gadget. Since no edge in G′ is adjacent to edges of one\ncolor through both incident vertices, the colors of the neighboring edge gadgets must be different\nand the path cannot be square.\nIn case 3, the two subpaths are in different E-gadgets. In order for them to be colored the\nsame, we must assume that Q controls four E-gadgets and neither of the E-gadgets traversed by\nthe subpaths corresponds to an edge in the snout of G′. But the edges not in the snout all border\ndifferent colors, so the path once again cannot be square.\nCase 4: We are left with the possibility of Qxj being associated with a universally quantified\nvariable xj. We colored Qxj in such a way, however, that the sets of paths within it between every\npair of u-vertices are disjoint. Therefore, if we orient p in a certain way, the second pQxj must be\nat the end of the path. By the same token, p must begin with a section in one of the edge gadgets\nbelonging to Qxj.\nAll the v0s of the edge gadgets of Qxj are incident to E-gadgets of colors Z(Qxi\nj) and all the\nv1s are incident to E-gadgets of colors Z(Qxf\nj ). Hence paths to v1 can be repeated by paths to v1\nand paths to v0 can be repeated by paths to v0. By construction, the possible repetitions of paths\nbetween uj and vi are then\n1. if xj = 0, a path between v0 and u in N xj with a path between v0 and u0 in P xj\n2. if xj = 1:\n(a) A path between v0 and u in Cxj with a path between v0 and u in N xj and a path\nbetween v0 and u0 in P xj\n(b) A path between v1 and u in Cxj with a path between v1 and u in N xj.\nIn each case, therefore, there can be only one such repetition in an open path. Since gadgets be-\nlonging to Qxj occupy both the beginning and the end of p, there may be no traversal of consistency\ngadgets other than Qxj within p.\nA path through N xj cannot repeat a path through P xj since these paths would have to go\nthrough edge gadgets corresponding to different direction-determining colors of G′. Also, a path\ngoing through v0 of Cxj is going towards the tip of the snout, and therefore cannot meet any more\ngadgets belonging to xj. This gives us a contradiction if v0 is part of one of the square sections.\nThus we are left with possibility 2(b).\nThis means that there must be a subpath consisting only of edge gadgets from v1 of Cxj to\nsome other vi of an edge gadget belonging to Qxj. If the path is from Cxj, then it must traverse an\nedge gadget belonging to Qa1\ni , which must be repeated by an edge gadget at the tip of the snout,\nwhich p cannot reach.\nThis restricts any potential square paths to going through a chain of edge gadgets. But this\nmeans that a square path maps to a square path in G′, which does not exist if ¬∀x∃y f(x, y). Hence\nthis is a reduction.\n18"},{"page":19,"text":"It is easy to see that the reduction runs in polynomial time, specifically O(n8).\n7\nAcknowledgements\nWe would like to thank Chris Umans for his mentoring and helpful suggestions at every stage of\nthe research; and Grigori Mints and Yuri Manin for reviewing the proofs.\nReferences\n[1] N. Alon, J. Grytczuk, M. Hauszczak, and O. Riordan. “Nonrepetitive colorings of graphs.”\nIn M. K ́aronski, J. Spencer, and A. Ruci ́nski, editors, Proceedings of the 10th International\nConference on Random Structures and Algorithms (RS&A-01), volume 21, 3–4 of Random\nStructures and Algorithms, pages 336–346, Danvers, MA, Aug. 6–10 2002. Wiley Periodicals.\n[2] J. Bar ́at and P.P. Varj ́u. “On square-free vertex colorings of graphs.” Studia Scientiarum Math-\nematicarum Hungarica (to appear).\n[3] J. Bar ́at and P.P. Varj ́u. “On square-free edge colorings of graphs.” Ars Comb. (to appear).\n[4] B. Breˇsar and S. Klavˇzar. “Square-free colorings of graphs.” Ars Comb. 70:3–13, Jan. 2004.\n[5] Thomas F. Coleman and Jorge J. Mor ́e. “Estimation of sparse Hessian matrices and graph\ncoloring problems.” Math. Programming, 28(3):243—270, 1984.\n[6] S. Czerwi ́nski and J. Grytczuk. “Nonrepetitive colorings of graphs.” Electronic Notes in Discrete\nMathematics 28:453–459, 2007.\n[7] J. Grytczuk. “Nonrepetitive Colorings of Graphs—A Survey.” International Journal of Mathe-\nmatics and Mathematical Sciences, 2007.\n[8] Ian Holyer. “The NP-Completeness of Edge-Coloring.” SIAM J. Comput. 10:718–720, 1981.\n[9] D ́aniel Marx and Marcus Schaefer. “The Complexity of Nonrepetitive Coloring.” DePaul Uni-\nversity Technical Report, TR 07-007, 2007.\n[10] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hierar-\nchy:\na compendium” (updated version). SIGACT News, September 2002. Retrieved from\n.\n[11] Marcus Schaefer and Christopher Umans. “Completeness in the Polynomial-Time Hi-\nerarchy:\nPart II” (updated version). SIGACT News,\nDecember 2002. Retrieved from\n.\n[12] Axel Thue. “ ̈Uber unendliche Zeichenreihen.” Norske Vid. Selsk. Skr. I, Mat. Nat. Kl. Chris-\ntiana 7, 1-22, 1906. Reprinted in Nagell, T.; Selberg, A.; Selberg, S.; and Thalberg, K. (Eds.).\nSelected Mathematical Papers of Axel Thue. Oslo, Norway: Universitetsforlaget, pp. 139-158,\n1977.\n19"}]},"section_tree":[],"assets":{"figures":[],"tables":[],"images":[]},"math_expressions":{"inline":[],"block":[{"equation_id":"eq1","equation_number":null,"raw_text":"which w = xyyz. A nonrepetitive coloring of a graph is an edge coloring in which the sequence","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq2","equation_number":null,"raw_text":"n. For n = 2, this is the edge coloring problem; thus the bounded-path version can be thought","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq3","equation_number":null,"raw_text":"2 = NPNP, a class","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq4","equation_number":null,"raw_text":"each of the vertices in a set to bi+1, or a vertex c if i = n. The sets of vertices and paths going","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq5","equation_number":null,"raw_text":"j = m, making sure that this is the only clause gadget that uses this vertex.","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq6","equation_number":null,"raw_text":"Proof. Suppose that G is 3-edge-colorable, and let p = qr be a square path in H of length at","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq7","equation_number":null,"raw_text":"Case 3: p accesses a vertex gadget J′ ̸= J which interfaces J at a non-red edge set. This again","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq8","equation_number":null,"raw_text":"d ·22dk +a·22(d−1)k) = Θ(a","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq9","equation_number":null,"raw_text":"stricted Thue number constructed in Theorem 3. Let c = |S S| be the number of colors coloring","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq10","equation_number":null,"raw_text":"G, u = |y|, and let lbe the smallest integer such that 2l≥c + u + 1 and m = 4l+ 3.","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq11","equation_number":null,"raw_text":"the edge gadget. For each color s ∈S∗and for each pair Xi = {x0","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq12","equation_number":null,"raw_text":"consider a gadget Ee, and let Z = {c1, . . . , c7}. We know that edges in the first three layers from","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq13","equation_number":null,"raw_text":"C(e3), C(e4) ∈Z. Then if it is not true that C(e3) = c, C(e4) = d, and we don’t have a trivial","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq14","equation_number":null,"raw_text":"Now, in P X we have paths τ0 = [a][b][ab], τ1 = [c][d][ac][ad], τ2 = [b][c][ab][ac], τ3 = [b][d][ab][ad]","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq15","equation_number":null,"raw_text":"each between u±j and v0, and paths σ0 = [a][b][ab], σ1 = [c][ac][a], σ2 = [d][ad][a] each between","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq16","equation_number":null,"raw_text":"would require to have a loop. Hence in the group G = (G∗(Qxi","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq17","equation_number":null,"raw_text":"i) ∪{0}, +) ∼= Zm","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq18","equation_number":null,"raw_text":"a + b + ab = 0. Furthermore, since a possible Ti is (d, b, ab, ad), having a loop of size 3 means","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq19","equation_number":null,"raw_text":"that b + ab + d = 0 or b + ab + ad = 0, which contradicts the previous statement. Hence we have","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq20","equation_number":null,"raw_text":"b + d + ab + ad = 0, and by the same argument b + c + ab + ac = 0. By addition we then have the","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq21","equation_number":null,"raw_text":"statements c + d + ac + ad = 0, a + c + ac = 0, and a + d + ad = 0. It is easy to see that we can","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq22","equation_number":null,"raw_text":"if A is the set of colors coloring the cube in N X, it must be that P A = 0 in G(Qxi","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq23","equation_number":null,"raw_text":"must be that A = {a, b, ab} and that the vertices of the 4-hypercube that are adjacent to u and","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq24","equation_number":null,"raw_text":"n must be colored b. Furthermore, if A0 = {a, ab, b}, to prevent a repetition going through u−j and","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq25","equation_number":null,"raw_text":"to v1 must be colored from the set A1 = Z(QX) \\ A0. Now, by the argument above, G(Qxi","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq26","equation_number":null,"raw_text":"have P A0 = 0, and thus so does G(Qxf","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq27","equation_number":null,"raw_text":"i ). So P A1 = 0 in G(Qxf","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq28","equation_number":null,"raw_text":"if xj = 1 and the path (ai, aci, ci, bi, di, adi, abi) if xj = 0.","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq29","equation_number":null,"raw_text":"i = g(j−i−3)/4 if 4 | j −i −3 and 0 otherwise.","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq30","equation_number":null,"raw_text":"1. if xj = 0, a path between v0 and u in N xj with a path between v0 and u0 in P xj","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"},{"equation_id":"eq31","equation_number":null,"raw_text":"2. if xj = 1:","raw_latex":null,"normalized_latex":null,"display_type":"block_candidate"}],"equation_refs":[]},"symbol_table":[],"references":{"in_text_markers":[],"bibliography":[]},"claims":[],"flow_graph":{"nodes":[],"edges":[]},"quality":{"text_char_count":61318,"parse_confidence":0.5,"equation_parse_rate_proxy":1.0,"citation_resolution_rate_proxy":0.0,"structure_coverage_proxy":0.0,"asset_coverage_proxy":0.0,"accepted_for_training":true}}