A Heuristic for Distance Magic Labeling (PDF Download Available)

5 downloads 7949 Views 365KB Size Report
Article (PDF Available) in Procedia Computer Science 74:100-104 · December 2015 with 57 Reads ... A distance magic labeling of a graph G with magic constant k is a bijection λ from the V(G) into ..... Number of edges in degree-magic graphs.
Available online at www.sciencedirect.com

ScienceDirect Procedia Computer Science 74 (2015) 100 – 104

International Conference on Graph Theory and Information Security

A Heuristic for Distance Magic Labeling Fuad Yasina , Rinovia Simanjuntakb a Department

of Computational Science, Faculty of Mathematics and Natural Sciences, Institut Teknologi Bandung, Jalan Ganesha 10, Bandung 40132, Indonesia b Combinatorical Mathematics Research Group, Institut Teknologi Bandung, Jalan Ganesha 10, Bandung 40132, Indonesia

Abstract A distance magic labeling of a graph G with magic constant k is a bijection λ from the V(G) into {1, 2, . . . , |V(G)|}, such that  λ(u) = k for every vertex v. Here we present a heuristic algorithm for finding distance magic graphs and utilise it to find all

u∈N(v)

distance magic graphs with at most 9 vertices. c 2015  2015Published The Authors. Published by Elsevier B.V. © by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the Organizing Committee of ICGTIS 2015. Peer-review under responsibility of the Organizing Committee of ICGTIS 2015 Keywords: Distance magic labeling, heuristic, simulated annealing. 2010 MSC: 05C78, 05C85

1. Introduction Here we assume that G=G(V, E) is a finite, simple, and undirected graph with v vertices and e edges. The notion of distance magic labeling was introduced separately in the PhD thesis of Vilfred [11] in 1994 and an article by Miller, Rodgers, and Simanjuntak [7] in 2003. A distance magic labeling, or Σ labeling, of a graph G is a bijection f : V → {1, 2, . . . , v} with the property that there is a constant k such that at any vertex x, wt(v) =  y∈N(x) f (y) = k, where N(x) is the open neighborhood of x, i.e., the set of vertices adjacent to x. Distance antimagicness of several family of graphs has been studied over the years, some of the results are the following. Theorem 1. [7] (a) The path Pn is a distance magic graph if and only if n = 1 or n = 3. (b) The cycle Cn is a distance magic graph if and only if n = 4. (c) The complete graph Kn is a distance magic graph if and only if n = 1. (d) The wheel Wn is a distance magic graph if and only if n = 4. (e) A tree T is a distance magic graph if and only if T = P1 or T = P3 . E-mail address: [email protected]

1877-0509 © 2015 Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the Organizing Committee of ICGTIS 2015 doi:10.1016/j.procs.2015.12.083

Fuad Yasin and Rinovia Simanjuntak / Procedia Computer Science 74 (2015) 100 – 104

Theorem 2.

[5,7,9,11]

Let G be an r-regular distance magic graf of order v. Then, k =

101

r(v+1) 2 .

It was proved in [11] that every graph is a subgraph of a distance magic graph. A stronger result that every graph is an induced subgraph of a regular distance magic graph was then proved in [1] . A yet stronger result can also be found in [10] where it is stated that every graph H is an induced subgraph of a Eulerian distance magic graph G where the chromatic number of H is the same as G. All these results showed that there is no forbidden subgraph characterization for distance magic graph. Additionally, an application of the labeling in designing incomplete tournament is introduced in [4] . For more results, please refer to a survey article in [2] . Although many significant results in distance magic labelings have been produced by many researchers, there is no algorithmic approach known so far. In this paper, we shall modify the labeling algorithm introduced by Bertault et al. [3] , which was constructed to search for vertex-magic and edge-magic total graphs. Their algorithm and ours shall be presented in Section 2. In Section 3 we shall list all distance magic graphs on up to 9 vertices, all of which were found by utilising our algorithm. 2. Algorithm An edge magic total labeling on a graph G is a one-to-one map λ from V ∪ E onto the integers 1, 2, . . . , v + e with the property that for any edge xy, there is a constant k with wt(xy) = λ(x) + λ(xy) + λ(y) = k. A vertex magic total labeling on a graph G is a one-to-one map λ from V ∪ E onto the integers 1, 2, . . . , v + e with the property that there is  a constant k such that for every vertex x, wt(x) = λ(x) + λ(xy) = k. Bertault, Miller, Perez-Roses, Feria-Puron, and y∼x

Vaezpour [3] utilised a simulated annealing method to search for edge magic and vertex magic labelings of a particular graph. Their algorithm is presented in the following, where V(G) = {x1 , x2 , . . . , xv } and the labeling matrix L(G) is a v × v matrix whose (i, i) entry is λ(xi ) and (i, j) entry is λ(xi x j ). Step 1: Initialize L(G), Set η ← 0, Set wtmin ← max{x | x ∈ R and x < ∞}; Step 2: Calculate the weight wtλ , Evaluate  λ by calculating the standard deviation of weight array wt, n n  1  σ(wt) = (wti − μ(wt))2 , where μ(wt) = 1n wti ; n i=1

i=1

Step 3: If σ(wt) ≤ σ(wtmin ), then set wtmin ← wt, set L(Gmin ) ← L(G), and set η ← 0; If σ(wt) > σ(wtmin ), then set η ← η + 1; 1 and random(0, 1) < n(n−1) , If η > n(n−1) 2 then set wtmin ← wt, set L(Gmin ) ← L(G), and set η ← 0; Step 4: If σ(wt) = 0, then λ is a magic labeling, the process end here. If σ(wt)  0, then L(G) = L(Gmin ), Choose a, b, c, d ∈ {1, 2, . . . , n + m} randomly, va , vb , vc , vd ∈ V, λ(va vb ) = λ(va ) if a = b, Swap λ(va vb ) with λ(vc vd ), Go back to step 2.

We modified the afore-mentioned algorithm for finding distance magic labeling. We shall use the same parameters p = m(m − 1)/2 and q = 2/p. Since distance magic labeling is a vertex labeling, L(G) is a v × v diagonal matrix; therefore to preserve memory we shall use a labeling array L(G) = (λ(x1 ), λ(x2 ), . . . , λ(xv )).

102

Fuad Yasin and Rinovia Simanjuntak / Procedia Computer Science 74 (2015) 100 – 104

Our approach could be divided into two algorithms: Algorithm 1 which evaluates whether a labeling is distance magic and Algorithm 2 which is a heuristic for finding distance magic labelings. Algorithm 1 Evaluate λ function evaldistanceMagic(L(G)) for i ← 1 to n do for j ← 1 to n do wti ← wti + λ(xi )mi, j end for end for return STDDEV(wt) end function

 Standard deviation of weight wt

Algorithm 2 Search distance magic labelings p ← m(m − 1)/2 q ← 2/p for i ← 1 to n do λG (xi ) ← i end for k ← EVALDISTANCEMAGIC(L(G)) η←0 while (k  0) do r1 ← RANDINT(n) r2 ← RANDINT(n) L(β) ← L(G) λβ (xr1 ) ← λG (xr2 ) λβ (xr2 ) ← λG (xr1 ) c ← EVALDISTANCEMAGIC(L(β)) if (c ≤ k) then η←0 L(G) ← L(β) k←c else if (η > p) and (RANDOM(0, 1) ≤ q) then η←0 L(G) ← L(β) k←c else η←η+1 end if end if end while

3. All Distance Magic Graphs of Order Up To 9 By using geng, which is a part of nauty program [6] , we generate all non-isomorphic graphs on at most 9 vertices. We then utilise our algorithms to find all distance magic labelings for each of the graphs. The computer specification and operating system we used are as follows. • • • •

CentOS 6.5 64-bit Linux operating system. i7 series Intel processor with 8 CPUs @2GHz. 24GB RAM. 8GB swap space.

All distance magic graphs of order 7, 8, and 9 are presented in the following figures.

103

Fuad Yasin and Rinovia Simanjuntak / Procedia Computer Science 74 (2015) 100 – 104

Table 1. Enumeration of distance magic graphs on v vertices, 2 ≤ v ≤ 9. v

# non-isomorphic graphs

maximal iteration

processing time

1 2 3 4 5 6 7 8 9

1 2 4 11 34 156 1044 12346 275668

400 900 1600 2500 3600 4900 6400 8100

0.183 sec 0.302 sec 0.868 sec 2.670 sec 18 sec 203 sec 2681 sec 76095 sec

# distance magic graphs 1 1 2 2 2 2 4 6 6

Fig. 1. Distance magic graphs of order 7.

Fig. 2. Distance magic graphs of order 8.

Acknowledgement. This research was partially supported by ”Program Riset dan Inovasi KK-ITB” 2015, Institut Teknologi Bandung.

104

Fuad Yasin and Rinovia Simanjuntak / Procedia Computer Science 74 (2015) 100 – 104

Fig. 3. Distance magic graphs of order 9.

References 1. Acharya BD, Rao SB, Singh T, Parameswaran V. Neighborhood magic graphs. Proc. Nat. Conf. Graph Theory Combin. Algorithm 2004. 2. Arumugam S, Froncek D, Kamatchi N. Distance Magic Graphs - A Survey, J. Indones. Math. Soc. Special Edition 2011: 11-26. 3. Bertault F, Feria-Puron R, Miller M, Perez-Roses H, Vaezpour E. A heuristic for magic and antimagic graph labellings, in: Proc. VII Spanish Congress on Metaheuristics and Evolutive and Bioinspired Algorithms 2010: 677-684. 4. Froncek D, Kovar P, Kovarova T. Fair incomplete tournaments. Bull. Inst. Combin. App. 2006:48;31-33. 5. Jinnah MI. On Σ-labelled graphs, in Technical Proceedings of Group Discussion on Graph Labeling Problems, eds. B.D. Acharya and S.M. Hedge 1999: 71-77. 6. McKay BD, Piperno A. Practical Graph Isomorphism II. J. Symbolic Computation 2013;60:94-112. 7. Miller M, Rodger C, Simanjuntak R. Distance magic labelings of graphs. Australasian Journal of Combinatorics 2008;28:305-315. 8. Wallis WD, Marr AM, Magic Graphs. Second Edition. Birkhauser. Springer New York. 9. Rao SB. Sigma Graphs - A survey, in Labelings of Discrete Structures and Applications, eds. Acharya BD, Arumugam S, Rosa A. New Delhi: Narosa Publishing House; 2008: 135-140. 10. Rao SB, Singh T, Parameswaran V. Some sigma labelled graphs I. Graphs, Combinatorics, Algorithms and Applications 2004: 125-133. 11. Vilfred V. Σ-labelled graph and circulant Graphs. Ph.D. Thesis, University of Kerala, Trivandrum, India 1994.