The Integer-Magic Spectra of Trees

Alvaro Carbonero1, Dylan Obata1
1University of Nevada, Las Vegas, USA

Abstract

For any positive integer h, a graph G=(V,E) is said to be h-magic if there exists a labeling l:E(G)Zh{0} such that the induced vertex set labeling  l+:V(G)Zh defined by
l+(v)=uvE(G) l(uv)
is a constant map. The integer-magic spectrum of a graph G, denoted by IM(G), is the set of all hN 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.

Keywords: Integer-magic spectrum, Tree diameter, Magic labeling

1. 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)=uvE(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 Zh-magic. Similarly, if l is a Zh-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 [2]; this one is a different generalization of magic graphs and so it does not relate to the topics covered in this paper.

Definition 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, 4]. 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 [5].

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)xmodh for every vertex v.

2. 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 P2. From now on, c will denote the vertex at the center of a tree of even diameter; similarly, c1 and c2 will denote the vertices at the center of a tree of odd diameter. Also, to simplify the statement of our theorems, we will use Tn to refer to a tree of diameter n.

We start by describing vertices in terms of their distance from the center.

Definition 2. For a tree T2k and an integer i0, let Di:={vV(T2k) : d(v,c)=i}.

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 c1 from those that are closer to c2. With this objective, we define the function δ:V(T2k+1)N{0} where δ(v)=min{d(v,c1),d(v,c2)}.

Definition 3. For a tree T2k+1 and an integer i0, let Di:={vV(T2k+1) : δ(v)=i}.

We are abusing notation by using Di for both even and odd diameter trees. However, for our purposes, their definitions are equivalent. In both cases, Di 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, Dd= 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 T2k+1, c1 and c2 each must have at least one pendant vertex that is k away. Thus, for both odd and even diameters, if 1ik, then |Di|2. Additionally, even diameters have D0={c}, and odd diameters have D0={c1,c2}. Finally, we note that, for any n, if uvE(Tn) and uDm, then either vDm+1 or vDm1 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 Tn. To simplify the statement of these definitions, we will use the term P(u,v), where u,vV(Tn), to refer to the vertex set of the unique path in Tn from u to v.

Definition 4. For a tree T2k and uV(T2k){c}, let the branch of u, or Bu, be the induced subgraph of T2k with vertex set: {vV(T2k) : d(c,u)d(c,v) and wP(u,v) d(c,u)d(c,w)}. Furthermore, define Bc=T2k.

Informally, Bu is the subgraph of T2k that extends from u and outwards to the pendant vertices. We now make an equivalent definition for trees of odd diameter.

Definition 5. For a tree of T2k+1 and uV(T2k+1){c1,c2}, let the branch of u, or Bu, be the induced subgraph of T2k+1 with vertex set: {vV(T2k+1) : δ(u)δ(v) and wP(u,v) δ(u)δ(w)}. Furthermore, let Bc1 be the induced subgraph with vertex set: {vV(T2k+1) : δ(c1)δ(v) and c2P(v,c1)}. The definition of Bc2 follows similarly.

If vV(Bu) and vu, then we say v extends from u. An important observation to make about these branches is that if uvE(Tn), with uDm and vDm+1, then Bv is a subgraph of Bu 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 Bu. We now create a term that combines the objectives behind Dm and Bu.

Definition 6. For a tree Tn, a vertex uV(Tn) and an integer m0, let Dmu:=DmV(Bu).

Informally, Dmu is the collection of vertices at distance i from the center that also extend from u. An important observation is that if uDm and u is not a pendant vertex, then all the vertices in Dm+1u 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 Dm+1u= because nothing would be able to extend from u. Finally, if uDm, then Dmu={u} because all other vertices in V(Bu) 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.

Theorem 1. Let Tn be a tree, let p and m be integers where p>m, and let u be a vertex in Dm such that the set Dpu is nonempty. If Dpu={w1,w2,,wα}, then, for every integer d such that d>p, (1)i=1α|Ddwi|=|Ddu|.

Proof. Set k=floorn2. If d>k, the result is trivial since all the sets in (1) are empty. Thus, assume that dk.

Observe that the sets Ddw1,Ddw2,, and Ddwα are all pairwise disjoint since their corresponding branches in Tn do not overlap. Thus, |1iαDdwi|=i=1α|Ddwi|. We finish the proof by showing that 1iαDdwi=Ddu. Let vDdwi for some i where 1iα. By definition, vDd and vV(Bwi). Since wi extends from u, Bwi is a subgraph of Bu. Thus, vV(Bu). It follows that vDdu. Now let vDdu. Then vV(Bu). Since v is further away from the center than any of the vertices in Dpu, the path from u to v must go through wi for some i. That is, v extends from wi, and so vV(Bwi). Since vDd, vDdwi◻

In the next section, we will use the special case of p=m+1 since, as discussed before, Dm+1u consists of vertices adjacent to u. For convenience and future reference, we state it explicitly.

Corollary 1. For a tree Tn, let u be a vertex in Dm such that u is not a pendant vertex. If Dm+1u={w1,w2,,wα}, then, for every d such that d>m+1, i=1α|Ddwi|=|Ddu|.

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 7. For a tree T2k, define f:E(T2k)Z such that if uvE(T2k), uDm and vDm1, then f(uv):=(1)km+1i=1km+1(1)i|Dki+1u|. Furthermore, for a tree T2k+1, define f:E(T2k+1)Z such that if uvE(T2k+1){c1c2}, uDm and vDm1, then f(uv):=(1)km+1i=1km+1(1)i|Dki+1u|. As for c1c2, let f(c1c2):=(1)k+1i=1k+1(1)i|Dki+1c1|.

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 c1 or c2, but not always both. We arbitrarily chose to secure the constant label for c1. 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 1. Let Tn 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)modh.

Proof. We first prove the statement for n=2k. Define D^m={uvE(T2k) : uDm and vDm1} for m such that 1mk. This partitions E(T2k) into k sets. We will prove the statement by using the principle of backwards induction on m.

For the base case, let uvD^k where uDk and vDk1. Since uDk, then uv is a pendant edge. By definition, l(uv)=x, and so xf(uv)=x(1)kk+1i=1kk+1(1)i|Dki+1u|=x|Dku|=x=l(uv)modh. We used the fact that for all uDi, |Diu|=1.

Now assume that the statement is true for all edges in D^m. Let uvD^m1, where uDm1, so vDm2. Assume u is a pendant vertex. By definition, l(uv)=x, and so xf(uv)=x(1)km+1+1i=1km+1+1(1)i|Dki+1u|=x(1)km(|Dku|++(1)km+2|Dm1u|)=x(1)km(0+(1)km)=x=l(uv)modh. We used the fact that, since u is a pendant vertex, |Diu|=0 for all i>m1.

Assume then that u is not a pendant vertex. Let Dmu={w1,w2,,wα}. Since l is an h-magic labeling, l+(u)=l(uv)+i=1αl(uwi)xmodh. But uwiD^m for each 1iα, so we can apply the induction hypothesis and obtain i=1αl(uwi)i=1αxf(uwi)=i=1αx(1)km+1j=1km+1(1)j|Dkj+1wi|=x(1)km+1i=1αj=1km+1(1)j|Dkj+1wi|=x(1)km+1j=1km+1(1)j|Dkj+1u|modh. Note that we used Corollary (1) in the last step. In the future, we will use it without reference. From the above fact it follows that l(uv)xi=1αl(uwi)xx(1)km+1j=1km+1(1)j|Dkj+1u|=x(1+(1)km+2j=1km+1(1)j|Dkj+1u|)=x((1)2(km+2)|Dm1u|+(1)km+2j=1km+1(1)j|Dkj+1u|)=x(1)km+2((1)km+2|Dm1u|+j=1km+1(1)j|Dkj+1u|)=x(1)km+2j=1km+2(1)j|Dkj+1u|)=xf(uv)modh. Thus, by the principal of backwards induction, the statement is true for all m such that 1mk. 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 c1c2, the same proof suffices for all edges in an odd diameter tree except for c1c2, which we now prove separately.

Let D1c1={w1,w2,,wα}. Since l is an h-magic labeling, l+(c1)=l(c1c2)+i=1αl(c1wi)xmodh, and since c1wiD^1 for every 1iα, then l(c1wi)xf(c1wi)modh. Thus, i=1αl(c1wi)i=1αxf(c1wi)=i=1αx(1)kj=1k(1)j|Dkj+1wi|=x(1)kj=1k(1)j|Dkj+1c1|modh. From this, it follows that l(c1c2)xi=1αl(c1wi)x(1+(1)k+1j=1k(1)j|Dkj+1c1|)=x((1)2(k+1)|D0c1|+(1)k+1j=1k(1)j|Dkj+1c1|)=x(1)k+1((1)k+1|D0c1|+j=1k(1)j|Dkj+1c1|)=x(1)k+1j=1k+1(1)j|Dkj+1c1|=xf(c1c2)modh.

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 Tn. 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 Tn 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 2. Tn is h-magic if and only if there exists an integer x with the following two properties.

  1. For every edge eE(Tn), (2)xf(e)0modh.

    1. If n is even, then (3)xi=1k(1)k+i|Dki+1|xmodh

    2. If n is odd, then (4)xi=1k(1)i|Dki+1c1|xi=1k(1)i|Dki+1c2|modh.

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+(c1) and the right side to l+(c2). Since f by definition guarantees that l+(c1)=x, equation (4) will suffice to show that l+ is constant.

Proof. Assume Tn 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)0modh. By Lemma 1, l(e)0modh 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 D1={w1,w2,,wα}. By using Lemma 1, we get the result: xl+(c)=i=1αl(cwi)i=1αxf(cwi)=xi=1α(1)kj=1k(1)j|Dkj+1wi|=xj=1k(1)k+j|Dkj+1|modh.

To prove the odd case, we let n=2k+1 and set D1c2={w1,w2,,wα}. As before, Lemma 1 gives us the result:

xl+(c2)=l(c1c2)+i=1αl(c2wi)x(1)k+1i=1k+1(1)i|Dki+1c1|+i=1αx(1)kj=1k(1)j|Dkj+1wi|=x(1)k(i=1k+1(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c2|)=x(1)k(i=1k(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c2|+(1)k)=x(1)k(i=1k(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c2|)+xmodh. 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)xmodh for every uV(Tn), so let uV(Tn). We split the proof into three cases.

Assume uDk. If v is the unique vertex adjacent to u, then, l+(u)=l(uv)=xf(uv)=x(|Dku|)=x.

Assume uD0, i.e. u=c. If we let D1u={w1,w2,,wα}, then, l+(u)=i=1αl(uwi)=i=1αxf(uwi)=xi=1α(1)kj=1k(1)j|Dkj+1wi|=xj=1k(1)k+j|Dkj+1|xmodh.

Finally, assume uDm where 0<m<k. The proof of Lemma 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 vDm1 such that uvE(T2k), and Dm+1u={w1,w2,,wα}. We obtain the result from the following. l+(u)=l(uv)+i=1αl(uwi)=x(1)km+1i=1km+1(1)i|Dki+1u|+xi=1α(1)kmj=1km(1)j|Dkj+1wi|=x(1)km(i=1km+1(1)i|Dki+1u|+j=1km(1)j|Dkj+1u|)=x(1)km((1)km+1|Dmu|)=x.

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 uDi for i>0 is the same as in the even case. We deal with D0={c1,c2} separately. Set D1c1={w1,w2,,wα}. It follows that l+(c1)=l(c1c2)+i=1αl(c1wi)=x(1)k+1i=1k+1(1)i|Dki+1c1|+i=1αx(1)kj=1k(1)j|Dkj+1wi|=x(1)k(i=1k+1(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c1|)=x(1)k((1)k+1|D0c1|)=x.

Similarly, if D1c2={w1,w2,,wα}, then

l+(c2)=l(c1c2)+i=1αl(c2wi)=x(1)k+1i=1k+1(1)i|Dki+1c1|+i=1αx(1)kj=1k(1)j|Dkj+1wi|=x(1)k(i=1k+1(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c2|)x(1)k(i=1k+1(1)i|Dki+1c1|+j=1k(1)j|Dkj+1c1|)=x(1)k((1)k+1|D0c1|)=x. Thus, l+ is constant for all vertices, and so Tn is h-magic. This completes the odd case, and so the proof. ◻

Having a complete characterization of when Tn is h-magic allows us to find the integer-magic spectrum rather easily. In fact, the proof of Salehi et al. for trees of diameter 5 in [3, 4] gives a template for the proof of our final result. Before going on to the main result, we provide a small and immediate corollary to Theorem 2 that will shed light on the conditions stated in the main result.

Corollary 2. For any h-magic tree of diameter 2k, if x is the label of the pendant edges, then xi=1k+1(1)k+i|Dki+1|0modh. Furthermore, for any h-magic tree of diameter 2k+1, if x is the label of the pendant edges, then xi=1k(1)i(|Dki+1c1||Dki+1c2|)0modh.

4. The Main Result

The integer-magic spectrum of an arbitrary tree is provided by the following general result.

Theorem 3. Given a tree Tn, let k=floorn2, and let C:={mZ : m|r for some rRange(f)}. When n is even, set σ:=i=1k+1(1)k+i|Dki+1|, and when n is odd, set σ:=i=1k(1)i(|Dki+1c1||Dki+1c2|). If D is the set of all positive divisors of σ that are not in C, then IM(Tn)={if σC;NCif σ=0;dDdNotherwise.

Proof. We start by observing, from Corollary 2, that if x is the label of the pendant edges in an h-magic labeling, then σx0modh. Similarly, any integer x with the property that σx0modh also has property 2 in Theorem 2. We now proceed to the cases.

Assume σC, and for a contradiction, assume there is an h such that Tn is h-magic. Let l be an h-magic labeling and x be the label of the pendant edges. We then have that σx0modh. Since σC, there exist an edge e such that σ|f(e), and so σx|xf(e). But then, xf(e)0modh, so l(e)0modh by Lemma 1, which is a contradiction. We conclude IM(Tn)=.

Assume then that σ=0. Let hNC. We will prove that Tn is h-magic by showing that x=1 satisfies both properties in Theorem 2. From the definition of C, we have that hf(e) for any edge e. In other words, f(e)0modh, so property 1 is satisfied. Furthermore, σ=0 implies property 2. Thus, Tn is h-magic, so hIM(Tn). For the other direction, assume hIM(Tn). 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)0modh, so l(e)0modh by Lemma 1, which is a contradiction. We conclude hf(e) for all edges, so hNC. This proves that IM(Tn)=NC.

Finally, assume that σC and σ0. We have to prove that IM(Tn)=dDdN. Assume first that hIM(Tn). Let l be an h-magic labeling and x be the label of the pendant edges. Set d=gcd(σ,h). We claim that dD. By definition, d|σ, so we only need to prove that dC. We do so by contradiction, so assume d|f(e) for some eE(Tn). From σx0modh, we know h|σx. But since d=gcd(σ,h), then h|dx too, and since d|h, it follows that hd|x. We combine this with d|f(e) to get that hdd|xf(e), or xf(e)0modh, which is a contradiction with Lemma 1. Thus, dC, so dD. And since d|h, there exists a number p such that dp=h, i.e. hdDdN.

We prove the other direction. Let hdDdN. By definition, h is a multiple of dD so set h=dq where qN. We will demonstrate that q=hd is a choice of x that satisfies both properties in Theorem 1. From the definition of D, d1, so hd0modh. Since dC, df(e) for all edges e, or (hd)dhdf(e). We conclude that hdf(e)0modh for all edges, so property 1 is satisfied. By definition, d|σ, so σdh0modh. Thus, property 2 is satisfied. By Theorem 2, Tn is h-magic, and so hIM(Tn). In other words, IM(Tn)=dDdN, and the proof is done. ◻

References:

  1. G. Chartrand and P. Zhang, 2012. A First Course in Graph Theory, Dover Publications, New York.

  2. Meenakshi, C. and Kathiresan, K.M., 2019. A generalization of magic and antimagic labelings of graphs. AKCE International Journal of Graphs and Combinatorics, 16(2), pp.125-144.

  3. Lee, S.M., Salehi, E. and Sun, H., 2004. Integer-magic spectra of trees with diameters at most four. Journal of Combinatorial Mathematics and Combinatorial Computing, 50, pp.3-16.

  4. Salehi, E. and Bennett, P., 2008. Integer-magic spectra of trees of diameter Five. Journal of Combinatorial Mathematics and Combinatorial Computing, 66, pp.105-111.

  5. Joseph A. G., 2019. A Dynamic Survey in Graphs Labeling (twenty-second edition), The Electronic Journal of Combinatorics (2019), pp.129-132.