 # Improved lower bounds on parity vertex colourings of binary trees

A vertex colouring is called a parity vertex colouring if every path in G contains an odd number of occurrences of some colour. Let χ_p(G) be the minimal number of colours in a parity vertex colouring of G. We show that χ_p(B^*) >√(d) + 1/4_2(d) - 1/2 where B^* is a subdivision of the complete binary tree B_d. This improves the previously known bound χ_p(B^*) >√(d) and enhances the techniques used for proving lower bounds. We use this result to show that χ_p(T) > √(n) where T is any binary tree with n vertices. These lower bounds are also lower bounds for the conflict-free colouring. We also prove that χ_p(G) is not monotone with respect to minors and determine its value for cycles. Furthermore, we study complexity of computing the parity vertex chromatic number χ_p(G). We show that checking whether a vertex colouring is a parity vertex colouring is coNP-complete. Then we use Courcelle's theorem to prove that the problem of checking whether χ_p(G) < k is fixed-parameter tractable with respect k and the treewidth of G.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## Introduction

###### Definition 1.

Let be a graph. A vertex colouring is called a parity vertex colouring if every path in contains an odd number of occurrences of some colour. The parity vertex chromatic number of (denoted by ) is the minimal number of colours in a parity vertex colouring of .

This colouring was independently introduced by Cheilaris and Tóth  and Borowiecki et al. . Cheilaris and Tóth  introduced it as a relaxation of the conflict-free and the unique-maximum colouring, motivated by the fact that this relaxation is useful for proving lower bounds on the minimal number of colours in these other colourings. A conflict-free colouring (in the literature also known as a conflict-free colouring of hypergraphs with respect to paths) is a colouring of vertices of such that for every path in there exists a colour used exactly once on . The main application of the conflict-free colouring is in frequency assignment for cellular networks. The conflict-free colouring was studied in [7, 6].

The conflict-free colouring is a relaxation of a unique-maximum colouring. A unique-maximum colouring (in the literature also known as a unique-maximum colouring of hypergraphs with respect to paths or alternatively as a vertex ranking) is a colouring of vertices of such that for every path in the maximum colour used on is used exactly once on . We denote the minimal number of colours used in a colouring of by unique-maximum chromatic number . This colouring has many applications including sparse Cholesky factorization  or VLSI layout . Theoretical and algorithmic properties of this colouring were studied in many papers, see e.g. [2, 7, 3]. Note that the parameter is equivalent with the height of the minimum height elimination tree of , see e.g  for details. It is also equivalent with the tree-depth of , see  for details.

Borowiecki et al.  began the study of the parity vertex colouring inspired by the work on the edge variant of this problem. The study of the parity edge colouring was initiated by Bunde et al.  and continued by Hsu and Chang . It was motivated by the fact that this colouring is closely related to the problem of deciding whether a graph embeds in the hypercube and the fact that the hypercube is one of the most popular architectures used for parallel computations .

Recently, several other related colourings were introduced. Namely vertex and edge variants of the conflict-free connection colouring and the parity connection colouring of graphs (the parity versions are sometimes called odd connection colourings). The parity vertex (edge) connection colouring is defined as a vertex (edge) colouring of a graph such that between every pair of distinct vertices, there exists a path having an odd number of occurrences of some colour on its vertices (edges). In comparison, in parity vertex (edge) colourings every path has this property. The conflict-free versions are defined analogously. The vertex variants were studied by Li et al.  and Li and Wu . The edge variants were studied by Czap et al.  and Chang et al. .

Note that every parity vertex colouring is a parity vertex connection colouring but the converse is not generally true. But in a tree, there is only one path between each pair of vertices so these colourings are the same. The similar property clearly holds for the conflict-free and the edge versions of these colourings as well.

## Our work and comparison to known results

In the first section we determine the parity vertex chromatic number of cycles and we show that the parity vertex chromatic number is not monotone under the minor relation.

In the second and third section we focus on binary trees. Thus all the results in this section also hold for the parity vertex connection colouring. We improve the lower bound of Cheilaris et al.  on the parity vertex chromatic number of subdivisions of complete binary trees. Let be the complete binary tree with layers and let be obtained from by replacing edges with paths. They proved that . We show that . Next, we use this bound to obtain a new bound where is an arbitrary binary tree on vertices. Note that these lower bounds are also lower bounds on the conflict-free chromatic number.

For comparison, let us discuss the known upper bounds on the parity vertex chromatic number of trees. It is easy to see that for every tree we can always find a vertex whose removal leaves parts of at most half the size. Thus, we can colour this vertex by a unique colour and colour the remaining parts recursively. This approach yields the bound where is a tree on vertices; see  for details. Thus, because every unique-maximum colouring is also a parity vertex colouring. There are better bounds known for some other type of trees. In particular, Gregor and Škrekovski  showed that for a binomial tree it holds that . Since has vertices, it follows that , where is the number of vertices of . Cheilaris et al.  showed a similar bound for complete binary trees. Thus even for complete binary trees and binomial trees, there is still almost a quadratic gap between the best lower and the best upper bound on the parity vertex chromatic number.

In the fourth section we study complexity of computing the parity vertex chromatic number. We start with applying the ideas of Cheilaris and Tóth  to prove that the problem of checking whether a given colouring is a parity vertex colouring is coNP-complete. Next we use Courcelle’s meta-theorem to show that computing the parity vertex chromatic number of a graphs with bounded treewidth can be done in linear time with respect to the size of the graph when we consider the number of colours to be constant.

## Prerequisites

Throughout the paper we consider all graphs to be finite, undirected and simple. The sets of vertices and edges of a graph are , respectively. Vertex colouring of a graph is a function . denotes the complete binary tree with layers. We now define useful tools to work with the parity vertex colouring.

###### Definition 2.

Let be a graph, be a vertex colouring of with colours and be a subset of vertices of . A

parity vector

of , denoted by , is an element of where the -th coordinate equals the parity of the number of vertices in coloured by .

A non-empty path in is called a parity path if is the zero parity vector.

Note that every parity path has odd length (even number of vertices). Also, a vertex colouring is a parity vertex colouring if it does not contain any parity path. We are working mainly with the parity vertex colourings. Thus, for brevity, by a properly coloured tree we mean a tree coloured by a parity vertex colouring unless it is said otherwise.

## 1 Cycles and non-monotone properties under minors

Cheilaris et al.  determined the parity vertex chromatic number of paths.

###### Lemma 3 ([3, 7]).

For every , .

We extend the proof to determine the parity vertex chromatic number of cycles.

For every , .

###### Proof.

To see the upper bound, we colour consecutive vertices on the cycle optimally as on a path (by Lemma 3), and we colour the remaining vertex by a new colour. This colouring uses exactly colours. By integrality this is equal to .

To prove the lower bound, consider any parity vertex colouring of using colours. Denote the vertices of the cycle in the order of traversal by . For every , denote the subpath on the first vertices by . Next, for every , denote by , the subpath on vertices . Observe that all subpaths are different and that the symmetric difference of any two of them (i.e. we consider only vertices contained in exactly one of them) is also a subpath of the cycle. Thus, parity vectors of all paths must be different and non-zero, otherwise there would exist a parity path in . Hence . Therefore . ∎

The parity vertex chromatic number is monotone with respect to subgraphs because the set of all paths in a subgraph is a subset of the set of all paths in the original graph. We show that it is not monotone with respect to minors by providing a counter-example. Recall that is the complete binary tree with layers.

.

###### Proof.

The parity chromatic number of is at least because contains as a subgraph. And since there exists a parity vertex colouring with 3 colours, as you can see on Figure 1, we have . ∎ Figure 1: A parity vertex colouring of B4 with three colours.

We denote the graph consisting of two copies of with their roots connected by . We refer to these two rooted subtrees as the first and the second main subtree of , see Figure 2.

###### Proof.

First of all, there exists a proper colouring with 4 colours, as you can see on Figure 2. And since the tree contains as a subgraph, it is sufficient to prove that there is no parity vertex colouring with 3 colours.

Suppose that a parity vertex colouring with colours exists. At first assume that in both main subtrees there exists a leaf that has a different colour than the root of the respective subtree. In both subtrees the vertex between the respective root and the leaf has a different colour than both of them. Thus in both subtrees there exists a path starting in the root and using every colour once. But this contradicts our assumption because the roots are connected. Thus there exists a parity path, a contradiction.

Now assume that one of the main subtrees, without a loss of generality the first one, has the root and all its leaves coloured with one colour. The only possibility to properly complete the parity vertex colouring of this subtree is to colour the two remaining vertices with one of the remaining colours; each with a different one. No matter what colour the root of the second subtree has, there always exists a parity path starting in this root and ending in the first subtree. Therefore our assumption was false and there is no proper colouring using 3 colours. ∎ Figure 2: A parity vertex colouring of T3,3 with four colours.
###### Theorem 7.

The parity vertex chromatic number is not monotone with respect to minors.

###### Proof.

Observe that is a minor of (it suffices to contract one of the edges incident to the root of ). By Lemma 5, and by Lemma 6, . Therefore, a minor of has greater parity vertex chromatic number than . Since there obviously exist graphs whose minors have lower parity vertex chromatic numbers, this means that the parity vertex chromatic number is not monotone with respect to minors. ∎

## 2 Lower bound for subdivisions of complete binary trees

In this section we improve the lower bound of Cheilaris et al.  on the parity vertex chromatic number of subdivisions of complete binary trees. Recall that by properly coloured we mean coloured by a parity vertex colouring. Say a vertex is branched if it has at least two sons.

###### Definition 8.

A graph is a subdivision of a graph if is obtained from by replacing some edges with paths. The original vertices of are called the main vertices of .

###### Definition 9.

Let be a properly coloured rooted binary tree such that every branched vertex, every leaf and the root of is coloured by a same colour . We call the tree nicely coloured, we call the vertices of coloured by nicely coloured vertices and we call the nice colour of .

Cheilaris et al.  noticed that in a nicely coloured tree the parity vectors of paths connecting nicely coloured vertices with the root are distinct. Then, they found a large nicely coloured tree in every properly coloured subdivision of and showed that .

We generalize this idea by considering a wider class of trees to show that .

###### Definition 10.

Let be disjoint nicely coloured trees each rooted in . Let us connect their roots by new edges into a path . We root the resulting tree in and denote it by . If the colouring of (defined by the colourings of trees ) is a parity vertex colouring, then we call a safflower of trees , we refer to the the path as a stem of the safflower and we refer to the trees as original trees of the safflower .

Additionally, we call all nicely coloured vertices of the original trees nicely coloured vertices of the safflower and we denote the number of nicely coloured vertices of as .

Note that nice colours of original trees of a safflower can be distinct. For example, a path coloured by a parity vertex colouring is a safflower of trees where consist of just . Its stem is the whole path.

When we take two safflowers of trees and of trees , then we can connect the root of and the root of by a new edge. And we obtain a safflower of trees if the colouring of the new graph is still a parity vertex colouring. Another example of a safflower is on Figure 3. Figure 3: An example of a safflower of trees T1,…,T5. Edges of the stem of the safflower are dashed. Nicely coloured vertices of the safflower are circles, other vertices are disks.

The two following lemmas prove that every safflower uses a lot of colours.

###### Lemma 11.

Let be a safflower with a root . And let be paths from to arbitrary nicely coloured vertices of , respectively. Denote the last common vertex of and by . Then at least one of the vertices has the same colour as the vertex .

###### Proof.

The vertex is a nicely coloured vertex of some original tree of (because it is either endpoint of one of the paths , or it is a branched vertex of ). Either lies on the stem of or not. If it does not lie on the stem of , then both paths continue into the tree , and they have to end there. Since their ends are nicely coloured in , they are also nicely coloured in and so they both have the same colour as .

If lies on the stem, then at most one of the paths continue along the stem (otherwise would not be the last common vertex). So the other path has to stay in , and by the same argument as before, its endvertex has the same colour as . ∎

###### Lemma 12.

For every safflower coloured by colours, it holds that .

###### Proof.

Assume is coloured by colours and let be the set of all subpaths of from the root of to all nicely coloured vertices of . Clearly . If , then has at least one vertex, so the lemma holds. Thus assume that .

Suppose that two distinct paths from have the same parity vector. Let be the last common vertex of . Then the symmetric difference of and together with the vertex compose a subpath (denote it by ) of length at least 1 in . Thus . By Lemma 11 at least one endvertex of has the same colour as . Therefore, the path obtained from by deleting  is a parity path (note that it is not an empty path). This is a contradiction, and so every path in has a distinct parity vector.

Furthermore, none of the paths in can have the zero parity vector. Thus, . ∎

Whenever we prove that every parity vertex colouring of some graph contains a safflower with some number of nicely coloured vertices as a subgraph, this lemma gives a lower bound on the parity vertex chromatic number of the graph. Since a path can be seen as a safflower that has only nicely coloured vertices, Lemma 12 generalize Lemma 3.

We show how to find a safflower with a lot of nicely coloured vertices in every subdivision of a complete binary tree coloured by a parity vertex colouring. We first find a nicely coloured subtrees in every properly coloured rooted binary tree. And then we inductively find a safflower of some of these nicely coloured subtrees. And finally we show that this safflower subgraph of subdivisions has a lot of nicely coloured vertices such that Lemma 12 gives the desired bound.

Recall that for a rooted tree and its vertex we denote by the rooted subtree of with the root and containing exactly all the descendants of and itself. To be able to inductively construct subtrees (we want to inductively find a safflower), we need to define compatible subtrees.

###### Definition 13.

Let and be rooted trees. We say that is a compatible subtree of if is a subtree of and the root of is the closest vertex of to the root of . That is, can be embedded in with the same descendancy relation.

Compatible subtree notation is useful for recursive definitions. Say is a vertex in a rooted binary tree , with sons . Let be compatible subtrees of , respectively. Then we can connect the roots of with by paths in to obtain a compatible subtree of consisting of and (and the paths joining them).

We now find some compatible nicely coloured trees in every properly coloured rooted binary tree. We will afterwards used them in finding safflowers.

###### Definition 14.

Let be a rooted binary tree properly coloured by colours in . For every , there exists a compatible nicely coloured subtree of with nice colour that contains the maximal number of nicely coloured vertices (if there exists more such trees, pick one). We denote this subtree of as , and for brevity we denote the number of its nicely coloured vertices by (thus ). Figure 4: An example of a rooted properly coloured binary tree and its maximal nicely coloured compatible subtrees.

See Figure 4 for an example. The maximality of this nicely coloured subtrees yields the following property.

###### Lemma 15.

Let be a rooted binary tree properly coloured by colours in . Let be its vertex with sons and let be the colour of . Then .

###### Proof.

By maximality of the graph contains and the maximal nicely coloured subtrees of , that has nicely coloured vertices by their maximality. ∎

Now we find a specific safflower subgraph in every properly coloured rooted binary tree.

###### Definition 16.

Let be a rooted binary tree properly coloured by colours in . Let be the root of and let be the colour of . We define by induction a subgraph of rooted in , that forms a safflower of some trees.

1. If has only one vertex . Then (thus it consist of one vertex , ant it is a safflower of the tree ).

2. If has just one son . Then is a properly coloured rooted binary tree. By induction is a subgraph of that forms a safflower of some trees (and is the root of this safflower and of the tree ). Let be a nicely coloured tree consisting of just . We connect with by an edge to obtain a safflower of trees and we set this subgraph as .

3. If has two sons. Let us name them by such that (if , we choose the names arbitrarily). Denote as the nicely coloured compatible subtree of rooted in and consisting of , and the path connecting with the root of (It is well defined, because is a compatible subtree of , and thus of as well). Just like in the previous case, we connect with by the edge joining their roots and to obtain a safflower of the tree and the original trees of . And we set this subgraph to be .

We call the subgraph a main safflower subgraph of .

It is clear that the recursive definition is correct and that the main safflower subgraph of is always a safflower with a stem starting in the root of and ending in some leaf of . An example of a main safflower subgraph is in Figure 5. Figure 5: An example of a rooted properly coloured binary tree and its main safflower subgraph (the dashed subgraph), that forms a safflower of trees T1,T2,T3,T4.

It remains to show that the main safflower subgraph of a subdivision of a complete binary tree has lots of nicely coloured vertices. We do it terms of the two following subsequent lemmas.

###### Lemma 17.

Let be a rooted binary tree properly coloured by colours in , be some vertex of the stem of that is either a leaf or it is branched in . Let be the original tree of rooted in . Additionally, let be the colour of . Then .

###### Proof.

If is a leaf than as well as consist of just the vertex . Thus and the lemma holds.

Otherwise, is branched. Thus it has two sons. Let be the son of that is not a part of the stem of and be the other son of (thus it is a part of the stem of ). By Definition 16, they exist, it hold that and consists of the tree , the vertex and the path connecting them. Since is coloured by , by Lemma 15, it holds that and similarly . Therefore,

 2⋅Num(G)=2(gc(Ts)+1)≥gc(Ts)+gc(Tt)+2=gc(Tv)+1

and the proof is finished. ∎

###### Lemma 18.

Let and be a subdivision of properly coloured by colours in . Then has at least nicely coloured vertices where for some non-negative integers .

###### Proof.

Let be a root of . Let be the stem of . It starts in and ends in some leaf of . Thus it contains main vertices of . Let us name them in the order from the leaf as . For every let be the number of vertices in that has the same colour as (thus, is always at least 1). For every let be the subset of all vertices that have the colour . Clearly . Recall that every is a root of some original tree of (used in the Definition 16). Denote this original tree by . Thus if we show that , then

 Num(Saff(B∗))≥n∑i=1Num(Lmi) =k∑i=1∑v∈KiNum(Lv)≥ ≥k∑i=1∑v∈Ki2c(v)−1=k∑i=1|Ki|∑j=12j−1

where the last equality holds because for every the set is equal to the set by the definition of .

And that is exactly what we want to prove. Therefore, it remains to prove that . Let us use the notation for the subgraph of that is rooted in and contains all descendants of . We know that is a main vertex of , so it is a leaf or a branched vertex. Hence, by lemma 17 we know that where is the colour of . Thus, it suffices to prove that .

We will prove it by the induction on the values of . The tree always contains at least the vertex , because is the colour of . Thus it holds for .

If , then is a main vertex of that is not a leaf. Thus it has two sons . Let be the son that is a part of the stem of . By the Definition 16, . Since is the colour of , by Lemma 15, it holds that . Additionally, contains some main vertex for some ( is under ) that has the same colour as the vertex and that satisfies . By the induction hypothesis, . The tree is a compatible subtree of and thus . Combining this together we see that

 gc(Tmi)=1+gc(Ts)+gc(Tt) ≥2gc(Tt)+1≥2gc(Tmj)+1≥ ≥2⋅(2c(mi)−1−1)+1=2c(mi)−1.

And the lemma holds.

We are almost done, the last thing we need is a technical lemma that simplifies the bound given by Lemma 18 and 12.

###### Lemma 19.

For every , and non-negative integers , satisfying and it holds that .

###### Proof.

For it holds trivially. We first use some algebraic modifications and Jensen inequality,

 k∑i=1ai−1∑j=0(2j)=k∑i=1(2ai−1)=k∑i=1(2ai)−k≥k⋅21k∑ki=1ai−k=k⋅2nk−k.

Thus, we know that . Since we see that , or equivalently , which proves the first part. Next, we rewrite the inequality to the form . We bound on the left side by , and on the right side by to obtain . By taking logarithm of this inequality and multiplying by we obtain quadratic inequality . By solving this standard quadratic inequality in positive we obtain

 k≥−1+12log2(n)+√(−1+12log2(n))2+4n2≥√n+14log2(n)−12,

which proves the second part.

We have everything ready to prove the main theorem.

###### Theorem 20.

For every and every subdivision of it holds that .

###### Proof.

Consider any proper colouring of with colours in . By Lemma 18, contains a safflower with at least nicely coloured vertices as a subgraph (the safflower ), where for some non-negative integers . Therefore by Lemma 12 it holds that . Thus by Lemma 19 this safflower, and consequently as well, uses at least colours. ∎

## 3 Lower bound on the parity chromatic number of binary trees

In this section we prove the following theorem.

###### Theorem 21.

For every binary tree on vertices, .

We show that every binary tree either contains a long path or it contains a subdivision of a large complete binary tree. For this purpose, we estimate the maximum number of vertices a binary tree can have when it has a bounded number of layers and does not contain certain subdivisions.

###### Definition 22.

For integers let be the maximal number such that there exists a rooted binary tree on vertices with at most layers and not containing a subdivision of as a compatible subgraph.

We first determine value of in edge cases and than show that it can be computed by simple recursion.

###### Claim 23.

For every it holds that . For every it holds that .

###### Proof.

A subdivision of is a single vertex, so any tree not containing a subdivision of as a compatible subgraph must be empty.

A binary tree with at most layers can have at most vertices. The complete binary tree with layers has this number of vertices and does not contain a subdivision of for . ∎

###### Lemma 24.

For every it holds that .

###### Proof.

Let be a binary tree with at most layers that does not contain a subdivision of as a compatible subgraph. Let be its root. Both child subtrees of , let us denote them by , have at most layers. They cannot both contain a subdivision of as a compatible subgraph. Otherwise it would be possible to connect their roots through to compose a subdivision of  as a compatible subgraph of . Thus, without a loss of generality, and does not contain a subdivision of and , respectively, as a compatible subgraph. Hence and . Therefore .

On the other hand, let and be trees with respectively and vertices, at most layers and not containing respectively and as compatible subgraphs. When we connect their roots by a new vertex, we obtain a new tree with at most layers that does not contain as a compatible subgraph. Hence . ∎

This recursion has an explicit solution.

###### Lemma 25.

For every integers and such that it holds that

###### Proof.

We prove it by induction on both and . First assume that . In this case we need to prove that . This is true by Claim 23.

Now assume that . We need to prove that . We use induction on to do it. For we need to prove that . This holds because by Lemma 24, we get . And by Claim 23. For we use Lemma 24, the induction hypothesis, and Claim 23 to obtain

 A(l,l−1) =A(l−1,l−1)+A(l−1,l−2)+1 =2l−1−1+l−2∑i=0(2i−1)+(l−1)−1+1=l−1∑i=0(2i−1)+l−1.

Finally, assume that . By the induction hypothesis and Lemma 24 we see that

 A(l,d) =A(l−1,d)+A(l−1,d−1)+1 =d∑i=0[(2i−1)⋅(l−i−2l−d−2)]+(l−1d)−1+ d−1∑i=0[(2i−1)⋅(l−i−2)l−d−1]+(l−1d−1)−1+1 =d−1∑i=0[(2i−1)⋅((l−i−2l−d−1)+(l−i−2l−d−2))]+(2d−1)+(ld)−1 =d∑i=0[(2i−1)⋅(l−i−1l−d−1)]+(ld)−1.

The formula provided by Lemma 25 does not have a simple form. Instead, we provide a simple upper bound.

###### Lemma 26.

For it holds that .

###### Proof.

The case when easily follows from Claim 23. Now assume that . We apply Lemma 25. In case we see that . In case we get . In case and we get

 A(l,2) =2∑i=0[(2i−1)⋅(l−i−1l−2−1)]+(l2)−1=(l−2l−3)+(l2)+2

where we used . In case we get

 A(l,d) =d∑i=0[(2i−1)⋅(l−i−1l−d−1)]+(ld)−1 ≤(2d−1)⋅d∑i=0(l−i−1l−d−1)+(ld)−1 =(2d−1)⋅(ll−d)+(ld)−1=(2d)⋅(ld)−1

In the last step we used inequality , which clearly holds for . In the second step we used the following well known Hockey-stick identity.

###### Proposition 1 ((Hockey-stick identity)).

For every it holds that

 n∑i=r(ir)=(n+1r+1).

Now we are finally ready to prove Theorem 21.

###### Proof of Theorem 21.

Let and be an arbitrary binary tree on vertices and let . Root the tree in an arbitrary vertex. Lemma 3 implies that does not contain a path on vertices as a subgraph. Thus has at most layers. Theorem 20 implies that does not contain a subdivision of as a subgraph, thus particularly not as a compatible subgraph. Hence . By Lemma 26 we see that . Therefore . ∎

## 4 FPT of computing χp(G) and coNP-completeness of deciding whether a colouring is a parity vertex colouring

There have been so far no discussion of the computational complexity of the parity vertex chromatic number. On the other hand, the complexity of computing the unique maximum chromatic number of graphs is far more explored (see e.g. ). Unfortunately, from complexity point of view this colouring is quite different from the parity vertex colouring.

Bodlaender et al.  proved that deciding whether there exists a unique maximum colouring with less than colour is NP-complete. Thus, there exists a polynomial time algorithm deciding if a given colouring is a unique maximum colouring. Cheilaris and Tóth  showed that the same problem for the conflict-free colouring is coNP-complete. We use a slight variation of their proof to show the same fact about the parity vertex colouring.

###### Theorem 27.

Given a graph and its colouring, it is coNP-complete to decide whether the colouring is a parity vertex colouring.

###### Proof.

We need to prove that the problem is coNP-hard and that it lies in coNP. In other words we have to prove that this problem is at least as hard as any problem in coNP, and that given an appropriate certificate we can verify in polynomial time that an instance of this problem is not properly coloured. We start with the first part.

We show that the complement of the Hamiltonian path problem can be reduced to our problem. That is, given a graph we construct in polynomial time a graph with colouring of its vertices such that has no Hamiltonian path if and only if is proper.

Let be the vertex set of . We define to consist of two isomorphic copies and of with vertex sets and , respectively. Additionally, contains for every pair of vertices a path where are new vertices. We now define the colouring . For every we set and for every we set . Observe that every colour is used exactly twice and that inner vertices of every are coloured with distinct colours. Furthermore, every two distinct paths use the same colour on exactly one pair of inner vertices, namely and .

Let contain some Hamiltonian path, say . It follows that also contains a Hamiltonian path obtained from by replacing every vertex by the path or its reverse in a way that the consecutive paths can be connected by an edge of or (so the end of the first path and the start of the second path lies in the same copy of ). Since every colour in is used exactly twice, it follows that this path is a parity path and so the colouring is not proper.

On the other hand, let not be a proper parity colouring and let be a parity path of . We show that and consequently contains a Hamiltonian path. Since is a parity path, every colour is used even number of times on . Since every colour is used exactly twice in , it follows that every colour is used twice or zero times on . Recall that inner vertices of every path have different colours. Thus must contain some vertex of or , say . Vertex  is the only other vertex using the same colour as . Hence contains both and . Therefore it must contain an entire for some (subgraphs are connected only by these paths). Since exactly one colour of every other is used also on , it follows that contains vertices from all . Therefore also contains all vertices of both , .

Assume, for now, that is not Hamiltonian. Observe that if it does not contain all vertices of some , then one of its end vertices must be on that path. Thus contains all paths , except for at most two exceptions , . Suppose that it does not contain two different vertices of , say , . At least one of indices , is different from , say . Hence contains the entire and consequently also . Therefore it must contain also , a contradiction. We can use the same argumentation for , and so it follows that does not contain at most one vertex of and at most one vertex of . It easily follows that we can extend by these vertices and obtain a Hamiltonian path.

So there always exists a Hamiltonian path in , say the path . Observe that in every Hamiltonian path of with end vertices in , paths are part of the Hamiltonian path. So in this case we would obtain a Hamiltonian path in the graph by contracting paths . We now show that we can modify to find such Hamiltonian path in . If the end vertices of are adjacent we obtained a Hamiltonian cycle. Thus we can split it in between some pair of vertices , and consequently find a Hamiltonian path in . Otherwise, let be end vertices of . The vertex must be adjacent to some vertex of , say (otherwise one of its neighbours would not be on the Hamiltonian path). So the Hamiltonian path looks like this . We can reconnect it to obtain a Hamiltonian path . In a similar way we can reconnect and its neighbour to obtain a Hamiltonian path with end vertices in , and consequently a Hamiltonian path in .

It remains to prove that the problem is in coNP. If the given certificate is a parity path, then we can easily verify in linear time that this path really contains every colour even number of times.

This result suggests that computing the precise parity vertex chromatic number of a given graph is hard. We show that for graphs with bounded treewidth the problem is efficiently solvable if we consider the number of colours to be constant. We denote the treewidth of by .

We use the following well-known theorem.

###### Theorem 28 ((Courcelle’s theorem )).

Let be a CMSO2 sentence and be a graph given with its tree decomposition. There exists an algorithm deciding whether (that is, has a property ) in time where is the size of , is the treewidth of and is some computable function.

Notice that we use the variant with the counting monadic second order logic (CMSO2.). This logic has a non-standard predicate checking if the cardinality of a set is even.

By constructing CMSO2 sentence deciding the problem and applying Courcelle’s theorem we obtain the following theorem.

###### Theorem 29.

For a constant and a graph with bounded treewidth, the problem of deciding whether the graph has a parity vertex colouring with colours is solvable in linear time with respect to the size of .

###### Proof.

As we said we use Courcelle’s theorem. Note that the requirement of a tree decomposition is not a problem because the problem of finding a tree decomposition of an input graph is known to be fixed-parameter tractable with respect to the treewidth of the input graph (concretely, it can be found in time . See  for details). Therefore, it is sufficient to construct a CMSO2 sentence with size dependent only on deciding the problem. We use variable for the set of vertices and for set of edges of the input graph.

We will construct this sentence according to the following simple observation. There exists a proper colouring with colours if and only if we can partition vertices into sets according to their colours such that for every path in at least one of the partition sets has odd number of vertices in common with the path.

This can be directly rewritten as a CMSO2 sentence

 ParityColorablek=∃X1,X2,…,Xk⊆V[Partition(X1,…,Xk)∧∀Y⊆VPath(Y