Magic and Antimagic Labelings of Hypercubes^{†}^{†}thanks: Submitted to the editors DATE.
Funding: This work was funded by
Abstract
For a set of distances , a graph of order is said to be magic if there exists a bijection and a constant such that for any vertex , , where .
In this paper we shall find sets of distances s, such that the hypercube is magic. We shall utilise wellknown properties of (bipartite) distanceregular graphs to construct the magic labelings.
Key words. magic labeling, antimagic labeling, distanceregular graph, hypercube
AMS subject classifications. 05C12, 05C78
1 Introduction
We denote by a finite undirected simple graph of order and diameter . For an integer (), we define as the distance matrix of . When , the matrix is the adjacency matrix of , and sometime it is denoted by simply . For an integer () and a vertex in , we define as the set of all vertices at distance from . The open neighborhood of is and the closed neighborhood of is . In general, for a set of distances , the neighborhood of a vertex is . For other standard graph theoretic notations and definitions we refer to Diestel [6].
Magic squares are among the more popular mathematical recreations and in the early 1960s, Sedláček [12] asked whether the ”magic” ideas could be applied to graph. He introduced a graph labeling where the edges of a graph are labeled with distinct real numbers such that the sum of edgelabels incident with each vertex equal to a constant, independent of the choice of vertex. It is obvious that the complete bipartite graph can be labeled by elements of a magic square of size . This labeling was called magic labeling, but then it becomes known as the vertexmagic edge labeling. Since then, many variations of magic labelings have been defined, and the most recent was introduced by O’Neal and Slater in 2013 [10].
Definition 1.1.
For a graph and a set of distances , a bijection is called a magic labeling of if there exists a constant called the magic constant such that for any vertex , the weight of , .
In the case that the weight is distinct for every vertex , is called a antimagic labeling of . In particular, if the set of weights constitutes an arithmetic progression starting at with difference , then is called an antimagic labeling of .
Any graph admitting a magic (resp. antimagic, antimagic) labeling is called a magic (resp. antimagic, antimagic) graph.
If , a magic (resp. antimagic, antimagic) labeling is known as a distance magic (resp. distance antimagic, distance antimagic) labeling, and if , a magic (resp. antimagic, antimagic) labeling is called a closed distance magic (resp. closed distance antimagic, closed distance antimagic) labeling.
The following observation is a direct consequence of the magic labeling definition.
Observation 1.
Let and be two disjoint sets of distances. If a graph is both magic and magic then it is also magic.
In [9], it was proved that if is an regular graph with order admitting a distance magic labeling, then the magic constant is . Using this result and the Handshaking Lemma, it is clear that every regular graph with odd degree is not distance magic. In 2004, Acharya, Rao, Singh, and Parameswaran conjectured that distance magic labelings do not exist for all hypercubes of order at least 4, including the ones with even degrees.
Conjecture 1.
[11] For any even integer , the dimensional hypercube is not distance magic.
The conjecture was proved to be true in [5] for . However, positive answers were instead obtained for [7]; which lead us to the following theorem.
For other set of distances , there is only one known magic labelings as follow.
Theorem 1.3 ([7]).
For every , there exist a distance magic labeling of the hypercube for every odd , .
In this paper we shall find sets of distances s for which magic labelings for hypercubes exist (Section LABEL:sec:3). In order to do so, we shall develop more general results for distanceregular graphs, in particular for bipartite distanceregular graphs which are antipodal double covers (Section LABEL:sec:2).
2 Magic Labelings for DistanceRegular Graphs
We shall use the definition of a distanceregular graph as stated in [4].
Definition 2.1.
A connected graph of diameter is called distanceregular if there are nonnegative integers such that for any two vertices and in at distance , there are precisely neighbours of in and neighbours of in . Clearly, is regular with degree , , and . The sequence is called the intersection array of ; and the numbers , and , where , are called the intersection numbers of .
The spectrum of a distanceregular graph can be searched by considering a tridiagonal matrix as stated in the following.
Theorem 2.2.
[3] If is a distanceregular graph of diameter and intersection array , then has distinct eigenvalues which are the eigenvalues of the tridiagonal matrix
In subsequent theorems and proofs, we refer to the matrix of as the tridiagonal matrix in Theorem LABEL:B.
For a vertex and a labeling of vertices , we denote by , the sum of labels of all vertices in . It is clear that . We define two vectors of as follow: the vector as and the vector as . Now we are ready to provide necessary conditions for the existence of distance and closed distance magic labelings for distanceregular graphs.
Lemma 2.3.
Let be a distanceregular graph of diameter , be a vertex in , and be a labeling of vertices in . If is a distance magic labeling with magic constant , then
If is a closed distance magic labeling with magic constant , then
Proof.
Suppose that is a distance magic labeling of with magic constant . For a vertex in and , consider the sum of weights of vertices in ,
In this equation, the label of every vertex in appears times, the label of every vertex in appears times, and the label of every vertex in appears times. Thus, the following holds.
This proves that . The second statement can be proved in a similar manner.
A distanceregular graph of diameter is called an antipodal double cover if for some (and hence all) vertex in . The unique vertex in is called the antipode of and denoted by in what follows.
Lemma 2.4.
Let be a bipartite distanceregular graph which is an antipodal double cover. If , then the diameter of is even. Moreover, in this case, has a basis of the form
(2.1) 
Proof.
The tridiagonal matrix of as in Theorem LABEL:B is of the form
(2.2) 
Let be an eigenvector of , normalized to have . Then , and can be recursively determined by the condition , and we obtain .
Lemma 2.5.
Let be a distanceregular graph which is an antipodal double cover. If admits a distance (resp. closed) magic labeling, then (resp. ) has a basis of the form
(2.3) 
Proof.
Suppose that is a distance magic labeling of with magic constant . For a vertex in , we have
where is the degree of . This implies and gives the desired description of . If admits a closed distance magic labeling , then an analogous argument shows .
The following theorem enables us to construct new magic or antimagic labelings for a (bipartite) distanceregular graph, provided that the graph is distance magic.
Theorem 2.6.
Let be a distanceregular graph of diameter admitting a distance magic labeling . If is a nonempty subset of then is either magic labeling or antimagic labeling for some . Moreover, if is bipartite, then is magic for all nonempty .
Proof.
Regard the distance magic labeling as a vector indexed by . Then . Since is distanceregular, there exists a polynomial such that . If has constant term , then . Thus, is a magic labeling or antimagic labeling for some , according to or not.
Assume now that is bipartite, and that consists of odd positive integers. Then is an odd polynomial in , and thus .
Note that Theorem LABEL:j is a direct consequence of Theorems LABEL:QnDM and LABEL:BDRG.
Now we are ready to prove the following theorem, which provides us many new magic labelings for a distanceregular graph which is an antipodal double cover, provided that the graph is either distance or closed distance magic. Additionally, the theorem also provides a necessary condition for the existence of a distance magic labeling for such a graph.
Theorem 2.7.
Let be a distanceregular graph which is an antipodal doublecover. If is a distance magic labeling or a closed distance magic of then is a magic labeling for every . Moreover, if is bipartite and is a distance magic labeling, then .
Proof.
From Lemma LABEL:lem:KerB, has a basis of the form . Then is a constant independent of . Consequently, for every ,
Therefore, is magic.
If is bipartite, then implies that must be even. Recursively comparing entries of , there exist constants and such that . More explicitly, . Switching the role of and , we find . This forces , and hence .
Theorem LABEL:n=2mod4 provides an alternative proof for the nonexistence of distance magic labelings for dimensional hypercube , when , which was originally proved in [5]. We could also use the theorem to prove the following result.
Corollary 2.8.
Hadamard graphs are not distance magic.
Proof.
It is well known that a Hadamard graph is a bipartite distanceregular graph which is an antipodal double cover with diameter .
3 Magic Labelings for Hypercubes
Recall that the hypercube is a bipartite distanceregular graph which is an antipodal double cover with diameter . As direct consequences of Observation LABEL:union, Theorems LABEL:QnDM, LABEL:j, LABEL:BDRG and LABEL:n=2mod4, we obtain the following sets of distances in which magic labelings exist for the hypercube , where .
Theorem 3.1.
If then there exists a magic labeling of whenever is of the form
where is a nonempty subset of , , and
Thus a natural question would be:
Open Problem 3.2.
”Are the sets s in Theorem LABEL:2mod4 the only for which , , is magic?”
If the answer of the question in Open Problem LABEL:D_2mod is positive, then by Theorem LABEL:BDRG, we obtain antimagic labelings of for all s which are excluded in Theorem LABEL:2mod4.
The rest of the section will be devoted on searching magic labelings for the hypercube , where . We shall denote by the th standard basis vector in . For a vector , we denote by the corresponding nonnegative integer:
where each is regarded as an element of . We also denote by the embedding obtained by setting in the above definition.
In the hypercube , we have
The following definition is essential in finding a closed distance magic labeling of , as can be seen in Lemma LABEL:lem:146b.
Definition 3.3.
A subset is said to be balanced if
(3.1) 
For a subset , a bijection is said to be neighbor balanced if is balanced for every . If (resp. ), then a neighbor balanced bijection is called a neighbor balanced (resp. closed neighbor balanced).
Note that a subset is balanced if and only if it is an orthogonal array of strength (see [8]).
Lemma 3.4.
Let be a balanced subset of . Then
Proof.
We have
(by (LABEL:146a))  
Lemma 3.5.
Let and let be a neighbor balanced bijection. Then the labeling is a magic labeling of .
Proof.
Let , then
(by Lemma LABEL:lem:146a)  
Since is independent of the choice of , we obtain is a magic labeling of .
Lemma 3.6.
Let be a nonsingular linear transformation. is closed neighborbalanced if and only if the matrix representation of with respect to the standard basis has constant row sum .
Proof.
Let be the matrix representation of with respect to the standard basis, so that for every . Then for and , we have
Thus,
Therefore,
is closed neighborbalanced  
It is known (see [2, Sect. III.2]) that the distance matrices of satisfy the following:
where is a sequence of polynomials defined by
and
It is also known that the eigenvalues of are
The Krawtchouk polynomials are the sequence of polynomials defined by
Thus,
(3.2) 
It also can be shown by general theory that
(3.3) 
Now we are ready to present the necessary and sufficient condition for the existence of a closed distance magic labeling of a hypercube.
Theorem 3.7.
There exists a closed distance magic labeling of if and only if .
Proof.
Let , where is a positive integer. Observe that the matrix
is nonsingular over and it has constant row sum . By Lemma LABEL:lem:146b, there exists a closed neighborbalance bijection of . By Lemma LABEL:lem:146c, is a closed distance magic labeling.
Conversely, suppose that there exists a closed distance magic labeling of . By Lemma LABEL:lem:KerB the kernel of must have a basis of the form . In particular, has eigenvalue , which forces to be odd. Let . Then the eigenvalues of are , . Thus . The normalized eigenvector belonging to the eigenvalue is , and it satisfies and (by (LABEL:eq:1)). Thus, must be odd and hence .
Let denote the eigenspace of corresponding to the eigenvalue . Then the distance matrix has eigenvalue on , that is,
Lemma 3.8.

If is odd then

If then
Proof.
(i) Write . Then , so
(3.4) 
The eigenvalue of on is , so it suffices to prove
We prove this by induction on . The case is immediate from (LABEL:Vp). By the recurrence (LABEL:K), we have
Thus
This completes the inductive step.
(ii) Since and , this implies , which in turn implies . Since , we obtain
The result then follows from (LABEL:Vp).
Theorem 3.9.
If then there exists a magic labeling of whenever is of the form
(3.5) 
where and
Proof.
By Observation LABEL:union, it suffices to show that there exists a magic labeling of for in
(3.6) 
By Theorem LABEL:thm:1, there exists a closed distance magic labeling of . By Lemma LABEL:lem:A, such a labeling is also a magic labeling for in (LABEL:D). Indeed, implies
Thus , proving that is a magic labeling. Similarly, we can show that is a magic labeling.
Open Problem 3.10.
”Are the sets s in Theorem LABEL:thm:2 the only for which , , is magic?”
Open Problem LABEL:op:2 should be true if equality holds in the inclusions in Lemma LABEL:lem:A.
Additionally, in the next theorem we show that the known distance magic and closed distance magic labelings of can be utilised to construct distance antimagic and closed distance antimagic labelings for , the disjoint union of two copies of .
Theorem 3.11.
If , then is distance antimagic. If , then is closed distance antimagic.
Proof.
The adjacency matrix of is of the form
where is the adjacency matrix of .
Suppose first . Then by Theorem LABEL:QnDM, has a distance magic labeling . Partitioning the vector into two equal parts and , we find
This implies that is a distance antimagic labeling. Therefore, is distance antimagic.
Next suppose . Then Theorem LABEL:thm:1 implies that there exists a closed distance magic labeling of . If we regard as a labeling of , then it is easy to see that is a closed distance antimagic labeling, by a similar argument as the previous case.
References
 [1] M. Anholcer, S. Cichacz, and I. Peterin, Spectra of Graphs and Closed Distance Magic Labelings, Discrete Mathematics, 339 (2016) 1915–1923.
 [2] E. Bannai and T. Ito, Algebraic Combinatorics I: Association Schemes, Benjamin/Cummings (1984).
 [3] N. Biggs, Algebraic Graph Theory, Second Edition, Cambridge University Press (1996).
 [4] A. E. Brouwer, A. M. Cohen, and A. Neumaier, Distanceregular graphs, volume 18 of Ergebnisse der Mathematik und ihrer Grenzgebiete (3) [Results in Mathematics and Related Areas (3)]. SpringerVerlag, Berlin, 1989.
 [5] S. Cichacz, D. Froncek, E. Krop, and C. Raridan, Distance Magic Cartesian Products of Graphs, Discussiones Mathematicae Graph Theory, 36 (2016) 299–308.
 [6] R. Diestel, Graph Theory, Third Edition, SpringerVerlag, Heidelberg Graduate Texts in Mathematics, Volume 173, New York, 2005
 [7] P. Gregor and P. Kovář, Distance Magic Labelings of Hypercubes, Electronic Notes in Discrete Mathematics, 40 (2013), 145–149.
 [8] A.S. Hedayat, N.J.A. Sloane, J. Stufken, Orthogonal Arrays, Theory and Applications, SpringerVerlag, New York, 1999.
 [9] M. Miller, C. Rodger and R. Simanjuntak, Distance magic labelings of graphs, Australasian Journal of Combinatorics, 28 (2003), 305–315.
 [10] A. O’Neal and P. Slater, Uniqueness of Vertex Magic Constants, SIAM J. Disc. Math., 27 (2013) 708–716.
 [11] S.B. Rao, T. Singh and V. Parameswaran, Some sigma labelled graphs I, in Graphs, Combinatorics, Algorithms and Applications, eds. S. Arumugam, B.D. Acharya and S.B. Rao, Narosa Publishing House, New Delhi (2004) 125–133.
 [12] J. Sedláček, Problem 27. In: Theory of Graphs and Its Applications (M. Fiedler, ed.). Praha. 1964, 163–164.