Hamming index of graphs with respect to its incidence matrix

Let B ( G ) be the incidence matrix of a graph G . The row in B ( G ) corresponding to a vertex v , denoted by s ( v ) is the string which belongs to Z m 2 , a set of m -tuples over a ﬁeld of order two. The Hamming distance between the strings s ( u ) and s ( v ) is the number of positions in which s ( u ) and s ( v ) differ. In this paper we obtain the Hamming distance between the strings generated by the incidence matrix of a graph. The sum of Hamming distances between all pairs of strings, called Hamming index of a graph is obtained.


Introduction
The basic unit of information, called message, is a finite sequence of characters. Every character or symbol that is to be transmitted is represented as a sequence of m elements from the set Z 2 = {0, 1}. The set Z 2 is a group under binary operation ⊕ with addition modulo 2.

www.ijc.or.id
Hamming index of graphs with respect to its incidence matrix | Ramane et al.

Element of Z m
2 is an m-tuple (x 1 , x 2 , . . . , x m ) written as x = x 1 x 2 . . . x m where every x i is either 0 or 1 and is called a string or word. The number of 1's in x = x 1 x 2 . . . x m is called the weight of x and is denoted by wt(x).
Let x = x 1 x 2 . . . x m and y = y 1 y 2 . . . y m be the elements of Z m 2 . Then the sum x ⊕ y is computed by adding the corresponding components of x and y under addition modulo 2. That is, The Hamming distance H d (x, y) between the strings x = x 1 x 2 . . . x m and y = y 1 y 2 . . . y m is the number of i's such that Thus H d (x, y) = Number of positions in which x and y differ = wt(x ⊕ y) [5].
Lemma 1.1. [5] For all x, y, z ∈ Z m 2 , the following conditions are satisfied.
Let G be a simple, undirected graph with n vertices and m edges. Let V (G) = {v 1 , v 2 , . . . , v n } be the vertex set of G and E(G) = {e 1 , e 2 , . . . , e m } be the edge set of G. If the vertices u and v are adjacent then we write u ∼ v and if they are not adjacent then we write u v. The edge and its end vertex are said to be incident to each other. The degree of a vertex v, denoted by deg G (v) is the number of edges incident to it. A graph is said to be r-regular graph if all its vertices have same degree equal to r. A path on n vertices denoted by P n is a graph with vertices v 1 , v 2 , . . . , v n , where v i is adjacent to v i+1 , i = 1, 2, . . . , n − 1.
The incidence matrix of G is a matrix B(G) = [b ij ] of order n × m, in which b ij = 1 if the vertex v i is incident to the edge e j and b ij = 0, otherwise. Denote by s(v), the row of the incidence matrix corresponding to the vertex v. It is a string in the set Z m 2 of all m-tuples over the field of order two.
Sum of Hamming distances between all pairs of strings generated by the incidence matrix of a graph G is denoted by H B (G) and is called the Hamming index of G. Thus, Hamming index of graphs with respect to its incidence matrix | Ramane et al.
For a graph G given in Fig. 1, the incidence matrix is The Hamming distance between the strings generated by the adjacency matrix of a graph is obtained in [1,6]. Hamming distance between the strings generated by edge-vertex incidence matrix of a graph is reported in [7]. In this paper we obtain the Hamming distance between the strings generated by the vertex-edge incidence matrix of a graph and also we obtain the Hamming index of graphs. In the sequel we develop an algorithm to obtain the Hamming distance between the strings and Hamming index.

Hamming Distance Between Strings
In this section we obtain the Hamming distance between the strings generated by the incidence matrix of a graph.
Theorem 2.1. Let G be a graph with n vertices and m edges. Let u and v be the vertices of G and l be the number of edges which are neither incident to u nor incident to v. Then Proof. Let k be the number of edges which are incident to booth u and v simultaneously and l be the number of edges which are neither incident to u nor to v. Therefore the remaining m − k − l edges are incident to either u or v, but not to both simultaneously. Therefore the strings of u and v from B(G) will be in the form . . x m and s(v) = y 1 y 2 . . . y k y k+1 . . . y k+l y k+l+1 . . . y m where x i = y i = 1 for i = 1, 2, . . . , k, x i = y i = 0 for i = k + 1, k + 2, . . . , k + l and x i = y i for i = k + l + 1, k + l + 2, . . . , m. Therefore s(u) and s(v) differ at m − k − l places. Hence If u and v are adjacent then k = 1. Therefore, by Eq. (2), If u and v are non adjacent then k = 0. Therefore, by Eq. (2), Theorem 2.2. Let u and v be the vertices of G. Then Proof. Let m be the number of edges of G and let l be the number of edges which are neither incident to u nor to v.
Converse is obvious.

Hamming Index
In this section we obtain the Hamming index of some graphs.    Proof. The graph G = K p,q has n = p + q vertices and m = pq edges. If the vertices u and v are adjacent then deg G (u) = p and deg G (v) = q or vice versa. Therefore by Theorem 2.2, we have Let V 1 and V 2 be the partite sets of the vertices of a graph K p,q , where |V 1 | = p and |V 2 | = q. Let u and v be non-adjacent vertices.
In the graph K p,q , there are pq pairs of adjacent vertices and p 2 + q 2 pairs of non adjacent vertices. Therefore,

Algorithm
Algorithm: Hamming Index(G): • In line 4 a matrix IM of order n × m is created which will become the incidence matrix (giving the vertex -edge adjacency) of a given graph.
• The 2 nested for loops from line 5 to 12 are used to create the Incidence Matrix and Strings corresponding to each vertex in the given graph.
-For each vertex represented by i, every edge represented by j is checked for adjacency using the condition in line 7 as -if (Vi is source or destination of Ej).
-If the conidtion in line 7 is true then the edge Ej is incident to the vertex Vi and hence the corresponding entry in the incidence matrix will be set to 1 and also 1 will be entered into the string corresponding to the vertex Vi. Otherwise, if the condition in line 7 is false then the edge Ej is not incident to the vertex Vi and hence the corresponding entry in the incidence matrix will be set to 0 and also 0 will be entered into the string corresponding to the vertex Vi.
• A temporary variable "temp" is created in the line 13 and is initialized with 0, which will hold the values extracted from the strings corresponding to each vertex.
• The 2 nested for loops in line 14 to 18 are used to calculate the degrees of each vertex in the graph based on the strings corresponding to each vertex.
-In these loops, for each vertex Vi the entries from its corresponding string is extracted one by one and checked whether that entry is equal to 1 in the condition of line 17. If this condition is true then the degree of that particular vertex Vi is incremented by 1 in line 18.
• In line 19 a variable "Hamming Index" is created and initialized with 0. This variable gives the total Hamming distance between the strings corresponding to all the vertices of a graph.
• The 2 nested for loops in line 20 to 26 calculate the Hamming distance between every pair of vertices and also the Hamming index of a given graph.
-In these loops, we check for every possible pair of vertices whether they both are adjacent using the condition in line 22. If this condition is true then the vertices Vi and Vj are adjacent and hence the Hamming distance between them is calculated using the -In line 26, the Hamming distance calculated in line 23 or 25 is added to the Hamming index.

Conclusion
The Hamming distance between the strings generated by the incidence matrix of a graph is obtained. Thus the Hamming index of some graphs are reported. Theorem 2.3 provides the graph in which H d (s(u), s(v)) = d G (u, v) for every pair of vertices. In general the cases H d (s(u), s(v)) > d G (u, v) and H d (s(u), s(v)) < d G (u, v) required further study.