D -Magic Oriented Graphs

: In this paper, we deﬁne D -magic labelings for oriented graphs where D is a distance set. In particular, we label the vertices of the graph with distinct integers { 1,2, . . . , | V ( G ) |} in such a way that the sum of all the vertex labels that are a distance in D away from a given vertex is the same across all vertices. We give some results related to the magic constant, construct a few inﬁnite families of D -magic graphs, and examine trees, cycles, and multipartite graphs. This deﬁnition grew out of the deﬁnition of D -magic (undirected) graphs. This paper explores some of the symmetries we see between the undirected and directed version of D -magic labelings.


Introduction
A labeling of a graph or digraph is simply defined as an assignment of numbers (usually integers) to the vertices, edges, or both, such that certain conditions hold. There are many different types of labelings as can be seen in Gallian's survey [1]. However, most of these labelings are defined on undirected graphs. In 1985, Bloom and Hsu introduced graceful labelings on directed graphs [2]. In 2008, magic labelings of directed graphs were introduced in [3]. Other magic-type labelings on directed graphs have been studied in [4][5][6][7][8][9].
In Vilfred's 1994 Ph.D. thesis, distance magic labelings were introduced [10]. A distance magic labeling, or Σ labeling, of a graph G on n vertices is a bijection f : V(G) → {1, 2, . . . , n} such that at any vertex x, the weight of x, ∑ y∈N(x) f (y) is constant, where N(x) is the open neighbourhood of x, i.e., the set of vertices adjacent to x. Five years later, Jinah [11] defined a variation of the distance magic labeling, called the closed distance magic labeling, where the weight of a vertex x is summed over the closed neighbourhood of x, i.e., the set containing x and all vertices adjacent to x. D-magic labelings were first introduced by O'Neal and Slater as a generalization of these two previously mentioned labelings [12]. Definition 1. Let G be a graph with n vertices and diameter diam(G). Let D ⊆ {0, 1, . . . , diam(G)} be a set of distances in G. G is said to be D-magic if there exists a bijection f : V → {1, 2, . . . , n} and a magic constant k such that for any vertex x, ∑ y∈N D (x) f (y) = k, where N D (x) = {y|d(x, y) = d, d ∈ D} is the D-neighbourhood set of x.
One of the most important results for D-magic labelings is in [13,14] where it is shown that for a particular graph, the magic constant is unique and is determined by its fractional domination number. For more results, refer to survey articles [15,16].
In this paper, we explore the directed version of D-magic labelings.

Oriented Graphs
An oriented graph G can be described as a collection V = V(G) of vertices together with a collection E = E(G) of ordered pairs of vertices called directed edges. If there is an edge (x, y), we may write x → y. By definition, oriented graphs do not contain any repeated directed edges, contain no loops (i.e., edges of the form (x, x)) and they do not contain bidirectional edges, i.e., if (x, y) ∈ E, then (y, x) ∈ E. The underlying graph of an oriented graph G is the graph that is obtained by removing the orientations of the directed edges in G. We shall write n = |V(G)| and m = |E(G)|.

Partitions
The ability to partition the integers into sets with equal sums is a critical component of creating magic-type labelings of graphs. Hence, we include a definition and useful result related to integer partitions here. Definition 2 ([17]). An (s − t)-partition of Z n = {1, 2, . . . , n} is a partition of Z n into s subsets, each with sum t. Theorem 1 ([17]). If n(n + 1) = 2st, t ≥ n, then there exists an (s − t)-partition of Z n .

D-Magic Oriented Graphs
Motivated by the previously mentioned definitions, we now introduce a definition for D-magic oriented graphs. Definition 3. Let G be an oriented graph with n vertices and diameter diam(G). Let D ⊆ {0, 1, . . . , diam(G)} be a set of distances in G. An oriented graph G has a D-magic labeling if there is a bijection f : V(G) → {1, 2, . . . , n} and a magic constant k such that at any vertex x ∈ V(G) If G admits a D-magic labeling, then G is D-magic. The sum, w(x), at each vertex is the weight.
The smallest example of a D-magic oriented graph is K 1 , which is {0}-magic. This is the only oriented graph that is {0}-magic as any graph with two or more vertices would produce distinct weights at each vertex. As we will see in Section 4, there are no D-magic oriented graphs of order 2. For graphs of order 3, there is a {0, 1, 2}-magic labeling of − → C 3 . The smallest non-trivial example is − → C 4 , which is {0, 2}, {1, 3}, and {0, 1, 2, 3}-magic.

Properties of D-Magic Oriented Graphs
In this section, we prove some general properties of D-magic oriented graphs. We start with an observation that is a direct consequence of Definition 3.

Remark 1.
Let D 1 and D 2 be two disjoint sets of distances. If a labeling is both D 1 -magic and D 2 -magic then it is also (D 1 ∪ D 2 )-magic.
In the next lemma we show that a D-magic oriented graph consists of at most one sink, i.e., a vertex of outdegree zero.

Lemma 1.
If G is D-magic, then G contains at most one vertex of outdegree zero. If there is such a vertex, 0 ∈ D and the magic constant is n.
Proof. If a vertex has outdegree zero, then it has no vertices of distance d > 0 away from it. Hence, the only label that could contribute to the sink's weight would be the label on the vertex itself. Thus, 0 ∈ D. In addition, if two or more vertices were of outdegree zero, then their weights would not be equal as the only contributing values would be the label on that vertex and vertex labels are not repeated. Finally, if any vertex other than the sink had label n, then the weight at that vertex would be at least n, while the sink's weight would be no larger than n − 1. This is a contradiction as all the weights must be equal. Hence, the sink must have label n and thus, the magic constant of any graph with a sink is n.
There is an infinite family of graphs with a single vertex of outdegree zero that permit an orientation that is D-magic. Consider the graph G with 4k + 2 vertices with k ≥ 2. G consists of two distinct cycles of length 2k with vertex sets {x 1 , . . . , x 2k } and {y 1 , . . . , y 2k }, a vertex v that is connected to exactly one vertex in each cycle and a vertex w that is only connected to vertex v. The oriented edges are as follows: Then, f is a {0, k}-magic labeling of G with magic constant 4k + 2 and vertex w has outdegree zero. Figure 1 provides an example of this construction when k = 2. In the remainder of this section, we discuss properties of the magic constants. Contrary to the fact that the magic constant for an undirected graph is unique, the D-magic constant does not have to be the same for any given oriented graph. The proof of the uniqueness in [15] relies on the fact that the graph's adjacency matrix is the same as its transpose which does not occur for oriented graphs. The example in Figure 2 shows two different magic constants for the same oriented graph. In the next theorem, we provide tight lower and upper bounds for the magic constants of an oriented graph.

Theorem 2.
If G is a D-magic oriented graph with magic constant k and n ≥ 3, Proof. First, we will show the magic constant cannot be less than 5. Suppose k < 5. Let v i be the vertex with label i.
• If k = 1 and 0 ∈ D then w(v 2 ) ≥ 2 and thus v 2 would not have the magic constant as its weight. Thus, 0 ∈ D, but then there is no way for w(v 1 ) = 1. • If k = 2 and 0 ∈ D, w(v 1 ) = 2. Thus, 0 ∈ D, but then w(v 2 ) = 2 as there are no sums of the remaining vertex labels that would total to two.
and v 2 → v 1 , creating a bidirectional edge. Since 0 ∈ D, we would have that v 3 would need to be some distance d 1 ∈ D away from v 1 . However, v 1 would also have to be distance d 2 ∈ D away from v 3 (as this is the only way for w(v 1 ) = 3). Suppose without loss of generality that d 2 ≤ d 1 . If d 1 = d 2 , then d 1 > 1 and we would have a vertex x on the path from v 1 to v 3 that would be distance d 1 away from something larger than three, and thus w(x) > 3. If d 2 < d 1 , then v 1 would also be distance d 1 away from something other than v 3 , giving w(v 1 ) > 3. Thus, in all cases, we arrive at a contradiction.  In the following theorem, we construct a {1}-magic oriented graph of order n for each value of k from 5 up to n. Theorem 3. For 5 ≤ k ≤ n, n ≥ 5, there exists an oriented graph G of order n which is {1}-magic with magic constant k. Figure 3 gives the construction technique for any n. All vertices with labels between 2 and k − 2 are directed towards the vertex labeled k. All vertices with labels between k + 1 and n are also directed towards the vertex labeled k. The vertex with label k can be directed towards the vertices labeled 1 and k − 1. Finally, the vertices 1 and k − 1 are directed towards the vertices labeled 2 and k − 2.  Proof. Suppose a tree has a least one edge directed away from the sink. Suppose this edge goes from vertex v to vertex u. Then, vertex u must have at least one edge that is directed outward (otherwise u would also be a sink) and away from the sink, to some new vertex w. This new vertex, w, would also have an edge directed outward and away from the sink. This would continue at each new vertex in this outward directed path until we reach a leaf. However, then this leaf would have outdegree zero, a contradiction. Thus, all edges must be directed toward the sink. Proof. Suppose there is an oriented tree that is D-magic. By Lemma 1, any D-magic tree can have at most one vertex of outdegree zero, and since any oriented tree has at least one vertex of outdegree zero, we know the tree will have exactly one vertex of outdegree zero, say vertex v. If the tree contains only one vertex of outdegree zero, than all edges must be directed towards that vertex by Lemma 2. This oriented tree will have a path of longest length, say length d. We know 0 ∈ D, but we also know d ∈ D as this would cause the weight of some vertex to be greater than n. In addition, no value less than d can be in D as this would allow a vertex on that longest path to have a weight greater than n. Finally, there are no paths of length greater than d, so no other values can be added to D. Hence, the only possible element in D is 0, but that does not create a D-magic graph. Thus, no orientation of trees are D-magic for any set D.

Cycles
Lemma 3. If an oriented cycle is D-magic, then the orientation must be unidirectional.
Proof. By Lemma 1, any oriented cycle can have at most one vertex of outdegree zero. Hence, the only orientations which would satisfy this would be the unidirectional cycle (with no vertices of outdegree zero) or the cycle where there is a source and a sink with two unidirectional paths leaving the source and leading to the sink. However, this second orientation is not possible. The vertex of outdegree zero must have label n. Furthermore, at least one of the two vertices coming into that vertex must have outdegree one (otherwise we would have two vertices of outdegree zero); let that vertex be v. Then, v is at distance one from the vertex with label n and that is its only out-neighbor. Hence, any contributions to the weight of that vertex will come from values that are at distance zero or one away. However, this is a problem as the magic constant must be n, 0 ∈ D, and we know at least one other number must be in D in order for vertex v to have a sum equal to n, but the only other possibility to add to D to increase the weight of v is to add one to D, but this makes the weight of v greater than n. Hence a D-magic labeling of this orientation is not possible and thus the only orientations of a cycle that are D-magic are unidirectional.

Theorem 5.
There exist D such that − → C n is D-magic for all n ≥ 3. In particular, let d 1 , d 2 , . . . , d r be the divisors of n. If ∃ k ∈ N such that n(n + 1) = 2d i k and k ≥ n, then − → C n is D-magic with Proof. For any cycle, − → C n , D = {0, 1, . . . , n − 1} will give a D-magic graph with magic constant n(n + 1)/2 as at any vertex, all labels will be counted in the sum.
Let d i be a divisor of n.
. . , v n−1 is the vertex set of C n , we can partition this set into d i sets, P 1 , P 2 , . . . , P d i , each of size n/d i , where P 1 = {v 0 , v d i , v 2d i , . . . , v (n/d i −1)d i } and P j is formed by adding j − 1 (modulo n) to each of the subscripts of the entries of P 1 . Since this partitions the set n into d i sets and n(n + 1) = 2d i k for some k ≥ n ∈ N, by Theorem 1, we know there is a way to label the vertices with values from {1, . . . , n} so that the sum of the labels of each of these vertex sets is the same.

OpenQuestion 5. Find all Ds s.t.
− → C n is D-magic. This would give a sum of 2m + 1 for each set of pairs. Then, orient the edges in the following way: vertices in α i will be oriented to vertices in the sets β i , β i+1 , . . . , β m 4 +i−1 and vertices in β i will be oriented to vertices in the sets α i+1 , . . . , α m 4 +i where all additions are done modulo m/2. Thus, each vertex is oriented towards m/4 pairs of vertices and hence each vertex is oriented towards m/2 vertices. This gives a total of 2 · m 4 · 2m = m 2 edges and thus each edge is accounted for and has only one orientation. This gives a magic constant of k = m 4 (2m + 1) for any D ∈ {{0, 4}, {1}, {2}, {3}}. The magic constant would be 2k for any union of two sets, 3k for any union of three sets, and 4k = m(2m + 1) = n(n + 1)/2 for the union of all four sets. Figure 4 gives an example of this labeling when m = 4. Theorem 7. (a) Let s ≥ 3 be odd and n ≥ 5. If n(n + 1) = 2st and t ≥ n, then there exists a partition of n into s parts such that n = n 1 + n 2 + · · · + n s and K n 1 ,n 2 ,...,n s has an orientation that is {1}-magic with magic constant (s−1)t 2 , {2}-magic with magic constant (s−1)t 2 , and {1, 2}-magic with magic constant (s − 1)t.
Proof. Let u o , u 1 , . . . , u s be the vertices of K s . We decompose K s into Hamiltonian cycles using Walecki's construction where each cycle starts at u 0 [18]. Then, orient each cycle in a clockwise direction starting at the vertex u 0 . This will give each vertex (s − 1)/2 edges directed outward and (s − 1)/2 edges directed inward. Then, we replace each vertex of K s with n i vertices for 1 ≤ i ≤ s and maintain all the original connections. For example, in K s , u 0 would be connected to u 1 and so in our newly constructed graph, all the vertices now at u 0 would be connected to all the vertices now at u 1 . Using Theorem 1, we label the vertices of each new set of replaced vertices with values so that each new set of vertices has the same sum, t.
Thus, every vertex will be at distance one away from (s − 1)/2 sets of vertices and each set sums to t, giving a {1}-magic constant of (s − 1)t/2. Similarly, since every vertex in a oriented complete graph is at distance one or two away from any other vertex, we also have that every vertex will be at distance two away from (s − 1)/2 sets of vertices and each set sums to t, giving a {2}-magic constant of (s − 1)t/2. Finally, since all vertices are at distance one or two away from each other, the {1, 2}-magic constant is (s − 1)t.
In a similar way, we can decompose K s − I into s 2 − 1 Hamiltonian cycles using Walecki's construction where each cycle starts at u 0 [18]. Then, orient each cycle in a clockwise direction starting at the vertex u 0 . This gives each vertex s 2 − 1 edges directed outward. Then, we replace each vertex of K s with n i vertices for 1 ≤ i ≤ s and maintain all the original connections. In this case, every vertex will be at distance one away from s 2 − 1 sets of vertices and each set sums to t, giving a {1}-magic constant of (s − 2)t/2. Similarly, since every vertex in this orientation of K s − I is at distance one or two away from any other vertex, we also have that every vertex is at distance two away from s/2 sets of vertices and each set sums to t, giving a {2}-magic constant of (st)/2. Finally, since all vertices are distance one or two away from each other, the {1, 2}-magic constant is (s − 1)t.

Conclusions
As can be seen by the questions posed, the study of D-magic oriented graphs is rich with future directions. One possible avenue of additional research is to determine for a given arbitrary oriented graph which D sets make the graph D-magic. Conversely, one could start with a given D set and ask which oriented graphs are D-magic.
Exploring the symmetries between oriented D-magic graphs and D-magic graphs, we see that both have trivial D sets that produce a D-magic labeling (when diam(G) < ∞ and D = {0, 1, 2, . . . , diam(G)}). While trees, cycles, and multipartite graphs have been studied in both cases, the results are quite different. For example, a complete multipartite graph is not {2}-magic, but we have shown there is an orientation of various complete multipartite graphs with a {2}-magic labeling. We also know that P 3 is {1}-magic, but there is no orientation that makes it a {1}-magic oriented graph. Hence, it would be worth knowing under what conditions a D-magic graph has an orientation that is also D-magic.
Similarly, while the magic constant is unique in the unoriented case, the magic constant does not have to be unique in the oriented case. While we did not allow for bidirectional edges, if bidirectional edges were allowed, any D-magic graph could be oriented to be D-magic by replacing each edge with a bidirectional edge. Exploring these symmetries further is also an interesting line of future work.

Conflicts of Interest:
The authors declare no conflict of interest.