International Journal of Mechanical Engineering and Technology (IJMET) Volume 9, Issue 2, February 2018, pp. 601 614 Article ID: IJMET_09_02_061 Available online at http://www.iaeme.com/ijmet/issues.asp?jtype=ijmet&vtype=9&itype=2 ISSN Print: 0976-6340 and ISSN Online: 0976-6359 IAEME Publication Scopus Indexed MATLAB PROGRAM FOR ENERGY OF EVEN SUM CORDIAL GRAPHS S. Abhirami Assistant Professor, Department of Mathematics, Sona College of Technology, Salem, Tamil Nadu, India R. Vikramaprasad Assistant Professor, Department of Mathematics, Government Arts College, Salem - 636 007, Tamil Nadu, India ABSTRACT In this paper, we have newly constructed three different algorithms for energy of even sum cordial graph by using MATLAB Version 2017b. In this connection, we compute the Laplacian energy of even sum cordial graph. Keywords: MAT LAB Program; Energy of Even sum cordial graph; Laplacian Energy of Even sum cordial graph. AMS Classification: 05C50 Cite this Article: S. Abhirami and R. Vikramaprasad, MATLAB Program for Energy of Even sum Cordial Graphs, International Journal of Mechanical Engineering and Technology 9(2), 2018. pp. 601 614. http://www.iaeme.com/ijmet/issues.asp?jtype=ijmet&vtype=9&itype=2 1. INTRODUCTION By a simple graph for definitions we refer to Harary [7]. The origin of graph labeling can be attributed to Rosa[9]. In [3,4], Cahit introduced the concept of cordial labeling of graph. Energy and Laplacian energy of the graph G we refer Gutman [6,12]and Balakrishnan[2]. S.Abhirami et al., was introduced Even Sum cordial graph and their energy[1,5].energy of graph was found by Sangeeta Gupta and Sweta Srivastav using MATLAB[10]. In this paper, we have newly constructed three different algorithms for energy of even sum cordial graph by using MATLAB Version 2017b. In this connection, we compute the Laplacian energy of even sum cordial graph. 2. PRELIMINARIES Definition 2.1: [5] Even sum cordial graph Let G= (V, E) be a simple graph and f: V {1, 2, 3. } be a bijection. For each edge uv, assign the label 1 if f (u) +f (v) is even and the label 0 otherwise. f is called an even sum http://www.iaeme.com/ijmet/index.asp 601 editor@iaeme.com
S. Abhirami and R. Vikramaprasad cordial labeling if ( ) ( ), where ( ) and ( ) denote the number of edges labeled with 1 and not labeled with 1 respectively. Proposition 2.2: [5] Any path is an even sum cordial graph. Any cycle C n is an even sum cordial graph except n = 6, 6 + d, 6 +2d, when d=4. Definition 2.3: [2,6]Energy of a graph If G is a graph on n vertices and, are its eigen values, then the sum of absolute value of Eigen values of a graph is called energy of a graph G. i.e., E (G) =. Definition 2.4: [6] Laplacian Energy The Laplacian matrix of an (m,n) graph G is defined as L(G)= ( ) ( ), where A is the adjacency matrix and is the diagonal matrix whose diagonal elements are the vertex degree. The Eigen values of Laplacian matrix are. Definition 2.5: [1] Matrix of even sum cordial graph Let G = (V, E) be an Even sum cordial graph with n vertices and m edges. We define a matrix of even sum cordial graph G by { ( ) ( ) ( ) ( ) The characteristic polynomial of the labeled matrix of G is defined by ( ( ) ) [ ( )] Where I is the unit matrix of order n.the roots of the matrix ( ) are,. The roots of the characteristic polynomial ( ( ) ) are called Eigen values of G. Definition 2.6: [1] Energy of Even sum cordial graph The sum of absolute value of Eigen values of even sum cordial graph is called energy of even sum cordial graph G. ie., E(G) =,where n denotes the number of vertices of G. 3. ALGORITHMS Algorithm 3.1: To generate the MATLAB program for finding the energy of Even sum cordial path graph. Function energy= path(n) % M is matrix for even sum cordial path graph % LM is Laplacian matrix for even sum cordial path graph % EV is Eigen values of even sum cordial path graph % E is Energy of even sum cordial path graph % MU is Laplacian eigen values of even sum cordial path graph http://www.iaeme.com/ijmet/index.asp 602 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs % LE is Laplacian Energy of even sum cordial path graph clc a=[]; v=[]; adj=[]; e=[]; w=[];m=[];d=[]; if (rem(n,4)==0) while i<=n-3 y= reshape(a.',1,[]); j=1; for i=1:2:n v(j)=y(i);e(j)=y(i+1);j=j+1; if (rem(n,4)==1) while i<=n-4 y= reshape(a.',1,[]);len =length(y); y(len+1)=n; j=1; for i=1:2:n-1 v(j)=y(i); e(j)=y(i+1); j=j+1; http://www.iaeme.com/ijmet/index.asp 603 editor@iaeme.com
S. Abhirami and R. Vikramaprasad G =addedge(g,y(n-1),y(n)); if (rem(n,4)==2) while i<=n-5 y= reshape(a.',1,[]);len =length(y); y(len+1)=n-1;y(len+2)=n; j=1; for i=1:2:n-2 v(j)=y(i);e(j)=y(i+1);j=j+1; adj(i-1,i)=1; adj(i,i-1)=1; w(i-1)=0 G =addedge(g,y(n-2),y(n-1)); G = addedge(g,y(n-1),y(n)); if (rem(n,4)==3) while i<=n-6 y= reshape(a.',1,[]); len =length(y); y(len+1)=n-2;y(len+2)=n; y(len+3)=n-1; j=1; for i=1:2:n-3 v(j)=y(i); e(j)=y(i+1);j=j+1; http://www.iaeme.com/ijmet/index.asp 604 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs adj(i-1,i)=1; adj(i,i-1)=1; w(i-1)=0 G =addedge(g,y(n-3),y(n-2)); G =addedge(g,y(n-2),y(n-1)); G = addedge(g,y(n-1),y(n)); for i = 1 : n adj(i,i)=1;d(i,i)=degree(g,i); M=adj-ones; LM=D-M; EV=eig(M); E=sum(abs(EV)) LEV = eig(lm); MU = LEV-(2*(n-1)/n); LE = sum(abs(mu)) title(['path graph for n =' num2str(n)]) gtext({'energy =', num2str(e); 'Laplacian Energy=',num2str(LE)}) To illustrate above program see below example. In command window write path (8), then press enter, the output will be http://www.iaeme.com/ijmet/index.asp 605 editor@iaeme.com
S. Abhirami and R. Vikramaprasad Algorithm 3.2: To generate the MATLAB program for finding the energy of Even sum cordial cycle graph. function energy=cycle(n) % M is matrix for even sum cordial cycle graph % LM is Laplacian matrix for even sum cordial cycle graph % EV is Eigen values of even sum cordial cycle graph % E is Energy of even sum cordial cycle graph % MU is Laplacian eigen values of even sum cordial cycle graph % LE is Laplacian Energy of even sum cordial cycle graph clc a=[]; v=[]; adj=[]; e=[]; e1=[]; w=[];m=[];d=[]; if (rem(n,4)==0) while i<=n-3 a(x,:)=[i,i+2,i+1,i+3];x=x+1; i=i+4; y= reshape(a.',1,[]); j=1; for i=1:2:n v(j)=y(i); e(j)=y(i+1); j=j+1; G=addedge(G,y(1),y(n)); if mod((y(1)+y(n)),2)== 0 adj(1,n)=2; adj(n,1)=2; w(length(y))=1; adj(1,n)=1; adj(n,1)=1; w(length(y))=0; if (rem(n,4)==1) http://www.iaeme.com/ijmet/index.asp 606 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs while i<=n-4 y= reshape(a.',1,[]);len =length(y); y(len+1)=n; j=1; for i=1:2:n-1 v(j)=y(i);e(j)=y(i+1);j=j+1; G =addedge(g,y(n-1),y(n)); G=addedge(G,y(1),y(n)); if mod((y(1)+y(n)),2)== 0 adj(1,n)=2; adj(n,1)=2; w(length(y))=1; adj(1,n)=1; adj(n,1)=1; w(length(y))=0; if (rem(n,4)==2) while i<=n-5 y= reshape(a.',1,[]); len =length(y); y(len+1)=n-1;y(len+2)=n; j=1; for i=1:2:n-2 v(j)=y(i);e(j)=y(i+1);j=j+1; http://www.iaeme.com/ijmet/index.asp 607 editor@iaeme.com
S. Abhirami and R. Vikramaprasad G =addedge(g,y(n-2),y(n-1));g = addedge(g,y(n-1),y(n)); G=addedge(G,y(1),y(n)); if mod((y(1)+y(n)),2)== 0 adj(1,n)=2; adj(n,1)=2; w(length(y))=1; adj(1,n)=1; adj(n,1)=1; w(length(y))=0; if (rem(n,4)==3) while i<=n-6 y= reshape(a.',1,[]);len =length(y); y(len+1)=n-2;y(len+2)=n;y(len+3)=n-1; j=1; for i=1:2:n-3 v(j)=y(i); e(j)=y(i+1);j=j+1; G =addedge(g,y(n-3),y(n-2));g =addedge(g,y(n-2),y(n-1)); G = addedge(g,y(n-1),y(n));g=addedge(g,y(1),y(n)); if mod((y(1)+y(n)),2)== 0 adj(1,n)=2; adj(n,1)=2; w(length(y))=1; http://www.iaeme.com/ijmet/index.asp 608 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs adj(1,n)=1; adj(n,1)=1; w(length(y))=0; for i = 1 : n adj(i,i)=1; D(i,i) = degree(g,i); M=adj-ones; LM=D-M; EV=eig(M); E=sum(abs(EV)) LEV = eig(lm); MU = LEV-2; LE = sum(abs(mu)) title(['cycle graph for n =' num2str(n)]) gtext({'energy =', num2str(e); 'Laplacian Energy=',num2str(LE)}) To illustrate above program see below example. In command window write cycle(6), then press enter, the output will be Algorithm 3.3: To generate the MATLAB program for finding the energy of Even sum cordial P n + K 1 graph. function energy= pnk(n) % M is matrix for even sum cordial graph % LM is Laplacian matrix for even sum cordial graph % EV is Eigen values of even sum cordial graph http://www.iaeme.com/ijmet/index.asp 609 editor@iaeme.com
S. Abhirami and R. Vikramaprasad % E is Energy of even sum cordial graph % MU is Laplacian eigen values of even sum cordial graph % LE is Laplacian Energy of even sum cordial graph clc a=[]; v=[]; adj=[]; e=[]; w=[];m=[];d=[]; if (rem(n,4)==0) while i<=n-3 y= reshape(a.',1,[]) y(n+1)= n+1; j=1; for i=1:2:n v(j)=y(i); e(j)=y(i+1); j=j+1; -1 for i =1 : length(y)-1 G =addedge(g,y(i),y(n+1)); for i=1 : length(y)-1 if mod((y(i)+y(n+1)),2)== 0 adj(i,n+1)=2; adj(n+1,i)=2; adj(n+1,i)=1; adj(i,n+1)=1; if (rem(n,4)==1) while i<=n-4 http://www.iaeme.com/ijmet/index.asp 610 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs y= reshape(a.',1,[]); len =length(y);y(len+1)=n; y(n+1)= n+1;j=1; for i=1:2:n-1 v(j)=y(i); e(j)=y(i+1); j=j+1; G =addedge(g,y(n-1),y(n)); for i =1 : length(y)-1 G =addedge(g,y(i),y(n+1)); for i=1 : length(y)-1 if mod((y(i)+y(n+1)),2)== 0 adj(i,n+1)=2; adj(n+1,i)=2; adj(n+1,i)=1; adj(i,n+1)=1; if (rem(n,4)==2) while i<=n-5 a(x,:)=[i,i+2,i+1,i+3]; x=x+1; i=i+4; y= reshape(a.',1,[]);len =length(y); y(len+1)=n-1;y(len+2)=n; y(n+1)= n+1;j=1; for i=1:2:n-2 v(j)=y(i); e(j)=y(i+1); j=j+1; http://www.iaeme.com/ijmet/index.asp 611 editor@iaeme.com
S. Abhirami and R. Vikramaprasad adj(i-1,i)=1; adj(i,i-1)=1; w(i-1)=0 G =addedge(g,y(n-2),y(n-1)); G = addedge(g,y(n-1),y(n)); for i =1 : length(y)-1 G =addedge(g,y(i),y(n+1)); for i=1 : length(y)-1 if mod((y(i)+y(n+1)),2)== 0 adj(i,n+1)=2; adj(n+1,i)=2; adj(n+1,i)=1; adj(i,n+1)=1; if (rem(n,4)==3) while i<=n-6 a(x,:)=[i,i+2,i+1,i+3]; x=x+1; i=i+4; y= reshape(a.',1,[]); len =length(y);y(len+1)=n-2; y(len+2)=n; y(len+3)=n-1;y(n+1)= n+1; j=1; for i=1:2:n-3 v(j)=y(i); e(j)=y(i+1); j=j+1; adj(i-1,i)=1; adj(i,i-1)=1; w(i-1)=0 http://www.iaeme.com/ijmet/index.asp 612 editor@iaeme.com
MATLAB Program for Energy of Even sum Cordial Graphs G =addedge(g,y(n-3),y(n-2)); G =addedge(g,y(n-2),y(n-1)); G = addedge(g,y(n-1),y(n)); for i =1 : length(y)-1 G =addedge(g,y(i),y(n+1)); for i=1 : length(y)-1 if mod((y(i)+y(n+1)),2)== 0 adj(i,n+1)=2; adj(n+1,i)=2; adj(n+1,i)=1; adj(i,n+1)=1; for i = 1 : n+1 adj(i,i)=1; D(i,i)=degree(G,i); M=adj-ones; LM=D-M; EV=eig(M); E=sum(abs(EV)) LEV = eig(lm); MU = LEV-(2*(n-1)/n); LE = sum(abs(mu)) title(['pn+k1 graph for n =' num2str(n)]) gtext({'energy =', num2str(e); 'Laplacian Energy=',num2str(LE)}) http://www.iaeme.com/ijmet/index.asp 613 editor@iaeme.com
S. Abhirami and R. Vikramaprasad 4. CONCLUSION: In this paper, we discussed MAT LAB program to find the energy of even sum cordial graph and Laplacian energy of even sum cordial graph. These programs provide here to find the energy of even sum cordial graph is very easy task for any big value of n, manually which is very difficult. REFERENCES [1] S. Abhirami, R. Vikramaprasad,R. Dhavaseelan, Energy of even sum cordial graph, International Journal of Mechanical Engineering and Technology Volume 9, (2018) 1096--1101. [2] R. Balakrishnan, The energy of a graph, Lin. algebra Appl. 387 (2004), 287--295. [3] I. Cahit. Cordial graphs: A weaker version of graceful and harmonious graph. Ars, combinatorial l23 (1987), 201 -- 207. [4] I. Cahit. On Cordial and 3-Equitable Labeling of Graph. Utilitas Math, 370(1990),189-198 [5] R. Dhavaseelan, R. Vikramaprasad and S. Abhirami. A New Notions Of Cordial Labeling Graphs, Global Journal Of Pure And Applied Mathematics,11(4)(2015)1767--1774 [6] I.Gutman, The energy of a graph, Ber. Math. Statist. Sekt. Forschungsz. Graz, 103(1978)1--22. [7] F. Harary, Graph Theory, Addition-Wesley, Reading Mass, 1972. [8] J. A. Gallian, A dynamic survey of graph labeling, Electronic Journal of Combinatorics, (2010), DS6. [9] A. Rosa; On certain valuations of the vertices of a graph, Theory of Graphs International Symposium Rome, (1996), 349--355. [10] Sangeeta Gupta, Sweta Srivastav, MATLAB Program for Energy of Some Graphs, International Journal of Applied Engineering Research ISSN 0973-4562 Volume 12, (2017) 10145--10147 [11] Stephen J. Chapman, MATLAB programming for engineers, Chris Carson, Thomson Corporation(2008) [12] H.B Walikar, I Gutman, P.R Hampiholi, H.S Ramane, Graph Theory Notes New York Acad. Sci., 41 (2001), pp. 14--16. [13] R R Mandal and U K Dewangan Finite Element Modeling of Beam with Eight Noded Brick Element Using Matlab, International Journal of Civil Engineering and Technology, 8(5), 2017, pp. 646 656. [14] Dr. B. H. Jain, Mr. M.M. Ansari and Vikas Pralhad Patil, Evaluate PV Panel Performance Enhancement with Matlab. International Journal of Electrical Engineering & Technology, 6(7), 2015, pp. 23-37 [15] Mahra Pratap Singh and Dr. Anil Kumar Sharma, Eyes Detection Using Morphological Image Processing Through Matlab, International Journal of Advanced Research in Engineering and Technology (IJARET), Volume 4, Issue 7, November - December 2013, pp. 139-146 [16] P Sridhar, K Bhanu Prasad, Fault Analysis in Hydro Power Plants Using Matlab/Simulink, International Journal of Electrical Engineering & Technology (IJEET), Volume 5, Issue 5, May (2014), pp. 89-99 http://www.iaeme.com/ijmet/index.asp 614 editor@iaeme.com