14

Let there be two players, $A$ and $B$, and a map.

They now play a game such that:

  • Player $A$ picks a region and player $B$ colors it such that the region is a different color than all adjacent regions.

  • Player $B$ wins if at the end of the game, the map is colored such that no two adjacent regions are the same color. Player $A$ wins if at any point in time that becomes impossible.

If there are five available colors, does player $A$ have a winning strategy for every possible map?

David Raveh
  • 1,876
  • 2
    What's the origin of this problem? What are your thoughts on it? How much do you know about graph coloring? – Steven Stadnicki May 01 '20 at 18:21
  • I know that in a 6-color version player A has a relatively simple winning solution. – blademan9999 May 01 '20 at 18:22
  • 1
    It seems that the strategy for A is just picking regions with most adjacent colored regions. I might be wrong, though. – Julian Mejia May 01 '20 at 18:26
  • Do you have a link or reference for the $6$-color version? – saulspatz May 01 '20 at 18:29
  • 7
    Any planar graph will always have vertices with degree <6. As such these can be coloured no matter the coloring of the surrounding vertices. So you just remove a random vertice with d<6 and keep doing this until there are no vertices left. (when you remove a vertex all surrounding vertexes will have their degree reduced by 1). Then you pick the vertices in the opposite order for the purpose of colouring. At every stage a vertex is picked that has <6 already coloured neighbours. So each vertex will be possible to colour no matter what colours have been use for previous vertexs. – blademan9999 May 02 '20 at 09:56
  • Why does any panar graph have vertices of degreee $<6$? Take $n+1$ points, $v$ and $v_1$,...,$v_n$ (such that $v_1v_2...v_n$ is a convex $n-$gon) and draw edges $v_1v$, $v_2v$,...,$v_nv$ and $v_1v_2$, $v_2v_3$,...,$v_{n-1}v_n$,$v_nv_1$. (This can be easily interpreted as a map) Or by vertices you mean that at least one with degree $<6$ exists? –  Oct 12 '20 at 14:33
  • The question is about coloring regions; the discussion above is about coloring vertices. Does it apply directly? – Gerry Myerson Jul 16 '23 at 05:31
  • The vertex coloring game is discussed at https://en.wikipedia.org/wiki/Graph_coloring_game and it says there that for the set of planar graphs the minimum number of colors needed to guarantee a first-player win is somewhere between $7$ and $17$. The reference for the upper bound is Zhu, Xuding (2008). "Refined activation strategy for the marking game". Journal of Combinatorial Theory, Series B. 98 (1): 1–18. doi:10.1016/j.jctb.2007.04.004 the reference for the lower bound is (continued, next comment) – Gerry Myerson Jul 16 '23 at 05:49
  • (continued from previous comment) Kierstead, Henry A.; Trotter, William T. (1994). "Planar Graph Coloring with an Uncooperative Partner" (PDF). Journal of Graph Theory. 18 (6): 564–584. doi:10.1002/jgt.3190180605 and there is a survey article, Bartnicki, Tomasz; Grytczuk, Jaroslaw; Kierstead, H. A.; Zhu, Xuding (2007). "The Map-Coloring Game" (PDF). American Mathematical Monthly. 114 (9): 793–803. doi:10.1080/00029890.2007.11920471. JSTOR 27642332. S2CID 15901267 – Gerry Myerson Jul 16 '23 at 05:51
  • Sorry, the vertex coloring game of my last two comments isn't the one OP is asking about, but the one where the two players alternate coloring regions (or vertices) of a plane graph. – Gerry Myerson Jul 16 '23 at 06:02

1 Answers1

3

There is a winning strategy for Player A.

If Player A runs the optimal graph coloring algorithm with a specific modification they can win. The algorithm is described briefly here:

Algorithm $\text{Optimal-Color}(G)$

  1. Initially all the vertices of the graph $G:=(V,E)$ are not colored

  2. Initialize $All \leftarrow \{red, green, blue, yellow, black\}$, the set of all colors

  3. $UncoloredDegree(v)$ is the number of neighbors of $v$ that are uncolored and $ColoredDegree(v)$ is the number of neighbors of $v$ that are colored

  4. $Pick(G)$ is a function that picks the uncolored vertex $v$ with the highest $ColoredDegree(v)$. If two vertices have the same colored degree, the one with the higher degree is picked. A tie on degree is broken arbitrarily.

  5. $ConflictColors(v)$ is the set of colors of colored neighboring vertices of $v$

  6. $Color(v)$ is a function that colors the vertex $v$ using a color $c \in All \backslash ConflictColors(v)$

  7. $Remove(v, G)$ is a function that removes the vertex $v$ from $G$ and deletes all incident edges of the vertex $v$ while retaining the neighbors of $v$ in the graph (The degrees of the vertices are updated automatically)

  8. While $\exists v \in G$ having $UncoloredDegree(v) \gt 0$

    a. $v = Pick(G)$

    b. $Color(v)$

    c. $G_v = \text{ the connected subgraph of $G$ }$.

    d. While $G_v$ has an uncolored neighbor vertex

    $n = Pick(G_v)$

    $Color(n)$

    End While

    e. $Remove(v, G)$

  9. End While

End Algorithm

Analysis. This is the standard graph coloring algorithm. After the highest degree vertex and its neighbors are colored, the vertex is removed, leaving its colored neighboring vertices in the graph. All its neighbors degree is now reduced by $1$. By definition the set of colors used for the neighbors of $v$ cannot conflict with the chosen color of $v$. Once $v$ is removed, its color is no longer in conflict, so in Step 5. it becomes available for potential use to color another node in a subsequent step.

Also, it does not matter which color from the non-conflicting colors is chosen in each step. This is the key reason why this is a winning strategy for Player A.

The algorithm terminates because at some point all nodes will be colored and the While Loop in Steps 8-9. stops.

Analysis of the adversarial game In the game outlined in the question, the vertex selection decision is taken by Player A and only the coloring decision is taken by Player B. Vertex selection happens in steps 8.a and 8.d.

Although it looks like Player B has free will and choice, they cannot win because the color selection for a vertex has to be done using non-conflicting colors, if such a selection is possible. With 5 colors, there will always be a non-conflicting color available to choose, regardless of which non-conflicting sequence of colors have been chosen prior.

As long as such non-conflicting selections are made every step of the way, the game terminates with all vertices colored (i.e., Player A wins).

Non-conflicting selections can always be made by coloring triangles with $v$ as one of the vertices (the apex) of the triangle and choosing two non-conflicting colors for the other two vertices. The coloring decisions of two triangles apexed on the same vertex can be done without an additional color use if the two triangles don't share a side. In the example below vertex $8$ is the apex.

Triangles coloring with shared apex and no shared side

It can also be done if the triangles share a side; just use the color of the vertex opposite the shared side. In the example below, the edge $2-8$ is the shared side.

Triangles coloring with shared side

Once all triangles are colored, we will be left with single edges from $v$ to an uncolored neighbor. Any color other than the color of $v$ is non-conflicting for that neighbor.

If there are no triangles with $v$ as an apex, then a single color different from the color of $v$ is optimal. But even if Player A chooses different colors to suboptimize and sabotage the game, the next coloring for vertex $u$ can be done using the color of $v$ since $v$ is not connected to that uncolored vertex $u$.

Existence of valid coloring of node adjacent to partially colored graph. Suppose $G$ has been partially colored after $v$ has been colored and removed. We want to color vertex $u$ adjacent to a colored vertex $w$ ($w \ne v$ because it has been removed from consideration). We can reuse the color assigned to $v$ as it would be non-conflicting as long as $u-v-w$ is not a triangle. We have already shown that triangles always have a valid coloring. Therefore, a non-conflicting selection can always be made for a node adjacent to a partially colored subgraph.

Illustration

The following illustration shows the step by step coloring of a sample graph.

Illustration for sample graph coloring

The subgraph of $G$ containing vertices $1-2-3-4-5-6-7-8$ in which let us say vertex $8$ with degree $6$ is the maximal degree vertex. The connected neighbor subgraph of $v_8$ is $1-2-3-4-5-6-(8)$. Player B picks a color, say $blue$.

After coloring the max degree vertex

Player A then gives picks the neighbor with highest $ColoredDegree(8)$ which is $1$. Once Player B colors $1$, the next neighbor picked will be $2$. This sequence of $Pick(v)$ ensures that triangles are colored first. Suppose Player B wants to sabotage the game and adversarially chooses different colors for each node, say $1 \leftarrow red, 2 \leftarrow green$.

After Player B colors the vertices 1 and 2

Player A then gives the vertices $7-6$.

After Player B tries to max out colors

The next sequence of vertices for coloring is $4-5-3$ or $5-4-3$. Suppose Player A picks $5$. The choice of non-conflicting colors for $5$ are $\{red, green, yellow, black\}$. Any choice would do. There are three uncolored vertices and $4$ non-conflicting color choices. A valid coloring is possible regardless of which colors Player B chooses (as long as they are non-conflicting in every color assignment).

Completed coloring for vertex 8 and neighbors

References:

All 2-D maps are planar graphs. See accepted answer for Proof that every map produces a planar graph - Four Colour Theorem

Five Color Theorem. We can color any planar graph with 5 colors. See: http://www-math.mit.edu/~djk/18.310/18.310F04/planarity_coloring.html

Greg Martin
  • 92,241
vvg
  • 3,526
  • It seems that you are assuming that the graph representing the map does not have vertices of degree $>5$, which is not necessarily true. – Alma Arjuna Oct 13 '20 at 19:59
  • 1
    @Arjuna196: Yes, good catch. The average degree is strictly less than 6 but you can have nodes with degree $\gt 5$. I have clarified the answer including addition of a proof for existence of 5-colorings for all subgraphs containing a degree-$5$ or greater vertex. – vvg Oct 14 '20 at 03:52
  • What about if ALL the vertices have degree >=5 – blademan9999 Jun 25 '23 at 16:13
  • @blademan9999 :

    If the graph contains a degree-$5$ or greater vertex, then Player A chooses the subgraph consisting of the degree-$5$ or greater vertex first for coloring.

    – vvg Jun 26 '23 at 03:16
  • I really don't understand the proof here, and please remember that the opponent is picking colors specifically to trip you up. – blademan9999 Jun 26 '23 at 07:49
  • @bladerman9999: Yes, the opponent chooses the color, but my understanding of the rules of the game is that the opponent MUST choose a permitted color if such choice is possible. For eg: If a node is colored red and player A picks an adjacent node. Player B has red, green and blue colors left. Player B CANNOT choose red, but can choose either green or blue. That is my understanding. – vvg Jul 13 '23 at 10:48
  • "Color all triangles in the subgraph with colors distinct from the central node, if those vertices are not already colored. You need 2 distinct colors for it." Who is doing this coloring? As I understand it, only B does the colouring so why would he only use two colours? His goal is to make it difficult to colour. Also, this is a subgraph, so what about any edges that are left out of this subgraph? These vertices could be adjacent to previously coloured vertices in the full graph. – Jaap Scherphuis Jul 14 '23 at 15:12
  • It's not clear what subgraph(s) you're referring to. – aschepler Jul 14 '23 at 17:44
  • @JaapScherphuis : I have added an illustrative example. Subgraph refers to the partially or fully uncolored subgraph containing the highest degree uncolored vertex. In the example, the nodes $2,4,6$ could have been colored optimally by using blue and $3,5$ could have been colored optimally by using green (totally 3 colors, orange, blue, green). But Player B tries to sabotage by trying to exhaust colors. It does not matter since the key thing is a planar subgraph can always be colored with 5 colors. – vvg Jul 14 '23 at 20:14
  • You are assuming this is the first subgraph being coloured, so the dotted edges can be ignored. If this were later on in the game these dotted edges may restrict B's choice of colours so much that it cannot be coloured. Sure, this would also be at a high-degree node, but you will have to prove that in a cluster or cycle of such high degree nodes A can choose them (and their neighbours) in such an order that B cannot block the colouring. – Jaap Scherphuis Jul 14 '23 at 21:48
  • @JaapScherphuis : Valid point. But, I think there is an induction argument we can make. I'll write it up. – vvg Jul 14 '23 at 23:21
  • 1
    A game on the faces of a dodecahedron / vertices of an icosahedron is more complicated than your algorithm suggests. I'm not sure yet who has an unbeatable strategy for that game. – aschepler Jul 15 '23 at 03:11
  • (Any reason vertex 3 is included in your diagram but vertices between 1 and 2 or between 4 and 5 are not?) – aschepler Jul 15 '23 at 05:05
  • @aschelper: Good catch. That is an error. Neighbors of $7$ are $1, 2, 4, 5, 8$. Thank you. – vvg Jul 15 '23 at 05:14
  • I have revised the answer. The standard graph coloring algorithm is a winning strategy for Player A for any planar graph. – vvg Jul 15 '23 at 07:54
  • You still have the issue Jaap explained: vertices previously colored as neighbors can conflict with vertices you want to color as neighbors. On graph https://i.sstatic.net/anTtv.png: 4 red, 1 green, 2 green, 3 green, 5 green, 6 blue, 7 yellow, 11 green, 9 red, 10 black - B wins. – aschepler Jul 15 '23 at 23:48
  • I see the issue. The conflict arises because we are picking a subgraph / central vertex that is not directly adjacent to previously colored vertices. So, instead of coloring the next highest $UncoloredDegree(v)$ vertex $v$, if we picked the uncolored vertex $v$ having the highest $ColoredDegree(v)$ then we would be forcing Player A to use a valid color constrained by prior choices. We would then have to prove that a sequence of valid $5$-colorings is possible for all graphs. – vvg Jul 16 '23 at 03:13
  • [contd...] In your graph example, it would have forced Player B to color vertex $8$ (instead of $11$). Once $8$ is colored, the rest of the graph can be colored. – vvg Jul 16 '23 at 03:16
  • The original question is about coloring regions. This answer is about coloring vertices. What makes that change legitimate? – Gerry Myerson Jul 16 '23 at 05:40
  • @Gerry Myerson: The question is tagged with planar-graphs tag. So, we are assuming 2D maps reducible to planar-graphs. If the map is not Euclidean, say a torus, then 5 colors are not sufficient for some maps. – vvg Jul 16 '23 at 05:42
  • @GerryMyerson, for planar graphs there’s a duality between faces and vertices. At first glance I’m very confused by this algorithm. Rather than a bunch of ‘obvious’ definitions with edge case addendums, I think you would’ve been better served by descroinging the algorithm in English (I.e. greedily take the node with the most uncolored adjacent nodes using its component’s properties as a tiebreaker) and then rigorously show how that works. – Eric Jul 16 '23 at 05:58
  • 2
    If A has a winning strategy in general, it must depend on the colors B has chosen so far, and not just which vertices are colored and uncolored. If the game is on the icosahedral graph and B knew ahead of time the order A will choose the regions, then B can invent a map where the last region in the sequence is uncolored and surrounded by five different colors, and just fill in A's requests according to that plan. – aschepler Jul 17 '23 at 22:30