The Inter-magic Spectra of Trees

For any positive integer $h$, a graph $G=(V,E)$ is said to be $h$-magic if there exists a labeling $l:E(G)\to \mathbb{Z}_h -\{0\} $ such that the induced vertex set labeling $\ l^+ : V(G) \to \mathbb{Z}_h \ $ defined by $$ l^+ (v)=\sum_{uv \in E(G)} \ l(uv) $$ is a constant map. The integer-magic spectrum of a graph $G$, denoted by $IM(G)$, is the set of all $h \in \mathbb{N} $ for which $G$ is $h$-magic. So far, only the integer-magic spectra of trees of diameter at most five have been determined. In this paper, we determine the integer-magic spectra of trees of diameter six and higher.


Introduction
In this paper all graphs are connected, finite, simple, and undirected.For graph theory notations and terminology not described in this paper, we refer the readers to [1].Let G = (V, E) be a graph.For an abelian group A, written additively, any mapping l : E(G) → A − {0} is called a labeling.Given an edge labeling l, we can define a labeling of the vertices l + : V (G) → A such that l + (v) = uv∈E(G) l(uv); that is, l + (v) is the sum of the labels of all the edges incident with v.If there is a labeling l such that l + is constant, then we say G is an A-magic graph and we call l an A-magic labeling.If G is not A-magic for every abelian group A, then we say G is non-magic.On the other hand, if G is A-magic for every abelian group A, we say that G is fully magic.
For convenience and to follow convention, we will use the notation h-magic, where h > 1, to indicate Z h -magic.Similarly, if l is a Z h -magic labeling, we say l is an h-magic labeling.It is pertinent to mention that there is another definition of an h-magic graph [4]; this one is a different generalization of magic graphs and so it does not relate to the topics covered in this paper.Definition 1.1.For a graph G, let the integer-magic spectrum of G, denoted by IM (G), be the set of all integers h for which G is h-magic.
The integer-magic spectra of trees of diameter at most five have already been determined [3,5].In this paper, we generalize these previous results and characterize the integer-magic spectra of trees of arbitrary diameter.For a compilation of results regarding the integer-magic spectra of other families of graphs, we refer the reader to [2].
The term pendant vertex will refer to vertices with degree one.Similarly, the term pendant edge will refer to edges which are incident to pendant vertices.Note that a pendant vertex will have the same label as the pendant edge incident to it, so in order for l + to be constant, all pendent edges must have the same label.We will reserve the variable x for the label that every pendant edge must have.Consequently, for l to be an h-magic labeling, we need l + (v) ≡ x mod h for every vertex v.

Notation for Trees
To determine the integer-magic spectrum of any tree, we need to develop notation that applies to trees of any diameter.To achieve this, we use the fact that trees of even diameter have as a center a single vertex, and that trees of odd diameter have as a center the path P 2 .From now on, c will denote the vertex at the center of a tree of even diameter; similarly, c 1 and c 2 will denote the vertices at the center of a tree of odd diameter.Also, to simplify the statement of our theorems, we will use T n to refer to a tree of diameter n.
We start by describing vertices in terms of their distance from the center.
Definition 2.1.For a tree T 2k and an integer i ≥ 0, let Trees of diameter 2k + 1 have the added complication of having two vertices at the center.For the sake of having formal definitions, we need to distinguish those vertices that are closer to c 1 from those that are closer to c 2 .With this objective, we define the function δ : Definition 2.2.For a tree T 2k+1 and an integer i ≥ 0, let We are abusing notation by using D i for both even and odd diameter trees.However, for our purposes, their definitions are equivalent.In both cases, D i is the collection of vertices at distance i from the center.See Figure 2 for an example.
Note that for both 2k and 2k + 1 diameters, D d = ∅ if d > k; otherwise, the diameter would be bigger.Furthermore, if the tree has diameter 2k, then by definition there must be at least two pendant vertices that are distance k away from c; similarly, for T 2k+1 , c 1 and c 2 each must have at least one pendant vertex that is k away.Thus, for both odd and even diameters, if 1 ≤ i ≤ k, then |D i | ≥ 2. Additionally, even diameters have D 0 = {c}, and odd diameters have D 0 = {c 1 , c 2 }.Finally, we note that, for any n, if uv ∈ E(T n ) and u ∈ D m , then either v ∈ D m+1 or v ∈ D m−1 because u and v are adjacent, so the difference in their distance from the center is exactly one.
To discuss h-magic labelings for trees, we need a way to talk about the subgraph that "branches out" of a vertex.With this objective in mind, we define the branches of T n .To simplify the statement of these definitions, we will use the term P (u, v), where u, v ∈ V (T n ), to refer to the vertex set of the unique path in T n from u to v. Definition 2.3.For a tree T 2k and u ∈ V (T 2k ) \ {c}, let the branch of u, or B u , be the induced subgraph of T 2k with vertex set:  Informally, B u is the subgraph of T 2k that extends from u and outwards to the pendant vertices.We now make an equivalent definition for trees of odd diameter.Definition 2.4.For a tree of T 2k+1 and u ∈ V (T 2k+1 ) \ {c 1 , c 2 }, let the branch of u, or B u , be the induced subgraph of T 2k+1 with vertex set: Furthermore, let B c1 be the induced subgraph with vertex set: The definition of B c2 follows similarly.If v ∈ V (B u ) and v = u, then we say v extends from u.An important observation to make about these branches is that if uv ∈ E(T n ), with u ∈ D m and v ∈ D m+1 , then B v is a subgraph of B u since all the vertices that extend from v also extend from u.In general, the branch of any vertex that extends from u is a subgraph of B u .We now create a term that combines the objectives behind D m and B u .Definition 2.5.For a tree T n , a vertex u ∈ V (T n ) and an integer m ≥ 0, let Informally, D u m is the collection of vertices at distance i from the center that also extend from u.An important observation is that if u ∈ D m and u is not a pendant vertex, then all the vertices in D u m+1 are adjacent to u because they extend from u and are distance one away.On the other hand, if u is a pendant vertex, then it must be that D u m+1 = ∅ because nothing would be able to extend from u. Finally, if u ∈ D m , then D u m = {u} because all other vertices in V (B u ) must be further away from the center than u.Having the same notation for both even and odd diameter trees allows us to make reference to trees in general without having to specify the parity of its diameter; when the parity of the diameter of the tree is important, we will separate the cases.We now prove a result that makes no reference to h-magic labelings; it is a general fact about trees.A special case of the result will be extensively used in the next section.We finish the proof by showing that 1≤i≤α ).Since v is further away from the center than any of the vertices in D u p , the path from u to v must go through w i for some i.That is, v extends from w i , and so In the next section, we will use the special case of p = m + 1 since, as discussed before, D u m+1 consists of vertices adjacent to u.For convenience and future reference, we state it explicitly.
Corollary 2.1.For a tree T n , let u be a vertex in D m such that u is not a pendant vertex.If D u m+1 = {w 1 , w 2 , ..., w α }, then, for every d such that d > m + 1, 3 The Forced Labeling f In an h-magic labeling, every pendant edge is forced to have the same label.We will show that in trees this notion of a "forced" labeling extends beyond pendant edges.We start by showing a method for labeling edges that makes l + constant with the exception of the vertices at the center.The method will depend on the labeling assigned to the pendant edges, though it will not guarantee that the edge labeling does not include 0 in its range.
In Figure 4, we see such method applied.We can label the edges closer to the center according to the label of the edges further away in such a way that their common vertex gets the constant label.For instance, for v, the sum of the labels of the edges further away is −3x.Thus, the label of the edge closer to the center needs to be 4x so that l + (v) = −3x + 4x = x.By using the notation we developed in the previous section, we can define a function that calculates the number that multiplies the x for each edge.Definition 3.1.For a tree T 2k , define f : Furthermore, for a tree T 2k+1 , define f : As for c 1 c 2 , let The definition of f for odd diameter trees is more complicated because there is an extra edge at the center to consider.For edges other than that one, f is the same for even and odd diameters.
Note that, for even diameters, f cannot guarantee that l + (c) = x.A similar problem happens for odd diameters.Although there is an edge at the center, this edge can only guarantee the constant label for c 1 or c 2 , but not always both.We arbitrarily chose to secure the constant label for c 1 .Another problem with this method is the possibility that f (e) = 0 for some edge e.If that happens, then this method cannot be applied to construct an h-magic labeling since 0 cannot be assigned to an edge.These problems, however, do not happen in h-magic graphs.The proof of this fact follows Lemma 3.1.Let T n be an h-magic tree where l is an h-magic labeling.If the pendant edges have label x, then for every edge e, l(e) ≡ xf (e) mod h.
Proof.We first prove the statement for n = 2k.Define This partitions E(T 2k ) into k sets.We will prove the statement by using the principle of backwards induction on m.
For the base case, let uv ∈ Dk where u ∈ D k and v ∈ D k−1 .Since u ∈ D k , then uv is a pendant edge.By definition, l(uv) = x, and so We used the fact that for all u ∈ D i , |D u i | = 1.Now assume that the statement is true for all edges in Dm .Let uv ∈ Dm−1 , where u ∈ D m−1 , so v ∈ D m−2 .Assume u is a pendant vertex.By definition, l(uv) = x, and so We used the fact that, since u is a pendant vertex, |D u i | = 0 for all i > m − 1. Assume then that u is not a pendant vertex.Let D u m = {w 1 , w 2 , ..., w α }.Since l is an h-magic labeling, But uw i ∈ Dm for each 1 ≤ i ≤ α, so we can apply the induction hypothesis and obtain Note that we used Corollary (2.1) in the last step.In the future, we will use it without reference.From the above fact it follows that Thus, by the principal of backwards induction, the statement is true for all m such that 1 ≤ m ≤ k.And so, the statement is true for all edges in trees of even diameter.Note that this proof does not depend on the fact that the edges and vertices are in a tree of even diameter.Since f is the same for both odd and even diameters with the exception of c 1 c 2 , the same proof suffices for all edges in an odd diameter tree except for c 1 c 2 , which we now prove separately.
Let D c1 1 = {w 1 , w 2 , ..., w α }.Since l is an h-magic labeling, and since c 1 w i ∈ D1 for every 1 ≤ i ≤ α, then l(c From this, it follows that Thus, the lemma is true for all edges of an odd diameter tree, and so the proof is done.
This result is significant because it allows us to describe any h-magic labeling of a tree T n .In particular, it tells us that any such labeling is dictated entirely by x, the label of the pendant edges.Thus, determining if a tree T n is h-magic becomes a matter of determining if we can find an x that satisfies the two conditions that f itself does not guarantee.These conditions, again, are that no edge has the label 0 and that l + is also constant for the center vertices.It turns out that being able to find such an x characterizes h-magic graphs.Theorem 3.1.T n is h-magic if and only if there exists an integer x with the following two properties.

For every edge e ∈ E(T n ),
xf (e) ≡ 0 mod h.
2. (a) If n is even, then Before the proof, we note that the first property corresponds to not allowing the edges to have the label 0, and that the second property corresponds to having the center vertices constant under l + .In particular, the left hand side of (3) will correspond to l + (c).Similarly, the left hand side of (4) will correspond to l + (c 1 ) and the right side to l + (c 2 ).Since f by definition guarantees that l + (c 1 ) = x, equation (4) will suffice to show that l + is constant.
Proof.Assume T n is h-magic and let l be an h-magic labeling.We will demonstrate that if x is the label of the pendant edges under l, then x has both properties.We prove that property 1 holds by contradiction.Assume there exists an edge e such that xf (e) ≡ 0 mod h.By Lemma 3.1, l(e) ≡ 0 mod h too, which contradicts the fact that l is an h-magic labeling.Thus, x has property 1.
For property 2, we start with even diameters.Assume n = 2k and set D 1 = {w 1 , w 2 , ..., w α }.By using Lemma 3.1, we get the result: To prove the odd case, we let n = 2k + 1 and set D c2 1 = {w 1 , w 2 , ..., w α }.As before, Lemma 3.1 gives us the result: This is equivalent to (4), so x has property 2, and so the forward direction is done.
For the other direction, we first deal with trees of even diameter.Assume that n = 2k and that there exists an integer x such that (2) and (3) are true.Define l(e) = xf (e).We claim that l is an h-magic labeling, i.e. that l + (u) ≡ x mod h for every u ∈ V (T n ), so let u ∈ V (T n ).We split the proof into three cases.
Assume u ∈ D k .If v is the unique vertex adjacent to u, then, Assume u ∈ D 0 , i.e. u = c.If we let D u 1 = {w 1 , w 2 , ..., w α }, then, Finally, assume u ∈ D m where 0 < m < k.The proof of Lemma 3.1 demonstrates that f (e) = 1 for every pendant edge.Thus, if u is a pendant vertex, then l + (u) = x.So assume u is not a pendant vertex.Set v ∈ D m−1 such that uv ∈ E(T 2k ), and D u m+1 = {w 1 , w 2 , ..., w α }.We obtain the result from the following.
This shows that l is an h-magic labeling, thus completing the proof for even diameter trees.As for trees with odd diameter, let n = 2k + 1 and assume there exists an x such that (2) and ( 4) hold.As with the even case, define l(e) = xf (e).The proof for u ∈ D i for i > 0 is the same as in the even case.We deal with Proof.We start by observing, from Corollary 3.1, that if x is the label of the pendant edges in an h-magic labeling, then σx ≡ 0 mod h.Similarly, any integer x with the property that σx ≡ 0 mod h also has property 2 in Theorem 3.1.We now proceed to the cases.Assume σ ∈ C, and for a contradiction, assume there is an h such that T n is h-magic.Let l be an h-magic labeling and x be the label of the pendant edges.We then have that σx ≡ 0 mod h.Since σ ∈ C, there exist an edge e such that σ|f (e), and so σx|xf (e).But then, xf (e) ≡ 0 mod h, so l(e) ≡ 0 mod h by Lemma 3.1, which is a contradiction.We conclude IM (T n ) = ∅.
Assume then that σ = 0. Let h ∈ N − C. We will prove that T n is h-magic by showing that x = 1 satisfies both properties in Theorem 3.1.From the definition of C, we have that h f (e) for any edge e.In other words, f (e) ≡ 0 mod h, so property 1 is satisfied.Furthermore, σ = 0 implies property 2. Thus, T n is h-magic, so h ∈ IM (T n ).For the other direction, assume h ∈ IM (T n ).Let l be an h-magic labeling and x be the label of the pendant edges.Assume for a contradiction that h|f (e) for some edge e.It follows that xf (e) ≡ 0 mod h, so l(e) ≡ 0 mod h by Lemma 3.1, which is a contradiction.We conclude h f (e) for all edges, so h ∈ N − C.This proves that IM (T n ) = N − C.
Finally, assume that σ ∈ C and σ = 0. We have to prove that IM (T n ) = d∈D dN.Assume first that h ∈ IM (T n ).Let l be an h-magic labeling and x be the label of the pendant edges.Set d = gcd(σ, h).We claim that d ∈ D. By definition, d|σ, so we only need to prove that d ∈ C. We do so by contradiction, so assume d|f (e) for some e ∈ E(T n ).From σx ≡ 0 mod h, we know h|σx.But since d = gcd(σ, h), then h|dx too, and since d|h, it follows that h d |x.We combine this with d|f (e) to get that h d d|xf (e), or xf (e) ≡ 0 mod h, which is a contradiction with Lemma 3.1.Thus, d ∈ C, so d ∈ D. And since d|h, there exists a number p such that dp = h, i.e. h ∈ d∈D dN.
We prove the other direction.Let h ∈ d∈D dN.By definition, h is a multiple of d ∈ D so set h = dq where q ∈ N. We will demonstrate that q = h d is a choice of x that satisfies both properties in Theorem 3.1.From the definition of D, d = 1, so h d ≡ 0 mod h.Since d ∈ C, d f (e) for all edges e, or ( h d )d h d f (e).We conclude that h d f (e) ≡ 0 mod h for all edges, so property 1 is satisfied.By definition, d|σ, so σ d h ≡ 0 mod h.Thus, property

Figure 2 :
Figure 2: A tree T 6 with the members of D 2 highlighted in red.

Figure 3 :
Figure 3: A tree T 7 with B v highlighted in red.

Theorem 2 . 1 .
Let T n be a tree, let p and m be integers where p > m, and let u be a vertex in D m such that the set D u p is nonempty.If D u p = {w 1 , w 2 , ..., w α }, then, for every integer d such that d > p,α i=1 |D wi d | = |D u d |.(1)Proof.Set k = n 2 .If d > k,the result is trivial since all the sets in (1) are empty.Thus, assume that d ≤ k.Observe that the sets D w1 d , D w2 d , ..., and D wα d are all pairwise disjoint since their corresponding branches in T n do not overlap.Thus,

Figure 4 :
Figure 4: Edges labelled such that l + is constant.