2. In Lecture 15, we studied the 3Color language:
3Color = {(G): the graph G is 3-colorable}.
1
We now consider a related problem that we call the partial 3-coloring problem. In this new
problem, we assume that the input graph G has vertex set V = {V1, V2..., Um}, and some of these
vertices are already colored. So we are given integers C1, C2,..., Cm ? {0,1,2,3} where
\begin{cases}
0 & \text{if } v_i \text{ is not colored yet} \\
1 & \text{if } v_i \text{ is colored red} \\
2 & \text{if } v_i \text{ is colored green} \\
3 & \text{if } v_i \text{ is colored blue}
\end{cases}
The problem is to decide whether the remaining vertices vi such that c? = 0 can be colored red,
green or blue, in such a way that for every edge (i, j), the vertices vi and vj have different colors.
We define Partial3Color as the language of all input string (G, C1, C2,..., Cm) corresponding
to instances of this problem whose coloring can be completed. Figure 2a shows an example of a
string (G, 1,0,0,3,0) ? Partial3Color, and Figure 2c shows an example of a string (G, 1,0,0,3,2)
Partial3Color.
U1
U2
U1
02
03
U3
U1
U2
03
U4
U5
U4
05
U4
U5
(a)
(b)
(c)
Figure 2: (a) An input (G, 1,0,0,3,0). (b) This input string (G, 1,0,0,3,0) is in Partial3Color, as
the coloring can be completed. (c) The input (G, 1, 0, 0, 3, 2) string is not in Partial3Color, because
the coloring cannot be completed, as we would need a fourth color for v3.
Prove that if 3Color ? P, then Partial3Color ? P.