Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 63 (2017) 323–332 www.elsevier.com/locate/endm
An Algorithmic Characterization of Splitting Signed Graph Deepa Sinha 1 Department of Mathematics South Asian University New Delhi, India
Anshu Sethi 2 Department of Applied Sciences The NorthCap University Gurgaon, India
Abstract A signed graph (also known as sigraph) S is a graph G where every edge y have value s (y) ∈ {−1, +1} known as its sign f unction and is denoted as S = (G , s ). Given a sigraph S = (V, E, σ), for every vertex v ∈ V (S), take a new vertex v . Join v to all vertices of S adjacent to v such that, σΛ (uv ) = σ(uv), u ∈ N (v). The sigraph Λ(S) = (VΛ , EΛ , σΛ ) thus produced is called the splitting sigraph of S. Here we define an algorithm to produce a splitting sigraph and root splitting sigraph from a given sigraph, if it exists, in O(n4 ) steps. Keywords: Algorithm, sigraph, splitting graph, splitting sigraph, root splitting sigraph
1 2
Email: deepa
[email protected] Email:
[email protected]
https://doi.org/10.1016/j.endm.2017.11.029 1571-0653/© 2017 Elsevier B.V. All rights reserved.
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
324
1
Introduction
For definitions and concepts on sigraphs refer to Zaslavsky [6]. For algorithms, refer to Golumbic [2]. Sampathkumar and Walikar [4] introduces the concept of splitting graph ˙ Λ(G) of a graph G Although, the term splitting graph is well studied in the literature, which has slight variation than the splitting graph of a graph. Sinha and Garg [5] extended the concept of splitting graphs to splitting sigraphs as: For every vertex v ∈ V (S), create a new vertex v . Join v to all vertices of S adjacent to v such that, σΛ (uv ) = σ(uv), u ∈ N (v). The sigraph so obtained Λ(S) = (VΛ , EΛ , σΛ ) of a sigraph S = (V, E, σ) is called the splitting sigraph (see Fig 1) of S. A given sigraph S is a splitting sigraph if it is isomorphic to the splitting sigraph Λ(T ) of a sigraph T . Here T is called the root splitting sigraph of S. w' w
x
w
x x' v'
v
u
u
v
u' S
H
Fig. 1. Showing splitting sigraph H = Λ(S) of a sigraph S
2
Numerical Interpretation to obtain splitting signed graph
Consider n to be the number of vertices. An n×n symmetric adjacency matrix is encoded with respect to given sigraph. Since, for every vertex, another new vertex is created therefore, splitting sigraph will have ‘2n’ number of vertices. Starting from first row, find all non-zero entries in row 1. These non-zero entries denotes the vertex adjacent to vertex 1. Now these entries are also adjacent to to (n + 1) vertex and we update the output matrix. Similarly we calculate for each row till all rows are traversed. Thus, output matrix of order 2n × 2n is created.
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
325
It is observed that splitting sigraph of a given sigraph of order 2n × 2n can be divided into 4 equal n × n matrices such that first three matrices are identical and fourth matrix is always zero. ⎤ ⎡ 0 −1 0 1 0 −1 0 1 ⎥ ⎢ ⎥ ⎢ ⎢−1 0 −1 0 −1 0 −1 0 ⎥ ⎥ ⎢ ⎤ ⎡ ⎥ ⎢ ⎢ 0 −1 0 −1 0 −1 0 −1⎥ 0 −1 0 1 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎢ 1 0 −1 0 1 0 −1 0 ⎥ ⎢−1 0 −1 0 ⎥ ⎥ ⎢ ⎥ ⎢ S=⎢ ⎥ ⎥ and H = ⎢ ⎢ 0 −1 0 1 0 0 0 0 ⎥ ⎢ 0 −1 0 −1⎥ ⎥ ⎢ ⎦ ⎣ ⎥ ⎢ ⎢−1 0 −1 0 0 0 0 0 ⎥ 1 0 −1 0 ⎥ ⎢ ⎥ ⎢ ⎢ 0 −1 0 −1 0 0 0 0 ⎥ ⎦ ⎣ 1 0 −1 0 0 0 0 0 Algorithm 1 Step 1. Input n ˙ Step 2. Input n × n matrix i.e. vertex [i] [j]. Step 3. Repeat Step 3 to Step 5 for i = 1 to 2 * n Step 4. Repeat Step 4 to Step 5 for j = 1 to 2 * n Step 5. Check if ((i > k) && (j > k)), if yes, Assign splitvertex[i][j]=0 else check if((j > k) && (i ≤ k)), if yes, Set splitvertex[i][j]= vertex[i][j-k] else check if((i > k) && (j ≤ k)), if yes, Set splitvertex[i][j]= vertex[i-k][j] else Set splitvertex[i][j]= vertex[i][j] Step 6. Print 2n * 2n output matrix i.e. splitvertex Step 7. Exit Complexity involved In Step 3 and Step 4, every vertex of the sigraph is traversed and check its adjacency with other vertices, therefore, Complexity = O(n2 ). Hence complexity is O(n2 ), where n denotes vertices in S.
3
Characterization to obtain root splitting signed graphs
The structural characterization of splitting sigraphs was given by Sinha & Garg (see Sinha et al., 2011). Theorem 3.1 [5] A connected sigraph S1 = (S1u , σ1 ) is a root splitting sigraph if and only if the following conditions hold in S1 :
326
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
(i) S1u is a splitting graph, and (ii) the vertex set V (S1 ) can be partitioned into two subsets V1 and V2 such that for every v ∈ V2 , there exists a vertex v ∈ V1 satisfying σ1 (uv ) = σ1 (uv) for each u ∈ N (v) ∩ V1 . Numerical Interpretation to detect and obtain root splitting signed graphs Input n. Vertices should be even. If ‘n’ is odd then root splitting sigraph does not exists. If ‘n’ is even then take n × n matrix corresponding to the given sigraph. Count −1(number of negative edges) and 1(number of positive edges) in the adjacency matrix. If both the counts are divisible by 3, then root splitting sigraph exists otherwise not. Calculate number of positive and negative edges for each vertex i.e. count 1 and −1 in each row. Now divide the vertex set it into two sets such that one vertex set has positive edges and negative edges exactly the double of the other vertex set. If this partition of vertices can be done, we can say that root splitting sigraph exists otherwise not. Now since root splitting sigraph exists and we know that splitting sigraph of a given sigraph of order 2n×2n can be divided into four equal n×n matrices such that first three matrices are identical and fourth matrix is always zero. Therefore, our next step will be to divide the adjacency matrix into four equal n × n matrices such that first three matrices are identical and fourth matrix is zero. To make this matrix identical and zero matrix we interchange rows and columns of the matrix. The resultant matrix will be of order n/2 × n/2. Consider a sigraph S1 whose root splitting sigraph is to be obtained. The adjacency matrix corresponding to this sigraph S1 is: ⎤ ⎡ 0 -1 0 0 0 1 ⎥ ⎢ ⎥ ⎢ ⎢-1 0 1 -1 0 1⎥ ⎥ ⎢ ⎥ ⎢ ⎢ 0 1 0 1 0 0⎥ ⎥ S1 = ⎢ ⎥ ⎢ ⎢ 0 -1 1 0 -1 1⎥ ⎥ ⎢ ⎥ ⎢ ⎢ 0 0 0 -1 0 1⎥ ⎦ ⎣ 1 1 0 1 1 0 Here input matrix is of order 6 × 6. Since number of nodes are even, therefore
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
327
root splitting sigraph can be computed. If number of nodes were odd then its root splitting graph does not exists. Now we count 1 and −1 in the adjacency matrix such that countp = 12 and countn = 6 where countp and count denotes number of 1 and −1 in the matrix. Since both the counts are divisible by 3, we can compute root splitting sigraph. Now for each vertex count 1 and −1 in each row such that: Vertex
Count of 1
Count of −1
1
1
1
2
2
2
3
2
0
4
2
2
5
1
1
6
4
0
From the table, divide vertex set into set V1 and V2 such that count of 1 and count of −1 in set V1 is exactly double of the count of 1 and −1 in set V2 . It can be easily verified that set V1 = {1, 3, 5} and V2 = {2, 4, 6}. If the partition of the vertex set can be done we say that root splitting sigraph exists otherwise not. Now our next step is to compute root splitting graph. We know that splitting sigraph of a given sigraph of order 2n × 2n can be divided into four equal n × n matrices such that first three matrices are identical and fourth matrix is always zero. Since input matrix is of order 6 × 6, therefore we now divide this matrix into four equal matrices of order 3 × 3. Next step is to make fourth matrix equal to zero matrix and first, second and third matrix should be identical. For this, we apply row and column transformations. The output matrix will be of order 3 × 3. Applying transformation such that R1 ⇔ R4 and C1 ⇔ C4, we get
328
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
Vertex
4
2
3
1
5
6
4
0
-1
1
0
-1
1
2
-1
0
1
-1
0
1
3
1
1
0
0
0
0
1
0
-1
0
0
0
1
5
-1
0
0
0
0
1
6
1
1
0
1
1
0
Applying transformation such that R3 ⇔ R6 and C3 ⇔ C6, we get Vertex
4
2
6
1
5
3
4
0
-1
1
0
-1
1
2
-1
0
1
-1
0
1
6
1
1
0
1
1
0
1
0
-1
1
0
0
0
5
-1
0
1
0
0
0
3
1
1
0
0
0
0
It is observed that first, second and third matrix are identical and fourth matrix is zero. Stop the transformation here and output matrix is: Vertex
4
2
6
4
0
-1
1
2
-1
0
1
6
1
1
0
A splitting sigraph S1 = Λ(S) is exhibited in Fig 2. Note: The algorithm to obtain splitting sigraph and root splitting sigraph can be used in encryption and decryption process of networks and images. Algorithm to detect a splitting signed graph and output its root splitting signed graph Algorithm 2
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
329
6 1
5 2
4
3
S
S1
Fig. 2. A splitting sigraph S1 and its root splitting sigraph S.
Step 1. Input n. Step 2. Check if(n % 2 ! = 0), if yes, Print “Matrix order is odd, therefore, graph cannot be splitted” and Goto Step 42 else Goto Step 3. Step 3. Input A[i][j] i.e. n × n matrix of sigraph H. Step 4. Repeat Step 4 to Step 6 for i = 1 to n Step 5. Repeat Step 5 to Step 6 for j = 1 to n Step 6. Check if (a[i][j] == 1), Set countp = countp + 1 else if (a[i][j] == −1 ), Set countn = countn + 1 Step 7. // check 1st condition Check if (countp % 3 == 0 && countn % 3 ==0), if yes, Print “Splitting sigraph is possible” else Print “Splitting sigraph not possible” and Goto Step 42 Step 8. Set countp = 0 and countn = 0 Step 9. // 2nd condition to check if root splitting sigraph exists. Repeat Step 9 to Step 12 for i = 1 to n Step 10. Repeat Step 10 to Step 11 for j = 1 to n Step 11. Check if ( a[i][j] == −1), if true, Update countn = countn + 1 else check if ( a[i][j] == 1 ), if true, Update countn = countn + 1 Step 12. Assign p[i]= countp; neg[i]=countn; boole[i]=‘F’; countp=0; countn=0 Step 13. //Division in Vertex Repeat Step 13 to Step 19 for i = 1 to n Step 14. Assign k = i Step 15. Check if (boole[k] != ‘T’), if true, Update no-found = 1 Step 16. Repeat Step 16 to Step 19 for j = i+1 to n Step 17. Check if ( p[i] == 2∗p[j] && neg[i] == 2∗neg[j] && boole[i] != ‘T’ ), if yes, Set v[i]= 2; v[j]= 1 boole[i]=‘T’ boole[j]=‘T’ no-found=0 Step 18. else check if (p[i] == p[j]/2 && neg[i] == neg[j]/2 && boole[i] != ‘T’), if yes, Set v[i]= 1 v[j]= 2 boole[i]=‘T’ boole[j]=‘T’ no-found=0
330
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
Step 19. Check if (no-found == 0), if yes, Assign j = n Step 20. Check if (no-found == 1), if yes, Print “Splitting Graph not possible as division of vertex is not proper” and Goto Step 42 Step 21. Repeat Step 21 to Step 22 for i = 1 to n Step 22. Check if (v[i] == 2), if yes, Set arrayhigher[o1]= i and o1=o1+1 else check if (v[i] == 1), if yes, Set arraylower[o2]=i and o2=o2+1 Step 23. Set j = 1 Step 24. // Applying Transformations Repeat Step 24 to Step 29 for i = 1 to n/2 Step 25. Assign val=arrayhigher[i] Step 26. Check if (val > n/2), if true, Repeat Step 27 to Step 29 while( j <= n/2 ) Step 27. Set val-lower = arraylower[j] Step 28. Check if (val-lower <= n/2), if yes, Call fun( a, val, val-lower , n ) Step 29. Set j = j+1 Step 30. // Transform rows having all 0’s to get the correct matrix Repeat Step 30 to Step 40 for i = 1 to n Step 31. Assign j = i+1 Step 32. Repeat Step 32 to Step 40 while (j <= n) Step 33. Repeat Step 33 to Step 35 for i = 1 to n Step 34. Repeat Step 34 to Step 35 for j = 1 to n Step 35. Assign bkp[i][j]=a[i][j] Step 36. Call fun(a, i, j, n) Step 37. val-return = fun-check(a, n) Step 38. Check if ( val-return == 0), if yes, Set i=n+1 and break Step 39. else Set a[i][j] = bkp[i][j] for i = 1 to n and for j = 1 to n Step 40. Update j = j+1 Step 41. Print final root splitting sigraph a[i][j] for i = 1 to n/2 and j = 1 to n/2 Step 42. Exit fun(a, r1, r2, n) Step 1. // Row Transformation Repeat Step 1 to Step 2 for i = 1 to n Step 2. Update temp = a[r1][i] a[r1][i] = a[r2][i] a[r2][i] = temp Step 3. // Column Transformation Repeat Step 3 to Step 4 for i = 1 to n Step 4. Set temp = a[i][r1] a[i][r1] = a[i][r2] a[i][r2] = temp fun-check(a, n)
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step Step
331
1. // Dividing the input matrix to 4 equal submatrices 2. // D matrix Repeat Step 2 to Step 4 for i = n/2 + 1 to n 3. Repeat Step 3 to Step 4 for j = n/2 + 1 to n 4. Set k=n / 2 d[i-k][j-k]=a[i][j] 5. // A1 matrix Repeat Step 5 to Step 7 for i = 1 to n/2 6. Repeat Step 6 to Step 7 for j = 1 to n/2 7. Set a1[i][j]=a[i][j] 8. // C matrix Repeat Step 8 to Step 10 for i = n/2 + 1 to n 9. Repeat Step 9 to Step 10 for j = 1 to n/2 10. Set k=n/2 c[i-k][j]=a[i][j] 11. // B matrix Repeat Step 11 to Step 13 for i = 1 to n/2 12. Repeat Step 12 to Step 13 for j = 1 to n/2 13. Set k=n/2 b[i][j]=a[i][k + j] 14. Repeat Step 14 to Step 16 for i = 1 to n/2 15. Repeat Step 15 to Step 16 for j = 1 to n/2 16. Check if(( a1[i][j] == b[i][j]) && (b[i][j]== c[i][j]) && (d[i][j]==0)), if yes, Set ret = 0 else return 1 Step 17. return ret Complexity involved Total count of negative and positive edges is calculated and every entry of the matrix is traversed from Step 4 to Step 6 , therefore, for checking the first condition in Step 7,Complexity = O(n2 ). The vertex set is divided it into two equal vertex sets in Step 13 to Step 19 such that one vertex set has exactly double number of positive and edges in the other vertex set, therefore, Complexity = O(n2 ). Applying row and column transformation in Step 24 to Step 29 and calling function fun to make all the three matrices identical, Complexity required = O(n3 ). In Step 30 to Step 40, if fourth sub matrix is already zero then apply row transformations to make all other sub matrices identical. For this we traverse the matrix and check each entry if it is identical, therefore, Complexity = O(n2 × n × n) = O(n4 ). Total complexity = O(n2 ) + O(n2 ) + O(n3 ) + O(n4 ) = O(n4 ). Thus complexity of above algorithm is O(n4 ), where n denotes vertices in S.
332
4
D. Sinha, A. Sethi / Electronic Notes in Discrete Mathematics 63 (2017) 323–332
Conclusion and Scope
In the present paper, the algorithm to calculate splitting sigraph of a given sigraph is obtained. Also, we have established algorithmic characterization of splitting sigraph based on the characterization given by Sinha and Garg [5]. Further we can extend our approach to detect balancing and C-consistent property of splitting sigraph. Also the given algorithms can be used for encryption and decryption purpose which will be discussed in the coming paper.
References [1] Chartrand, G., and P. Zhang, , “Introduction to Graph Theory”, McGraw Hill, New York, 2004. [2] Golumbic, M.C., “Algorithmic Graph Theory and Perfect Graphs”, Imprint: North Holland, Second Edition, 2004. [3] Le, V.B., and H.N. De Ridder, Probe split graphs, Discrete Mathematics and Theoretical Computer Science, 9(2007), 207-238. [4] Sampathkumar, E., and H.B. Walikar, On the splitting graph of a graph, Journal Karnatak University Science, 25-26(1980−1981), 13-16. [5] Sinha, D., P. Garg, and H. Saraswat, On the splitting signed graphs, Journal of Combinatorics, Information & System Sciences, 38(2013), 103-111. [6] Zasalavsky, T., Characterizations of signed graphs, J. Graph Theory, 5 (1981), 401 - 406.