All trees are six-cordial

For any integer $k>0$, a tree $T$ is $k$-cordial if there exists a labeling of the vertices of $T$ by $\mathbb{Z}_k$, inducing a labeling on the edges with edge-weights found by summing the labels on vertices incident to a given edge modulo $k$ so that each label appears on at most one more vertex than any other and each edge-weight appears on at most one more edge than any other. We prove that all trees are six-cordial by an adjustment of the test proposed by Hovey (1991) to show all trees are $k$-cordial.


Introduction
All graphs will be finite and simple. For basic graph theoretic notation and definitions, we refer the reader to D. West [9]. For a survey of graph labeling problems and results, see Gallian [3].
For any tree T and any integer k > 0, a k-cordial labeling of T is a function f : V (T ) → Z k inducing an edge-weighting also denoted by f , defined by f (uv) = f (u) + f (v) (mod k) for any edge (uv) of T , which satisfy the following conditions: (i) Each label appears on at most one more vertex than any other label. (ii) Each weight appears on at most one more edge than any other edge-weight. In other words, if for any a ∈ Z k we define v a and e a as the number of vertices and edges, respectively, which are labeled a, then the above conditions can be rewritten as (i) |v a − v b | ≤ 1 for any distinct a, b ∈ Z k (ii) |e a − e b | ≤ 1 for any distinct a, b ∈ Z k Cahit [1] was the first to define 2-cordial labelings (which he called cordial) as a simplification of graceful and harmonious labelings. Motivated by the Graceful Tree Conjecture of Rosa [8] and the Harmonious Tree Conjecture (HTC) of Graham and Sloane [5], he showed that all trees are 2-cordial. The extension of the definition to groups is due to Hovey [6] who also showed that all trees are 3, 4, and 5-cordial. Hovey conjectured that trees are k-cordial for all k and that all graphs are 3-cordial. In the last twenty-five years there has been little progress towards a solution to either conjecture. However, Cichacz, Görlich, and Tuza [2] extended this problem to hypergraphs while Pechenik and Wise [7] considered the existence of cordial labelings for the smallest non-cyclic group V 4 .
It should be noted that a solution to Hovey's first conjecture implies the HTC.

Definitions and Facts
The following two simple properties can be found in [5].
Lemma 2.2. For any k > 0, if f is k-cordial labeling of a graph G, then −f is a k-cordial labeling of G.

Definition 2.3.
A caterpillar is a tree T such that for a maximum path P , all vertices are of distance at most one from P .
The next result can be found in [6].
The proof of the above theorem is obtained by the sequential labeling of Grace [4]. We include its description since we use variants of this labeling throughout the paper.

Algorithm 2.5. k-cordial labelings of caterpillars
Given a caterpillar T , draw T as a planar bigraph with partite sets A and B. Choose any nonnegative integer ℓ and label the vertices of A sequentially by ℓ, . . . , ℓ + |A|, starting at the top (bottom). Next label the vertices of B sequentially by ℓ + |A| + 1, . . . , ℓ + |A| + |B| starting at the top (bottom). Reduce all labels modulo k to obtain a k-cordial labeling.
The following is consequence of Grace's algorithm: Proposition 2.6. If T is a rooted caterpillar with k vertices (not counting the root) for some positive integer k, longest path P , and root r at distance 1 from an endpoint of P , then T is k-cordial with every weight appearing exactly once.
Proof. We label the vertices of T by drawing the caterpillar as a bipartite graph and applying Grace's algorithm begining by labeling the root 0. Since the root is either the first or last vertex of its part, proceed in Grace's algorithm by labeling the rest of the vertices in the part sequentially. The only repeated label will be zero on the final vertex in the part not containing the root. Since the labeling is sequential, all weights are represented. The following fact can be easily verified.
Proposition 2.7. Every tree on at most six vertices is a caterpillar.
Hovey [6] defined A-cordiality of rooted forests for any abelian group A and studied the particular case when A is cyclic. In all but one instance, we apply his definition for the special case when the rooted forest is a rooted tree. Note that in the following definition, the root set is not considered a subset of the vertex set of the rooted forest. Thus, a rooted forest F of order k has k vertices and a set of roots R that are not the vertices of F and where the size of R is the same as the number of components of F . Definition 2.8. For any integer k > 0, a rooted forest F with vertex set V , edge set E, and root set R is k-cordial if for every labeling g : R → Z k and every ℓ ∈ Z k , there is a function f : Theorem 2.9 (Hovey [6]). For any k > 0, if all trees and rooted forests with k vertices are k-cordial, then all trees are k-cordial.
Proof. Attaching a leaf to a tree with mk + j vertices allows for k − j labels on the pendant vertex and forbids j − 1 weights on the pendant edge, when j > 0. Such a labeling exists whenever k − j > j − 1. When j = 0 any label is allowed and there is a choice for a weight.
Definition 2.11. For any tree T we say T is split at roots v 1 , . . . , v m if T can be written as a union of a tree T 0 and rooted trees T 1 , . . . , T m , for some positive integer m, with roots v 1 , . . . , v m , so that for any distinct Figure 2. Splitting a Tree Note that when splitting a tree, one has the choice of placing branches starting at the root, in T 0 or in a rooted tree.
Let T be a tree on at least 5 vertices and let P = {v 0 , v 1 , . . . , v p } be a longest path in T . We attempt to split T at v i for i = 1, 2, 3, 4, 5.
Notice that if T cannot be split to a rooted tree with 5 vertices, then for some i, 1 ≤ i ≤ 4, there is a split at v i that produces a rooted tree that has less than 5 vertices, and every split at v i+1 produces a rooted tree with more than 5 vertices. We call such a pair of vertices with indices (i, i + 1) critical, such a split at v i deficient and such a split at v i+1 excessive.
We only need consider critical pairs of vertices with indices (2, 3), (3,4), and (4,5). For the (2, 3) critical pair, it is easy to see that one can produce the rooted trees T ′′ and T ′′′ by splitting at v 2 . For the (3,4) critical pair, we can produce T iv and T v by splitting at v 3 . For the (4, 5) critical pair, one can produce rooted forest F ′ by splitting at v 4 . Proposition 2.13. Every tree on at least 6 vertices can be split into a tree and either (i) a rooted tree with six vertices (ii) the rooted tree taken from Proof. The argument is similar to that in Proposition 2.12. Let P = {v 0 , . . . , v p } be a longest path of T and consider critical pairs with indices (2, 3), (3,4), (4,5), and (5, 6). There can be no critical pair with indices (2, 3). Critical pairs with indices (3, 4) produce either T ′ , F 2 , F 3 , or F 4 when splitting at v 3 . Critical pairs with indices (4, 5) produce F, T ′ 2 , T ′ 3 , or T ′ 4 when splitting the tree at v 4 . Critical pairs with indices (5, 6) produce F when splitting the tree at v 5 .

Six-Cordial Trees
Theorem 2.9 implies that for any integer k > 0, if all trees and rooted forests with k vertices are k-cordial, then all trees are k-cordial. This yields a method to check if trees are k-cordial for any integer k. We shorten and simplify this test for the case k = 6.
Theorem 3.1. Every tree is 6-cordial Proof. We induct on the order of any tree T . If |T | ≤ 6, then by Proposition 2.7 and Theorem 2.4, T is 6-cordial. Next suppose all trees on 6(m − 1) vertices are 6-cordial. By Lemma 2.10 it is enough to show that all trees on 6(m − 1) + 5 vertices and all trees on 6m vertices are 6-cordial. Let T be a tree on 6m vertices. We apply Proposition 2.13 and consider case (i). That is, suppose T splits into a tree T 0 on 6(m − 1) vertices and a rooted tree T 1 with root v, on six vertices. We consider the degrees of v in T 0 .
If deg(v) = 1, we can apply Lemma 2.1 to "rotate" the labels of T 0 so that the root vertex takes the label 0. If w is the minority weight of T 0 , we label the caterpillar T 1 by Grace's algorithm with the root neighbor labeled w.
If deg(v) = 2, we apply Proposition 2.6 and notice that we only need to show the following rooted trees 6-cordial: If deg(v) = 3, we apply Proposition 2.6 and notice that we only need to show the following rooted trees 6-cordial: g.
If deg(v) = 4, 5, 6, we apply Proposition 2.6 and notice that we only need to show the following rooted tree 6-cordial: h.
For the representations of the rooted trees a through h above, we define the level ℓ 0 as the root. For any i > 0, the level ℓ i is defined to be those vertices of distance i from the root, ordered from left to right as in the representation above. Using this notation, we provide a 6-cordial labeling for each rooted tree, so that either every weight appears once or for every weight there is a labeling of each rooted tree with that weight serving as a majority weight. For each case above, our labeling will be on vertices starting with the root and continuing to subsequent levels, from left to right. We end each labeling by listing which weight is in the majority. These labeling can be found in List 1 at the end of the proof.
Suppose T splits into T 0 on 6(m − 1) vertices and one of the above rooted trees T 1 . By induction, we can label T 0 6-cordially with some minority weight w. However, we have shown that no matter the value of w, we can make w a majority weight of T 1 or there is a labeling of T 1 with no majority weight. Pasting T back together with this labeling produces a 6-cordial labeling of T .
Next, we consider case (ii) of Proposition 2.13. We label the rooted trees T ′ , T ′ 2 , T ′ 3 , T ′ 4 so that no label or weight appears more than once, and for every label there is a labeling with that label not present. These labelings can be found in List 2 at the end of the proof.
Since T 0 is of order 6m+1, we can label it 6-cordially by the induction hypothesis and Hovey's lemma. This means that no weight on T 0 is in the minority and one label is in the majority. For the minority label in one of the cordial labelings of the rooted tree T ′ , we choose the majority label of T 0 . Pasting T back together produces a 6-cordial labeling of T .
We now consider case (iii) of Proposition 2.13. We label the rooted forests F, F 2 , F 3 , F 4 so that zero appears on the left root and consider all other possible labels on the other root. These labelings can be found in List 3 at the end of the proof.
For trees on 6(m − 1) + 5 vertices, we can use many of the previous labelings on trees with 6m vertices. We argue as in the case of 6m vertices.
Let T be a tree on 6(m − 1) + 5 vertices. We apply Proposition 2.12 and consider case (i). That is, suppose T splits into a tree T 0 on 6(m − 1) vertices and a rooted tree T 1 with root v, on five vertices. We consider the degrees of v in T 0 .
If deg(v) = 1, we can apply Lemma 2.1 to "rotate" the labels of T 0 so that the root vertex takes the label 0. If w is the minority weight of T 0 , we label the caterpillar T 1 by Grace's algorithm with the root neighbor labeled w.
If deg(v) = 2, we consider the following trees: i. j. k.
If deg(v) = 3, we consider the next two trees: If deg(v) = 4 we only need to consider the following tree: q.
If deg(v) = 5 we have the following tree: r.
To show 6-cordial labelings we argue, whenever possible, that the rooted trees above are rooted subgraphs of rooted trees on 6 vertices for which we have already shown labelings in which each weight appeared in the majority. In this case, if T splits into T 0 and such a rooted tree T 1 , then T 0 can be labeled 6-cordially with some minority weight w. We have shown that we can make w a majority weight in a rooted tree T r on six vertices containing T 1 as a subgraph. When we remove the edge e of T r to make it T 1 , notice that if the weight on e was w, then no weight appears in the majority in this labeling of T 1 . If the weight on e was not w, then this weight was not in the minority in T 0 . In either case, pasting T back together with this labeling produces a 6-cordial labeling of T .
For each of the above rooted trees, we describe how it is a rooted subtree of a rooted tree which we have labeled or produce a new labeling. When we provide new labelings, we produce two 6-cordial labelings with no repeated vertex label and one minority weight, which will be different in the two labelings. If a minority weight of T 0 is one of the two minority weights in the labelings of T 1 , then we use the other. If the minority weight of T 0 is neither of the two minority weights in the labelings of T 1 , we use either labeling. We follow the notation in the labelings of the previous cases. These descriptions can be found in List 4 at the end of the proof.
Next, we consider case (ii) of Proposition 2.12. We label the rooted trees T ′′ , T ′′′ , T iv , T v so that no label or weight appears more than once, and for every label there is a labeling with that label not present. These labelings can be found in List 5 at the end of the proof.
Since T 0 is of order 6m+1, we can label it 6-cordially by the induction hypothesis and Hovey's lemma. This means that no weight on T 0 is in the minority and one label is in the majority. For the minority label in one of the cordial labelings of the rooted tree T ′ , we choose the majority label of T 0 . Pasting T back together produces a 6-cordial labeling of T .