On square sum graphs

A (p, q)-graph G is said to be square sum, if there exists a bijection f : V (G) → {0, 1, 2, . . . , p − 1} such that the induced function f∗ : E(G)→ N given by f∗(uv) = (f(u)) + (f(v)) for every uv ∈ E(G) is injective. In this paper we initiate a study on square sum graphs and prove that trees, unicyclic graphs, mCn, m ≥ 1, cycle with a chord, the graph obtained by joining two copies of cycle Cn by a path Pk and the graph defined by path union of k copies of Cn, when the path Pn ∼= P2 are square sum.


Introduction
If the vertices of the graph are assigned values subject to certain conditions is known as graph labeling.A dynamic survey on graph labeling is regularly updated by Gallian [4].Pairs of positive integers whose sum of squares are distinct, constitute an important part of number theory.For example, in number theory a positive integer n has a representation as a sum of two squares if n = a 2 + b 2 for some a, b ∈ Z. Exploration of the following problems were of great interest which inspired the curiosity of number theorists.
Problem 1.1.What numbers can be written as sum of squares of two numbers?In general does there exists a number k so that all numbers can be written as sum of k squares?
In additive number theory, Pierre de Fermat's theorem on sums of two squares states that an odd prime p is expressible as p = x 2 + y 2 with x and y integers, if and only if p ∼ = (1 mod 4).For example, the primes 5, 13, 17, 29, 37 and 41 are all congruent to 1 mod 4, and they can be expressed as sums of two squares in the following ways: 5 = 1 2 + 2 2 ; 13 = 2 2 + 3 2 ; 17 = 1 2 + 4 2 ; 29 = 2 2 + 5 2 ; 37 = 1 2 + 6 2 ; 41 = 4 2 + 5 2 etc.On the other hand, the primes 3, 7, 11, 19, 23 and 31 are all congruent to 3 modulo 4, and none of them can be expressed as the sum of two squares.Albert Girard was the first to make the observation (in 1632) and Fermat was first to claim a proof of it.Fermat announced this theorem in a letter to Marin Mersenne dated December 25, 1640; for this reason this theorem is sometimes called Fermat's Christmas Theorem.Since the Brahmagupta-Fibonacci identity implies that the product of two integers that can be written as the sum of two squares is itself expressible as the sum of two squares, by applying Fermat's theorem to the prime factorization of any positive integer n, we see that if all of n's odd prime factors congruent to 3 mod 4 occur to an even exponent, it is expressible as a sum of two squares.The converse also holds.These wide-angular history of sum of squares of numbers motivated the authors to study the particular graphs named square sum graphs.Unless mentioned otherwise, by a graph we shall mean in this paper a finite, undirected, connected graph without loops or multiple edges.Terms not defined here are used in the sense of Harary [3].Square sum graphs are vertex labeled graphs with the labels from the set {0, 1, 2, . . ., p − 1} such that the induced edge labels as the sum of the squares of the labels of the end vertices are all distinct.Not every graph is square sum.For example, any complete graph K n , where n ≥ 6 is not square sum [2].We are interested to study different classes of graphs, which are square sum.In this paper, we shall show that trees, unicyclic graphs, mC n , m ≥ 1, cycle with a chord, the graph obtained by joining two copies of cycles C n by a path P k and the graph defined by path union of k copies of C n , when the path P n ∼ = P 2 are square sum.

Square sum graphs
Acharya and Germina defined a square sum labeling of a (p, q)-graph G as follows [1,2].Definition 2.1.A (p, q)-graph G is said to be square sum, if there exists a bijection f : V (G) → {0, 1, 2, . . ., p − 1} such that the induced function Some square sum graphs are depicted in Figure 1.
Clearly, the edge labels of P n are distinct as it form a strictly increasing sequence of odd numbers. 2 Theorem 2.3.Trees are square sum.

Proof.
Let v 0,0 be a vertex with the maximum degree in a tree T. Choose v 0,0 as the root vertex.Let k denote the height of the tree T.
Let n 1 be the number of vertices adjacent to v 0,0 and let these vertices be denoted by v 1,1 , v 1,2 , . . ., v 1,n 1 .These vertices are at a distance 1 from the root vertex and are taken as the first level vertices.Let n 2 be the number of vertices adjacent to first level vertices.Denote the vertices adjacent to such a manner that the vertices adjacent to v 1,i are labeled first in an increasing order when compared to that of v 1,j , where 1 ≤ i < j ≤ n 1 .These vertices are at a distance 2 from the root vertex and are taken as the second level vertices.Proceeding like this, let n k be the number of vertices adjacent to the vertices of (k − 1) th level.The vertices in k th level are denoted by Clearly f is injective.Let e 1 , e 2 ∈ E(T ) be any two arbitrary edges of T. If e 1 and e 2 are two incident edges, then f * (e 1 ) 6 = f * (e 2 ).Let e 1 = u 1 u 2 and e 2 = u 3 u 4 be the edges such that e 1 and e 2 have no common vertex.Without loss of generality, assume that f (u 1 ) is least among {f (u 1 ), f(u 2 ), f(u 3 ), f(u 4 )}.Since T is a tree, at least one of the vertices showing that T is square sum. 2 Theorem 2.4.Forests are square sum.
Let v be a vertex with maximum degree in tree T 1 .Choose v as the root vertex.Visit all the vertices of T 1 using BFS algorithm and label the vertices with the consecutive numbers 0, 1, 2, 3, . . ., n 1 − 1 in ascending order, in the order in which they are visited in a one to one manner.By Theorem 2.3, T 1 is square sum.Then label the vertices of T 2 as follows.Let u be a vertex with maximum degree in tree T 2 .Choose u as the root vertex.Visit the vertices of T 2 using BFS algorithm and label the vertices with the consecutive numbers n 1 , n 1 + 1, n 1 + 2, . . ., n 1 + n 2 − 1 in ascending order, in the order in which they are visited in a one to one manner.Clearly T 1 ∪ T 2 is square sum.Now label the vertices of T 3 in a similar way applying BFS algorithm, by choosing maximum degree vertex as the root vertex, with label n 1 +n 2 .Proceeding in this way, we label the vertices of T k as follows.Let w be a vertex with maximum degree in T k .Choose w as the root vertex.Visit the vertices of T k using BFS algorithm and label the vertices with consecutive numbers (n 1 +n 2 +. ..+n k−1 ), (n 1 +n 2 +. ..+n k−1 +1), . . ., (n 1 +n 2 +. ..+n k−1 +n k −1) in ascending order, in the order in which they are visited.Clearly, the induced edge label of T i ; 1 ≤ i ≤ k, are in strictly increasing order.Hence

Proof.
Let C n be a cycle of length n and letC n : Clearly f is injective.There are three classes of edges.
1) Edges connecting consecutive distinct odd numbers, 2) Edges connecting consecutive distinct even numbers, , having end vertices with the labels in which one of them is even and the other is odd, which receive odd edge labels.
Clearly the labelings of class 1 and class 2 are distinct.In class 3, f * (u ) is strictly greater than 1.Hence ).Since the labels of the edges connecting consecutive even numbers and consecutive odd numbers are distinct, the edge labelings of class 1 edges are distinct from edge labeling of class 2 edges.Since the edge labelings of class 3 edges are distinct odd numbers, they are distinct from edge labeling of class 1 edges and class 2 edges of distinct even numbers.Hence all the induced edge labels are distinct and f is square sum labeling of C n . 2 Theorem 2.6.Unicyclic graphs are square sum.
Case (1): G ∼ = C n .Choose an arbitrary vertex say u 1 of C n .Starting from u 1 , visit all the vertices of G using BFS algorithm and label the vertices u i ; 1 ≤ i ≤ n in the order in which they are visited.By Theorem 2.5, f is a square sum labeling of G.
Case (2): Let G 6 ∼ = C n .We prove the theorem in following two steps.Choose any vertex u 1 of C n such that deg(u 1 ) ≥ 3. Subcase (i): n is even.Starting from u 1 , visit all the vertices of G using BFS algorithm subject to the following restrictions.First visit all the neighbors of u 1 not on the cycle so that u n and u 2 are visited consecutively.Without loss of generality, assume that u n is visited first.In general, if 0 ≤ i ≤ n 2 while we visit the neighbors of u n−i , first visit the neighbors that are not on cycle and for neighbors of u i+2 , first visit its neighbor on the cycle.Label the vertices of G with the consecutive numbers 0, 1, 2, . . ., n−1 in the order in which we visit them.Clearly f (V ) = {0, 1, 2, . . ., n − 1}.Since G is a unicyclic graph, BFS algorithm gives exactly one back edge Suppose e 1 = u k u k+1 .e 1 and e 2 are non-adjacent and . In all cases we have f * (e 1 ) 6 = f * (e 2 ).Subcase(ii): n is odd.Starting from u 1 , visit all the neighbors of u 1 , using BFS algorithm, such that we first visit u n , then the neighbors of u 1 that are not on the cycle and then u 2 .Next visit u n−1 and then the other neighbors of u n so that u 2 and u n−1 are visited consecutively.Now proceeding as in Subcase (i) we obtain a square sum labeling of G. 2 Theorem 2.7.For integers m and n, the graph mC n is square sum for all m ≥ 1 and for all n ≥ 3.
when n is even Clearly f is injective.The induced edge labels of mC n ; m ≥ 1 are strictly increasing and all the edge labels are distinct.Hence mC n is square sum for all m ≥ 1. 2 Definition 2.8.Path union of graphs: Let graphs G 1 , G 2 , G 3 , . . ., G n , n ≥ 2 be all copies of a fixed graph G. Adding an edge between Theorem 2.9.The graph obtained by joining two copies of cycle C n by a path P k is square sum.

Proof.
Let C n i ; 1 ≤ i ≤ 2 be two copies of cycle C n .Let G be the graph obtained by joining two copies of cycle C n with path P k .Let u i ; 1 ≤ i ≤ n be the vertices of c n 1 and v i ; 1 ≤ i ≤ n be the vertices of C n 2 .Let w i ; 1 ≤ i ≤ k be the vertices of path P k with u 1 = w 1 and v 1 = w k .Here we note that |V (G)| = 2n+k −2.Define f : V (G) → {0, 1, 2, . . ., 2n+k −3} as follows.Start from u 1 of C n 1 visit all the vertices of C n 1 , using BFS algorithm and label the vertices u i ; 1 ≤ i ≤ n as n − 1, n − 2, . . ., 2, 1, 0 in descending order, the order in which they are visited.By Theorem 2.5, f is a square sum labeling of C n 1 .Define f : Clearly the edge labels of path P k are strictly increasing sequence of odd numbers, and hence they are distinct.Starting from w k = v 1 , of C n 2 visit all the vertices of C n 2 using BFS algorithm, and label the vertices v i ; 1 ≤ i ≤ n as (n + k − 2), (n + k − 1), (n + k), . . ., (2n + k − 3), in the order in which they are visited.The edge labeling of path P k are strictly greater than edge labels of C n 1 .Also edge labels of C n 2 are strictly greater than that of P k .Hence induced edge labels of C n i ; 1 ≤ i ≤ 2 with path P k are distinct and f is a square sum labeling of G. 2 Theorem 2.10.The path union of k copies of C n , where k ≥ 1 when the path P n ∼ = P 2 are square sum.

Proof.
Let C n i ; 1 ≤ i ≤ k be the k copies of C n .Let G be a graph obtained by joining k copies of C n by path P 2 .Here |V (G)| = kn.Let C n 1 : u 1 , u 2 , . . ., u n , u 1 and C n 2 : v 1 , v 2 , . . ., v n , v 1 be the first two copies of C n , where u 1 v 1 be the path P 2 joining C n 1 and C n 2 .Define f : V (G) → {0, 1, 2, . . ., kn − 1} as follows.Start from vertex u 1 of C n 1 , visit all the vertices of C n 1 using BFS algorithm and label the vertices u i ; 1 ≤ i ≤ n of C n 1 as n − 1, n − 2, . . ., 1, 0 in descending order, the order in which they are visited.By Theorem 2.5, this labeling is a square sum labeling of C n 1 .Starting from v 1 visit all the vertices of C n 2 using BFS algorithm and label the vertices of C n 2 as n, n + 1, . . ., 2n − 1 in ascending order, the order in which they are visited.Clearly label of edge u 1 v 1 , joining C n 1 and C n 2 is strictly greater than the edge labels of C n 1 and edge label of C n 2 is strictly greater than that of u 1 v 1 .Hence edge labels of C n 1 , C n 2 and path P 2 are distinct.Label the end vertex of path P 2 joining C n 2 and C n 3 by 2n−1 and 2n respectively.Start from vertex with label 2n on C n 3 , visit all the vertices using BFS algorithm and label the vertices in ascending order.Continue this process and label the vertices of C n 4 , . . ., C n k respectively using BFS algorithm and lastly, label the end vertices of path P 2 joining C n k−1 and C n k by (k − 1)n − 1 and (k − 1)n respectively.Clearly all the edge labels of path are increasing sequence of odd numbers and are distinct from the edge labels of cycles.Hence f is square sum labeling of G.

Theorem 2 . 2 .
P n is square sum for every n.

Figure 1 :
Figure 1 : Example of square sum graphs

T i is square sum. 2 Theorem 2 . 5 .
Cycles are square sum.

u k u k+1 , where k = n 2 .
Now let e 1 and e 2 be any two edges of G.If either e 1 and e 2 are adjacent or e 1 , e 2 6 = u k u k+1 , then obviously f * (e 1 ) 6 = f * (e 2 ).

2
Theorem 2.11.Finite union of cycles C i are square sum.be finite union of cycles.Let C 1 : u 1 , u 2 , ..., u n 1 , u 1 be a cycle of length n 1 , C 2 : v 1 , v 2 , ..., v n 2 , v 1 be a cycle of length n 2 , and C k : w 1 , w 2 , ..., w n k , w 1 be a cycle of length n k .Start from vertex u 1 of C 1 , visit all the vertices of C 1 using BFS algorithm, label the vertices u i ; 1 ≤ i ≤ n 1 of C 1 as 0, 1, 2, ..., n 1 − 1, in the order in which they are visited.By Theorem 2.5, f is square sum labeling of C 1 .Choose an arbitrary vertex v 1 of C 2 .Start from vertex v 1 of C 2 , visit all the vertices of C 2 using BFS algorithm, label the vertices v i ; 1 ≤ i ≤ n 2 of C 2 as n 1 , n 1 + 1, ..., n 1 + n 2 − 1, in the order in which they are visited.Clearly C 1 ∪ C 2 is square sum.Now label the vertices of C 3 in a similar way.Proceeding in this way we label the vertices of C k as follows.Choose an arbitrary vertex w 1 of C k .Start from the vertex w 1 of C k , visit all the vertices of C k using BFS algorithm, and label the verticesw i ; 1 ≤ i ≤ n k of C k as (n 1 + n 2 + ...+ n k−1 ), (n 1 + n 2 + ...+ n k−1 +1), . . ., (n 1 + n 2 + . ..+ n k−1 + n k − 1), in the order in which they are visited.Since the induced k [ i=1 C i k [ i=1 C i