1. Introduction

In the literature of graph spectra several papers are dedicated to the characteristic polynomial of matrices associated with graphs. Among them we can highlight Prabhu and Deo (^{17}), Simic' and Stanic' (^{21}), Schwenk (^{20}), Hagos (^{11}), Moraes et al. (^{15}) and Guo et al. (^{9}). The *k*-th coefficient of the characteristic polynomial of a graph *G* (relative to the adjacency matrix of *G*) depends on the number of cycles and the number of the matchings of the size *k* - 1, see Biggs (^{2}). In this paper, we explicitly determine the fifth characteristic coefficient of powers of paths by establishing a closed-form expression for the number of 4-cycles therein.For a comprehensive treatment of the theory of graph spectra, we recommend (^{3}), (^{5}) and (^{6}).

Let *G = (V,E)* be a simple graph with *n* vertices, *m* edges an *c* connected components. Recall that the rank of *G*
*is r(G) = n - c* and the co-rank of *G* is *s(G) = m - n + c*. An elementary subgraph of *G* is one in which the connected components are either single edges, K_{2}, cycles of length _{
r, Cr,
} or disjoint union between them. The co-rank of an elementary subgraph is just the number of its components which are cycles.

Let _{
PG(λ) = det (λI- A(G))
} be the characteristic polynomial of *G*, where *A(G)* is the adjacency matrix of the graph and *I* is the identity matrix of order *n*. It is well known that the i- coefficient of _{
PG(λ) = λn + α1λn-1 + α2λn-2
} +…+_{
αn, i
} = 1,2,…,*n,* is given by

where Г_{i} is the set of all elementary subgraphs of *G* with *i* vertices, *r* (Λ) is the rank and , *s* (Λ)

is the co-rank of each Λ ∈ Г_{i} (Biggs (^{2})). Hence, the coefficients of the _{
PG(λ)
} are directly related to the graph structure.

Moraes et al. (^{15}) provided an algorithm for counting 2-matchings (a subgraph formed by two disjoint simple edges) in any graph. If *d* = (*d1,d2, …, dn*) is the degree sequence of *G,* the number of 2-matchings is

It is possible to use equation (1.2) in (1.1) to determine an alternative formula for the characteristic coefficient *α*
_{4} of *G*. For a closed-form expression, the number of 4-cycles

in the graph must be known.

The investigation on counting cycles in graphs is not recent. Given the arboricity *α(G)* of a graph *G* (the minimum number of edge-disjoint forests into which *G* can be decomposed), Chiba and Nishizeki (^{7}) established four algorithms for: (i) listing all the triangles in a graph *G* with time complexity of *O(α(G)m)*, (ii) finding all the quadrangles in *G* with time complexity of *O(α(G)m)*, (iii) listing all the complete subgraphs *K*
_{l} of order *l* with time complexity of _{
O(lα(G)l-2m)
} , and (iv) listing all the cliques with time complexity of *O(α(G)m)*, per clique.

Richards (^{18}) presented *O(nlogn)* time algorithms for detecting both a 5- and a 6- cycle in planar graphs using separators. Alon et al. (^{1}) provided an assortment of methods for finding and counting simple cycles of a given length in directed and undirected graphs. Most of the bounds obtained depend solely on the number of edges in the graph in question, and not on the number of vertices. Schank and Wagner (^{19}) made an experimental study focused on the efficiency of algorithms for triangle counting and listing and gave a simple enhancement of a well known algorithm, making triangle listing and counting in huge networks feasible.

The results mentioned in the previous paragraph depend directly on the number of vertices and/or of edges in a graph. Thus, the algorithms for computing the number of cycles of a given length can be costly if *n* and/or *m* are large. Our intention is to take advantage of the well-behaved structure and degree distribution of the k-th power of a path, k > 2, to find out explicit functions for the number of 4-cycles in these graphs for each *k*. We approach the problem of counting 4-cycles by using lists of labels. The method developed in this paper might be applied to other well-structured graphs or modified to count cycles of different lengths.

This paper is organized as follows. In Section 2, we present a subclass of chordal graphs, the k-power of a path,
, and transcribe some properties of them given by Pereira et al. (^{16}) and Markenzon at al. (^{12}). In Section 3, we develop methods for counting 4-cycles in the power of a path graph. The number of 4-cycles in each case is expressed as a polynomial in the variables *n* and *k* and hence can be computed within *O*(1) operations. The fifth characteristic coefficient of
graphs are determined in Section 4.

2. Basic Results

Given a graph *G* = (*V,E*) and a positive integer *d*, the *d-thpower* of *G* is the graph _{
Gd
} = (*V,E’*) in which two vertices are adjacent when they have distance at most *d* in *G* (Diestel (^{8})). Clearly *G* = *G*
^{1} ⊆ *G*
^{2} ⊆ ^{…}.

The path of order *n* is denoted _{
Pn
} . The *k*-th power of a path is denoted
, 1 ≤ *k* ≤ *n*.

A class that generalizes
is the *k*-path graphs, which constitutes a subclass of chordal graphs. Their structural aspects are essential for achieving the results in this paper.

**Definition 1.** (Pereira et al. (^{16}) A *k*-path graph, *k* > 0, can be inductively defined as follows:

Every complete graph with *k* + 1 vertices is a *k*-path graph.

If *G* = (*V,E*) is a *k*-path graph, *v* ∉ *V* and *Q* ⊆ *V* is a *k*-clique of *G* containing at least one simplicial vertex, then *G*’ = (*V* ∪ {*v*}, *E* ∪ {*vw* | *w* ∈ *Q*}) is also a *k*-path graph.

Nothing else is a *k*-path graph.

**Theorem 1.** (Markenzon et al. (^{12}) The power of a path
, 1 ≤ *k* ≤ *n*, is a *k*-path graph.

Note that there is a unique
of order *n* for each *k*; it can be inductively defined by replacing the second item of Definition 1 with the following item:

If *G* = (*V,E*) is a power of a path, *v* ∉ *V* and *Q* ⊆ *V* is a *k*-clique of *G* composed by the *k* most recently included vertices, then *G*’ = (*V* ∪ {*v*}, *E* ∪ {*vw* | *w* ∈ *Q*}) is also a power of path.

Figure 1 shows and .

The number *m* of edges in any *k*-path on *n* vertices is directly derived from the way it is constructed. Its expression depends solely on the values of *k* and *n*.

**3. Counting 4-cycles in**
_{
Pkn
}

In this section we derive expressions for the number of 4-cycles in powers of a path on *n* vertices in terms of the variables *n* and *k*.

A 4-cycle is equivalent to a cyclic sequence of four different numbers which, being positive integers, can be put in crescent order. Let *a, b, c* and *d* be the labels of four vertices and assume that *a < b < c < d.* If there is a cycle in
containing these vertices, we can always set the lower vertex, *a* to the first position in its associated cyclic sequence, writing it as *a__.* Moreover, with the lower label occupying the first position, there are only two possible positions for the greatest label: it either occupies the third or the last position in the sequence. This is the major idea behind the proof of next theorem. Any 4-cycle can be identified to a list of one and only one of the following types:

Where *a,b,c* and *d* are positive integers satisfying *a < b < c < d.*

For finding the total number of non isomorphic 4-cycles contained in
, we deal separately with the ones associated to a list of *Type1* and of *Type2,* as defined in (3.1).

**Theorem 1.** Let
be the *k*-power of a path on *n* vertices, with *k* ≥ 2 and *n* > 2*k*. The number *n*
_{4} of 4-cycles in
, is given by

**Proof.** In a list of *Type 1,* the four positive integers *a, b, c* and *d* that form the sequence satisfy *a < b < c < d*, *a* occupies the first and *d* the last position in the sequence. The lowest possible value for *a* in the list *a__d*, is 1, while its greatest possible value is (*n* - 3). This is explained by the fact that there are three integers greater than *a* in the list and its last position, occupied by *d,* cannot have a value exceeding the total number *n* of vertices.

Tables 1 and 2 are used to organize the counting of all cycles associated to lists of *Type 1*. Table 1 has *n* - *k* + 1 rows and *n - 2* columns. The first column indicates the possible values of *a*, which can vary from 1 to (*n - k*), while the first row shows all possible values for *d*, which can vary from 4 to *n*. A cell *rs, r* = 2,3, …, *n - k* + 1, and, *s* = 2,3, …, *n* - 2, is filled in with the number of 4-cycles having the value of *a* given in cell *r*1 and the value of *d* given in cell 1*s*. A cell is left empty if it does not exist any such cycle for the given values of *a* and *d*.

By construction of
we show that, for each 1 ≤ *a* ≤ (*n - k*), it exists a 4-cycle associated to a List of *Type* 1 if and only if *d* is any integer satisfying (*a* + 3) ≤ *d* ≤ (*a + k).* In fact, the gaps in a *Type* 1 list must be filled in with two distinct integers strictly greater than *a* and lower than *d;* therefore, the minimum acceptable value for *d* is (*a* + 3). On the other hand, *d* cannot be greater than (*a + k*), since that would contradict the fact that two adjacent vertices in
are connected by a path of length at most *k*.

Let 1 ≤ *a* ≤ (*n - k*) and (*a* + 3) ≤ *d* ≤ (*a* + *k*) (non empty cells of Table 1). Assume that exist exactly *i* integers strictly between *a* and *d*. We can fill in the two gaps in the list *a__d*\, by picking any two of these integers. Thus, the number of different lists obtained is equal to the arrangement of *i* numbers taken 2 at a time,
. For each value of *a* in Table 1 there are
lists of Type 1. Hence, for 1 ≤ *a* ≤ (*n - k*), we count

lists of Type 1 associated to non isomorphic 4-cycles in .

The cases (*n - k* + 1) ≤ *a* ≤ (*n* - 3) are slightly different. As the values of *d* cannot exceed *n*, we count less and less integers strictly between *a* and d when *a* varies from (*n - k* + 1) to (*n* - 3). Table 2 (p.8), which has *k* - 2 rows and n - 2 columns, is helpful to organize the counting. Its cells are filled in analogously as the previous table, with the one restriction that *d* ≤ n. For each *a* = (*n - j*), j *= 3*,…, *k - 1,* there are
lists of *Type* 1; thus, for 3 ≤ *j* ≤ *k* - 1, we count

Summing (3.3) to the expression on the right side of equality (3.4), we arrive at the number of non isomorphic 4-cycles in
associated to a list of *Type* 1 in terms of *n* and *k*:

In a list of *Type* 2, the four positive integers *a, b, c* and *d* that form the sequence satisfy *a < b < c < d, a* occupies the first and *d* the third position in the sequence. The lowest possible value for *a* in the list *a_d_* is 1, while its greatest possible value is (*n* - 3), which is explained in the same way as the previous case. Since the sequence is cyclic, both *abcd* and *acdb* are equivalent to the same 4-cycle. So as to avoid counting it twice, we make the convention to consider the sequence which has the lower number in its second position (*abdc*).

Tables 3 and 4 are used to organize the counting of all cycles associated to lists of Type 2 Table 3 has *n* - 2*k* + 2 rows and *n -* 2 columns. The first column indicates the possible values of *a*, which can vary from 1 to (*n* - 2*k* + 1), while the first row shows all possible values for *d*, which can go from *4* to *n*. A cell *rs, r* = 2,3,…, *n - k* + 2 and, *s* = 2,3,…, *n* - 2, is filled in with the number of 4-cycles having the value of *a* given in cell *r*1 and the value of *d* given in cell 1*s*. A cell is left empty if it does not exist any such cycle for the given values of *a* and *d*.

By construction of
we show that, for each 1 ≤ *a* ≤ (*n* - 2*k* + 1), it exists a 4-cycle associated to a List of Type 2 if *d* is any integer satisfying (*a* + 3) ≤ *d* ≤ (*a* + 2*k* -1). In fact, the gaps in a *Type* 2 list must be filled in with two distinct integers strictly greater than *a* and lower than *d*; therefore, the minimum acceptable value for *d* is (*a* + 3). On the other hand, *d* cannot be greater than (*a* + 2*k* -1), since that would contradict the fact that two adjacent vertices in
are connected by a path of length at most *k*.

Let 1 ≤ *a* ≤ (*n* - 2*k* + 1) and (*a* + 3) ≤ *d* ≤ (*a* + 2*k* - 1) (non empty cells of Table 3). Assume that exist exactly *i* integers *j*
_{l}, *l* = 1,2,.., *i*, satisfying, for each *l*, *a* <_{
jl
} < *d*, |*a* -_{
jl
} | ≤ *k* and |*d* - _{
jl
} | ≤ *k*.

The number of ways that the gaps in a list *a_d_*, can be filled in with any two of these integers, putting the lower between them in the second position, is

It remains to analize the cases (*n* - 2*k* + 2) ≤ *a* ≤ (*n* - 3). Table 4 (p. 9), which has 2*k* - 2 rows and *n* - 2 columns, is useful for this purpose. Its cells are filled in analogously as the previous table, having attention to the fact that the values of *d* cannot exceed *n*. By considering the rows of Table 4 in pairs (first row with the last, second row with the second-to-last, and so on), we see that the number of ways that the gaps in a list *a_d_* can be filled in with any two of these integers, putting the lower between them in the second position, is

Summing the expressions on the right side of equalities (3.6) and (3.7), we arrive at the number of non isomorphic 4-cycles in
associated to a list of *Type* 2 in terms of *n* and *k*:

Therefore, the total number *n*
_{4} of non isomorphic 4-cycles in
in terms of *n* and *k* can be obtained by the sum of (3.5) and (3.6):

A few simplifications must be made to recognize (3.9) as (3.2). The last part on the right side of (3.9) can be rewritten as (*n - k -* 1)
. By clustering up the sums of arrangements, we see that (3.9) is equivalent to

The term (iii), in turn, is equal to
. Replacing (i), (ii) and (iii) by their simplified expressions and rearranging terms, we finally arrive at the polynomial in *n* and *k* presented in (3.2).

From (3.2), we compute _{
n4
}
= 8 4-cycles for the 2-path on 11 vertices in Figure 1(a) and *n*
_{4}
= 280 for the 5-path on 11 vertices in Figure 1(b).

4. The fifth characteristic coefficient

The elementary subgraphs with four vertices in a graph *G* are those composed by two disjoint edges and the cycles of length 4. From (1.1), the fifth characteristic coefficient of *G* can be computed by the difference _{
a4 = n2 -2n4,
} where _{
n4
} is the number of 4-cycles and *n*
_{2} is the

number of pairs of disjoint edges in *G*. The number *n*
_{2} is equivalent to ϵ_{2} in (1.2), so that the difference can be rewritten as *a*
_{4} = *n*
_{2} - *2n*
_{4} (^{15}).

**Lemma 1. :** For the *k*-power of a path graph on *n* vertices,
, *n > 2k*, the coefficient *a*
_{4} in the characteristic polynomial
is given by

**Proof.** The degree sequence of a *k*-path on *n* vertices is

as shown in (^{(13)}). The sum of squares of the degrees is equal to

Therefore, ϵ_{2} can be computed by replacing (2.1) and (4.2) in (1.2). Subtracting twice the expression for *n*
_{4} in (3.2) from ϵ_{2}, we arrive at the polynomial in *n* and *k* presented in (4.1).

By (4.2), we get *a*
_{4}
= 105 and *a*
_{4}
= -45 for the graphs depicted in Figure 1.

Table 1: Number of 4-cycles in
whose sequences of vertices can be identified to a list of *ype* 1 (*a_d*,), for *a* = 1,2,…,*n - k.*

Table 2: Number of 4-cycles in
whose sequences of vertices can be identified to a list of *Type* 1 (*a_d*), for *a = n* - *k* + 1, *n* - *k* + 2, …, *n* - 4, *n* - 3.

Table 3: Number of 4-cycles in
whose sequences of vertices can be identified to a list of *Type 2* (*a_d_*), for *a* =1,2,…,*n* - 2k + 1.

Table 4: Number of 4-cycles in
whose sequences of vertices can identified to a list of *Type 2* (*a_d_*), for *a* = *n - 2k + 2, n - 2k + 3, …, n - 4, n - 3.*