Magic and Antimagic Labelings of Hypercubes††thanks: Submitted to the editors DATE.
Funding: This work was funded by
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 well-known properties of (bipartite) distance-regular graphs to construct the magic labelings.
Key words. -magic labeling, -antimagic labeling, distance-regular graph, hypercube
AMS subject classifications. 05C12, 05C78
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 .
Magic squares are among the more popular mathematical recreations and in the early 1960s, Sedláček  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 edge-labels 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 vertex-magic 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 .
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.
Let and be two disjoint sets of distances. If a graph is both magic and magic then it is also magic.
In , 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.
 For any even integer , the -dimensional hypercube is not distance magic.
For other set of distances , there is only one known magic labelings as follow.
Theorem 1.3 ().
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 distance-regular graphs, in particular for bipartite distance-regular graphs which are antipodal double covers (Section LABEL:sec:2).
2 Magic Labelings for Distance-Regular Graphs
We shall use the definition of a distance-regular graph as stated in .
A connected graph of diameter is called distance-regular if there are non-negative 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 distance-regular graph can be searched by considering a tridiagonal matrix as stated in the following.
 If is a distance-regular 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 distance-regular graphs.
Let be a distance-regular 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
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 distance-regular 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.
Let be a bipartite distance-regular graph which is an antipodal double cover. If , then the diameter of is even. Moreover, in this case, has a basis of the form
The tridiagonal matrix of as in Theorem LABEL:B is of the form
Let be an eigenvector of , normalized to have . Then , and can be recursively determined by the condition , and we obtain .
Let be a distance-regular graph which is an antipodal double cover. If admits a distance (resp. closed) magic labeling, then (resp. ) has a basis of the form
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) distance-regular graph, provided that the graph is distance magic.
Let be a distance-regular graph of diameter admitting a distance magic labeling . If is a non-empty subset of then is either -magic labeling or antimagic labeling for some . Moreover, if is bipartite, then is magic for all non-empty .
Regard the distance magic labeling as a vector indexed by . Then . Since is distance-regular, 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 distance-regular 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.
Let be a distance-regular graph which is an antipodal double-cover. 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 .
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 non-existence of distance magic labelings for -dimensional hypercube , when , which was originally proved in . We could also use the theorem to prove the following result.
Hadamard graphs are not distance magic.
It is well known that a Hadamard graph is a bipartite distance-regular graph which is an antipodal double cover with diameter .
3 Magic Labelings for Hypercubes
Recall that the hypercube is a bipartite distance-regular 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 .
If then there exists a -magic labeling of whenever is of the form
where is a non-empty 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.
A subset is said to be balanced if
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 ).
Let be a balanced subset of . Then
Let and let be a neighbor balanced bijection. Then the labeling is a magic labeling of .
Let , then
|(by Lemma LABEL:lem:146a)|
Since is independent of the choice of , we obtain is a -magic labeling of .
Let be a nonsingular linear transformation. is closed neighbor-balanced if and only if the matrix representation of with respect to the standard basis has constant row sum .
Let be the matrix representation of with respect to the standard basis, so that for every . Then for and , we have
|is closed neighbor-balanced|
It is known (see [2, Sect. III.2]) that the distance matrices of satisfy the following:
where is a sequence of polynomials defined by
It is also known that the eigenvalues of are
The Krawtchouk polynomials are the sequence of polynomials defined by
It also can be shown by general theory that
Now we are ready to present the necessary and sufficient condition for the existence of a closed distance magic labeling of a hypercube.
There exists a closed distance magic labeling of if and only if .
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 neighbor-balance 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,
If is odd then
(i) Write . Then , so
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
This completes the inductive step.
(ii) Since and , this implies , which in turn implies . Since , we obtain
The result then follows from (LABEL:Vp).
If then there exists a -magic labeling of whenever is of the form
By Observation LABEL:union, it suffices to show that there exists a -magic labeling of for in
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 .
If , then is distance antimagic. If , then is closed distance antimagic.
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.
-  M. Anholcer, S. Cichacz, and I. Peterin, Spectra of Graphs and Closed Distance Magic Labelings, Discrete Mathematics, 339 (2016) 1915–1923.
-  E. Bannai and T. Ito, Algebraic Combinatorics I: Association Schemes, Benjamin/Cummings (1984).
-  N. Biggs, Algebraic Graph Theory, Second Edition, Cambridge University Press (1996).
-  A. E. Brouwer, A. M. Cohen, and A. Neumaier, Distance-regular graphs, volume 18 of Ergebnisse der Mathematik und ihrer Grenzgebiete (3) [Results in Mathematics and Related Areas (3)]. Springer-Verlag, Berlin, 1989.
-  S. Cichacz, D. Froncek, E. Krop, and C. Raridan, Distance Magic Cartesian Products of Graphs, Discussiones Mathematicae Graph Theory, 36 (2016) 299–308.
-  R. Diestel, Graph Theory, Third Edition, Springer-Verlag, Heidelberg Graduate Texts in Mathematics, Volume 173, New York, 2005
-  P. Gregor and P. Kovář, Distance Magic Labelings of Hypercubes, Electronic Notes in Discrete Mathematics, 40 (2013), 145–149.
-  A.S. Hedayat, N.J.A. Sloane, J. Stufken, Orthogonal Arrays, Theory and Applications, Springer-Verlag, New York, 1999.
-  M. Miller, C. Rodger and R. Simanjuntak, Distance magic labelings of graphs, Australasian Journal of Combinatorics, 28 (2003), 305–315.
-  A. O’Neal and P. Slater, Uniqueness of Vertex Magic Constants, SIAM J. Disc. Math., 27 (2013) 708–716.
-  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.
-  J. Sedláček, Problem 27. In: Theory of Graphs and Its Applications (M. Fiedler, ed.). Praha. 1964, 163–164.