On the Number of cycles in a Graph

In this paper, we obtain explicit formulae for the number of 7-cycles and the total number of paths of lengths 6 and 7 those contain a specific vertex $v_{i}$ in a simple graph G, in terms of the adjacency matrix and with the help of combinatorics.


Introduction
In a simple graph G, a walk is a sequence of vertices and edges of the form v 0 , e 1 , v 1 , ..., e k , v k such that the edge e i has ends v i−1 and v i . A walk is called closed if v 0 = v k . If the vertices of a walk are distinct then the walk is called a path. A cycle is a non-trivial closed walk in which all the vertices are distinct except the end vertices. It is known that if a graph G has adjacency matrix A=[a ij ], then for k = 0, 1, ... , the ij-entry of A k is the number of v i − v j walks of length k in G. It is also known that tr(A n ) is the sum of the diagonal entries of A n and d i is the degree of the vertex v i . In 1971, Frank Harary and Bennet Manvel [4], gave formulae for the number of cycles of lengths 3 and 4 in simple graphs as given by the following theorems: Theorem 1.1 [4] If G is a simple graph with adjacency matrix A, then the number of 3-cycles in G is 1 6 tr(A 3 ).
(It is known that tr( ij a ij ).

Theorem 1.2 [4] If G is a simple graph with adjacency matrix A, then the number of 4−cycles in G is
ij ], where q is the number of edges in G.
(It is obvious that the above formula is also equal to 1 8 Theorem 1.3 [4] If G is a simple graph with n vertices and the adjacency matrix A= [a ij ], then the number of 5−cycles in G is 1 10 ii ] In 2003, V. C. Chang and H. L. Fu [5], found a formula for the number of 6−cycles in a simple graph which is stated below: Theorem 1.4 [5] If G is a simple graph with adjacency matrix A, then the number of 6−cycles in G is 1 12 [tr(A 6 )−6 ii ] 2 +9 j =i a (2) ij (a (2) ij −1)a ij −6 j =i a (2) ij (a (2) ij −1)(a (2) ij −2) −2 p i=1 a (2) ii (a (2) ii − 1)(a (2) ii − 2)], where p is the number of vertices in G.
Their proofs are based on the following fact: The number of n-cycles (n= 3, 4, 5, 6) in a graph G is equal to 1 2n (tr(A n ) − x ) where x is the number of closed walks of length n, which are not n-cycles.
In 1997, N. Alon, R. Yuster and U. Zwick [6], gave number of 7-cyclic graphs. They also gave some formulae for the number of cycles of lengths 5 , which contains a specific vertex v i in a graph G. In [6,11,12,13,15,16,18], we have also some bounds to estimate the total time complexity for finding or counting paths and cycles in a graph.
In [6] we can also see a formula for the number of 5-cycles each of which contains a specific vertex v i but, their formula has some problem in coefficients. In [3] we gave the correct formula as considered bellow : Theorem 1.11 [3] If G is a simple graph with n vertices and the adjacency matrix A= [a ij ], then the number of ij )].
In this paper we give a formula to count the exact number of cycles of length 7 and the number of cycles of lengths 6 and 7 those contain a specific vertex v i in a simple graph G, in terms of the adjacency matrix of G and with the helps of combinatorics.

Number of 7-Cycles :
In 1997, N. Alon, R. Yuster and U. Zwick [6], gave number of 7-cyclic graphs. The n-cyclic graph is a graph that contain a closed walk of length n and these walks are not necessarily a cycle. In this section we obtain a formula for the number of cycles of length 7 in a simple graph G with the helps of [6].
Method: To count N in the cases those considered below, we first count tr(A 7 ) for the graph of first configuration. This will give us the number of all closed walks of length 7 in the corresponding graph. But, some of these walks do not pass through all the edges and vertices of that configuration and to find N in each case, we have to include in any walk, all the edges and the vertices of the corresponding subgraphs at least once. So, we delete the number of closed walks of length 7 those do not pass through all the edges and vertices. To find these kind of walks we also have to count tr(A 7 ) for all the subgraphs of the corresponding graph those can contain a closed walk of length 7.
F i in the cases those are considered below.
Proof: The number of 7−cycles of a graph G is equal to 1 14 , where x is the number of closed walks of length 7 that are not 7-cycles. To find x, we have 11 cases as considered below; the cases are based on the configurations-(subgraphs) that generate all closed walks of length 7 that are not 7-cycles. In each case, N denote the number of closed walks of length 7 that are not 7-cycles in the corresponding subgraph, M denote the number of subgraphs of G of the same configuration and F n , (n= 1, 2, ...) denote the total number of closed walks of length 7 that are not cycles in all possible subgraphs of G of the same configuration. However, in the cases with more that one figure ( Cases 5,6,8,9,11), N, M and F n are based on the first graph of the respective figures and P 1 , P 2 , ... denote the number of subgraphs of G which don't have the same configuration as the first graph but are counted in M. It is clear that F n is equal to N× (M− P 1 − P 2 − ...). To find N in each case, we have to include in any walk, all the edges and the vertices of the corresponding subgraphs at least once.
Let P 1 denotes the number of subgraphs of G that have the same configuration as the graph of Fig 8(b) and are counted in M. Thus P 1 = 4×( 1 112 F 4 ), where 1 112 F 4 is the number of subgraphs of G that have the same configuration as the graph of Fig 8(b) and 4 is the number of times that this subgraph is counted in M. Consequently, (a (5) ii − 5a (a (5) ii − 5a Now we add the values of F n arising from the above cases and determine x. By putting the value of x in 1 14 (tr(A 7 )−x) we get the desired formula.

Number of Cycles Passing the Vertex V i :
In this section we give formulae to count the number of cycles of lengths 6 and 7, each of which contain a specific vertex v i of the graph G.
Proof: The number of 6−cycles each of which contain a specific vertex v i of the graph G is equal to 1 2 (a (6) ii − x), where x is the number of closed walks of length 6 form the vertex v i to v i that are not 6−cycles. To find x, we have 17 cases as considered below; the cases are based on the configurations-(subgraphs) that generate v i − v i walks of length 6 that are not cycles. In each case, N denote the number of walks of length 6 from v i to v i that are not cycles in the corresponding subgraph, M denote the number of subgraphs of G of the same configuration and F n , (n= 1, 2, ...) denote the total number of v i − v i walks of length 6 that are not cycles in all possible subgraphs of G of the same configuration. However, in the cases with more than one figure ( Cases 11,12,13,14,15,16,17), N, M and F n are based on the first graph of the respective figures and P 1 , P 2 ,... denote the number of subgraphs of G which don't have the same configuration as the first graph but are counted in M. It is clear that F n is equal to N × (M− P 1 −P 2 −...). To find N in each case, we have to include in any walk, all the edges and the vertices of the corresponding subgraphs at least once.  ii and F 1 = a (2) ii .  ij a ij . a ij and F 10 = 12  2 is the number of times that this subgraph is counted in M. Consequently, . Let P 1 denote the number of all subgraphs of G that have the same configuration as the graph of Fig 26(b) and are counted in M. Thus P 1 = 2 × ( 1 6 F 11 ), where 1 6 F 11 is the number of subgraphs of G that have the same configuration as the graph of Fig 26(b) and 2 is the number of times that this subgraph is counted in M. Consequently, Now we add the values of F n arising from the above cases and determine x. Substituting the value of x in 1 2 (a (6) ii − x) and simplifying, we get the number of 6−cycles each of which contains a specific vertex v i of G.
ii (d i − 2) and F 2 = 17a Case 5: For the configuration of Fig 34, N= 12  Thus P 1 = 1 × ( 1 24 F 10 ), where 1 24 F 10 is the number of subgraphs of G that have the same configuration as the graph of Fig 38(b) and this subgraph is counted only once in M. Consequently, F 9 = 6 Case 17: For the configuration of Figure 46(a), N= 4, M= . Let P 1 denote the number of all subgraphs of G that have the same configuration as the graph of Figure 46(b) and are counted in M.
, where 1 32 F 7 is the number of subgraphs of G that have the same configuration as the graph of Figure 46(b) and 2 is the number of times that this subgraph is counted in M. Consequently,  Figure 47(b) and 1 is the number of times that this subgraph is counted in M.
Case 19: For the configuration of Figure 48, N= 14, M= 1 2 [a (5) ii − 5a ij )] (See Theorem 1.11) and F 19 = 7 [a (5) ii − 5a Case 22: For the configuration of Fig 51(a), N= 6, M= 1  [a (5) jj −5a jk )]a ij − 2 Case 24: For the configuration of Figure 53(a), N= 4, M= 1 2 [(a (5) ii − 5a ii + a jk a jk − a ik a ij a jk )a ik ](d j − 2). Let P 1 denote the number of all subgraphs of G that have the same configuration as the graph of Fig 55(b) and are counted in M. Thus P 1 = 1 × ( 1 12 F 21 ), where 1 12 F 21 is the number of subgraphs of G that have the same configuration as the graph of Fig 55(b) and 1 is the number of times that this subgraph is counted in M. Let P 2 denote the number of all subgraphs of G that have the same configuration as the graph of Fig 55(c) and are counted in M. Thus P 2 = 1 × ( 1 6 F 22 ), where 1 6 F 22 is the number of subgraphs of G that have the same configuration as the graph of Fig 55(c) and 1 is the number of times that this subgraph is counted in M. Consequently, Case 29: For the configuration of Figure 58 Now we add the values of F n arising from the above cases and determine x. Substituting the value of x in 1 2 (a (7) ii − x) and simplifying, we get the number of 7−cycles each of which contains a specific vertex v i of G.