Fast recognition of some parametric graph families

We identify all $[1, \lambda, 8]$-cycle regular $I$-graphs, all $[1, \lambda, 8]$-cycle regular double generalized Petersen graphs, and the unique $[1, \lambda, 6]$-cycle regular folded hypercube. As a consequence we describe linear recognition algorithms for the first two graph families, and a quasilinear recognition algorithm for the folded hypercubes.


Introduction
Understanding the cycle (or anticycle) structure in a given graph is fundamentally related to graph families such as trees, perfect graphs, bipartite graphs, (weakly) chordal graphs, pancyclic graphs, and many others. A particularly strong cycle-related property is the notion of cycle-regularity, introduced by Mollard [20], which has been used to better understand the structure of graph families such as hypercubes or generalized Petersen graphs.
In this paper we study cycle-regularity and isomorphism structure of three graph families, namely the folded hypercubes and two natural generalizations of generalized Petersen graphs: I-graphs and double generalized Petersen graphs. I-graphs, introduced in the Foster census [8], are trivalent or cubic graphs with edges connecting vertices of two star polygons. Double generalized Petersen graphs consist of two identical copies of generalized Petersen graphs, where instead of connecting the vertices inside a star polygon, we connect the vertices from two different star polygons accordingly. These graphs were first introduced in 2012 by Zhou and Feng [28]. Folded hypercubes were proposed by El-Amawy and Latifi [17] and are formed by adding diagonal edges to the hypercube graphs.
We describe which graphs from the first two graph families are [1, λ, 8]-cycle regular, and also which folded hypercubes are [1, λ, 6]-cycle regular. We then use those results to devise corresponding recognition algorithms which run in linear time for the case of I-graphs and double generalized Petersen graphs and 1 arXiv:2008.08856v1 [math.CO] 20 Aug 2020 in quasilinear time for the folded hypercubes. We proceed by describing those three graph families, alongside the relevant related work. Figure 1: I-graph I (12,2,3), double generalized Petersen graph DP(6, 1), folded hypercube FQ 3 .

Related work
Generalized Petersen graphs were introduced in 1950 by Coxeter [7] and later named by Watkins [25] in 1969. Some of the results known for this family include identifying generalized Petersen graphs that are Hamiltonian [1,2,5], hypo-Hamiltonian [4], Cayley [21,18], or partial cubes [14], and finding their automorphism group [9] or determining isomorphic members of the family [22]. Additional aspects of the above-mentioned family are well surveyed in [6,11]. For this family, Watkins [25] had studied the structure of 8-cycles already in 1969, while linear recognition was settled by Krnc and Wilson [15].
Two natural generalizations of generalized Petersen graphs are I-graphs and double generalized Petersen graphs. The family of I-graphs has been studied extensively with respect to their automorphism group and isomorphsms [22,3,12]. In addition to that, Horvat et. al. [12] described their connectedness and girth, while Boben et al. [3] studied their bipartiteness, vertex transitivity, and also considered some configurations which arise from bipartite I-graphs. For double generalized Petersen graphs, Kutnar and Petecki [16] characterized their automorphism group and also consider their hamiltonicity, vertex-coloring and edge-coloring.
Folded hypercubes were first proposed by El-Amawy and Latifi [17], where their structure was used to develop efficient routing algorithms for broadcasting. After that they were studied with respect to their cyclic structure [26], edgefault-tolerant properties [27], hamiltonian-connectivity and strongly Hamiltonianlaceability [13], their automorphism group and symmetries [19].

Definition 7 (Mollard
It is easy to see that [1, λ, 8]-cycle regular cubic graphs are also [0, 3λ/2, 8]cycle regular, but the converse does not hold. Related to this we define σ : E(G) → N, where σ(e) corresponds to the number of distinct 8-cycles an edge e belongs to. We call σ(e) an octagon value of an edge e, and we say that a graph G has a constant octagon value if σ is a constant function. Similarly we define a map σ , which computes in how many 6-cycles an edge lays. Again, graph G has a constant hexagon value if σ is a constant function.
A definition of a robust algorithm was introduced by Spinrad in [24] and states that an algorithm is robust if it takes as an input an arbitrary graph and it either determines the parameters of the graph belonging to our family or concludes that an input does not belong to the desired graph family.

I-graphs
For integers n, j, k, where n ≥ 3 and n ≥ j, k ≥ 1, an I-graph I(n, j, k), is a graph with the vertex set {u 0 , u 1 , . . . u n−1 , w 0 , w 1 , . . . , w n−1 } and the edge set consisting of outer edges u i u i+j , inner edges w i w i+k and spoke edges u i w i , where the subscripts are taken modulo n. Without loss of generality we always assume that j, k < n/2. Since I(n, j, k) is isomorphic to I(n, k, j), we restrict ourselves to cases when j ≤ k. Generalized Petersen graphs form a subclass of I-graphs, where parameter j has value 1.
It is well known [3] that an I-graph I(n, j, k) is disconnected whenever d = gcd(n, j, k) > 1. In this case it consists of d copies of I(n/d, j/d, k/d). Therefore, throughout the paper we consider only graphs I(n, j, k) where gcd(n, j, k) = 1. We also know [12] that two I-graphs I(n, j, k) and I(n, j , k ) are isomorphic if and only if there exists an integer a, which is relatively prime to n, for which either {j , k } = {aj (mod n), ak (mod n)} or {j , k } = {aj (mod n), −ak (mod n)}. Throughout the paper, whenever we discuss I-graphs with certain parameters, we consider only the lexicographically smallest possible parameters by which the graph is uniquely determined.

Equivalent 8-cycles
Every I-graph admits a rotation ρ defined in a natural way: ρ(u i ) = u i+1 , ρ(w i ) = w i+1 . Clearly, applying n times the rotation ρ yields an identity automorphism. When acting on I-graphs with ρ we get 3 edge orbits: orbit of outer edges E J , orbit of spoke edges E S and orbit of inner edges E I . Edges from the same orbit E J , E S , or E I have the same octagon value, which we denote by σ J , σ S and σ I , respectively. Therefore the octagon value of a graph is said to be a triple (σ J , σ S , σ I ).
In the I-graph I(n, j, k) outer edges E J induce gcd(n, j) cycles of length n/ gcd(n, j), inner edges E I induce gcd(n, k) cycles of length n/ gcd(n, k) and spoke edges E S induce a perfect matching.
We say that two 8-cycles of an I-graph are equivalent if we can map one into the other using only rotation ρ.
Let G I(n, j, k) be an arbitrary I-graph and let C be one of its 8-cycles. With γ(C) we denote the number of equivalent 8-cycles to C in G. Each 8cycle contributes to the octagon value of a graph. We denote the contributed amount with τ (C), defined as the triple (δ j , δ s , δ i ), where we calculate δ j , δ s , δ i by counting the number of outer, spoke and inner edges of a cycle and multiply these numbers with γ/n. If graph G admits m non-equivalent 8-cycles, one may calculate its octagon value (σ J , σ S , σ I ) as The following claim serves also as an example of the above-mentioned definitions. Keep in mind that we are considering only I-graphs with gcd(n, j, k) = 1.

Claim 8.
For I(n, j, k) where n > 3 and integers k, j < n/2 there always exists an 8-cycle.

Characterization of non-equivalent 8-cycles
The purpose of this section is to provide a complete list of all possible nonequivalent 8-cycles that can appear in an I-graph. For each such 8-cycle we additionally determine the contribution towards the (σ j , σ i , σ s ) values. Those results are summarized in Tables 1 and 2 and Figure 2.
The related case analysis is discussed in the subsections below, and organized as follows. We first distinguish 8-cycles by the number of spoke edges they admit. Indeed it is easy to see that an arbitrary 8-cycle can have either 4, 0 or 2 spoke edges. The first two cases correspond to Sections 2.2.1 and 2.2.2, respectively. For the last case we further distinguish cases by the number of outer and inner edges within a given 8-cycle. Those cases are discussed in Sections 2.2.3 to 2.2.5.

8-cycles with 4 spoke edges
In addition to 4 spoke edges the 8-cycle must have also two inner and two outer edges. When using the spoke edge there are two options for choosing an inner (outer) edge. After a thorough analysis of all possibilities it is easy to see that (c) Cycle C1 in blue and C2 in red. there can be just two such 8-cycles, C * (see Figure 2a), which exists whenever j = k, and C 0 which is of the following form: C 0 = (u 0 , w 0 , w ±k , u ±k , u ±k±j , w ±k±j , w ±2k±j , u ±2k±j ), see Figure 2b. Cycle C 0 exists whenever 2k + 2j = n. One can verify easily, that n applications of the rotation ρ to C * and n/2 applications of the rotation ρ to cycle C 0 maps the cycle back to itself. Therefore there are n equivalent cycles to C * and n/2 equivalent cycles to C 0 in an I-graph I(n, j, k) and they contribute (2,4,2) and (1, 2, 1), respectively, to the graph octagon value.

8-cycles without spoke edges
In this case we have 2 options for such a cycle, either it lies completely in the outer rim or in the inner rim (see Figure 2c). By the definition of I-graphs, cycles in the outer rim (inner rim) are of length n/ gcd(n, j) (n/ gcd(n, k)), therefore this cycle exists when 8j ≡ 0 (mod n) (8k ≡ 0 (mod n)). Using this equation and the fact that j < n/2 (k < n/2) we get the following conditions: either 8j = n (8k = n) or 8j = 3n (8j = 3n). These cycles are of the following form: see Figure 2c. Each edge appears only in one cycle of this form, therefore there are n/8 equivalent such cycles. These cycles contribute (1, 0, 0), (0, 0, 1) Label A representative of an 8-cycle Existence conditions C * (u 0 , w 0 , w ±k , u ±k , u ±k±j , w ±k±j , w ±j , u ±j ) k = j and n > 4 5j − k = 2n or n or 0 3k − 3j = n or 0 respectively, to the octagon value of a graph.

8-cycles with 1 edge in the outer or inner rim
In this case cycles are of form also see Figures 2d and 2e. This happens when 5k +j ≡ 0 (mod n) or 5k −j ≡ 0 (mod n) in the first case, k + 5j ≡ 0 (mod n) in the second case. Since there is only one edge in the outer or inner rim, we can see that the number of equivalent cycles equals n. Therefore they contribute to the octagon value of a graph (1, 2, 5) and (5, 2, 1) respectively.

8-cycles with 2 edges in the outer or inner rim
In this case cycles are of form: also see Figures 2f and 2g. This happens when 4k +2j ≡ 0 (mod n) or 4k −2j ≡ 0 (mod n) for the first case and 2k + 4j ≡ 0 (mod n) or 2k − 4j ≡ 0 (mod n) for the second one. To determine their contribution to the octagon value of a graph, it is necessary to see that there are n such equivalent 8-cycles. In the case of C 5 , we prove this by taking vertices on the outer rim u 4k , u 4k±j , u 4k±2j . Two of those vertices (u 4k , u 4k±2j ) are incident to a spoke edge and an outer edge, where u 4k±j is incident only to outer edges. So if we want γ(C 5 ) to be less than n, there would have to exist i ∈ N such that ρ i (u 4k ) = u 4k±2j and ρ i (u 4k±j ) = u 4k±j , which is not possible. We can argue similarly for C 6 . Therefore C 5 and C 6 occur n times and contribute to the octagon value of a graph (2, 2, 4), (4, 2, 2) respectively.

8-cycles with 3 edges in the outer and inner rim
In this case cycles are of form: also see Figure 2h. This happens when 3k + 3j ≡ 0 (mod n) or 3k − 3j ≡ 0 (mod n). Similarly as before, we can show that C 7 occurs n times. If we observe vertices of the outer rim u 0 , u j , u 2j , u 3j , we see that the first and last vertex u 0 , u 3j are incident to one outer and one spoke edge, where u j , u 2j are incident to two outer edges. In this case the rotation ρ i would need to map u 0 to u 3j and u j to u 2j , which is impossible. Therefore C 7 occurs n times and contributes (3,2,3) to the octagon value of a graph. All possible 8-cycles with their existence conditions are summed up in Table 1, whereas their contributions to graph octagon value and number of equivalent cycles are summed up in Table 2.
n n/2 n/8 n/8 n n n n n

Obtaining constant octagon value
As we observed, every 8-cycle of an I-graph contributes to the octagon value of each edge partition. It will turn out that if we can identify at least one edge partition of a graph, we can easily determine its parameters. Therefore, we want to find graphs with constant octagon value, these are graphs for which all edges touch the same number of 8-cycles. They are called [1, λ, 8]-cycle regular. To compute their parameters we use calculations from previous sections. We consider all possible collections of 8-cycles and determine octagon values of I-graphs admitting those 8-cycles. Since I-graphs are defined with 3 parameters and all 8-cycles give constraints for these parameters, it is enough to consider collections of at most 4 cycles, to uniquely determine all [1, λ, 8]-cycle regular graphs. Some 8-cycles have more than one existence condition, so it can happen that the graph admits multiple 8-cycles of the same type. This happens with cycles C 5 , C 6 where such graph is isomorphic to G(8, 2) and with C 7 where a graph is isomorphic to G(6, 1). In both cases the octagon value of a graph is not constant. With other cycles existence conditions exclude each other, therefore there is at most one occurrence of each non-equivalent 8-cycle in an arbitrary I-graph.

Coexistence of C 0 and C 7 .
If an I-graph G admits only two 8-cycles, one of form C 0 and the other of form C 7 , then it has a constant octagon value (4,4,4). In this case G does not admit any other cycle, neither C * , which holds whenever k = j. Combining this with conditions for C 0 and C 7 we can see that there is exactly one such graph, namely the Cubical graph G(4, 1).

Coexistence of C 0 , C 1 and C 2 .
An I-graph G which admits exactly these three 8-cycles has the octagon value (2, 2, 2). After observing the existence conditions from Table 2 for C 0 , C 1 , C 2 and taking into consideration that C * does not exist, we conclude that such an I-graph does not exist.

Coexistence of C 3 , C 4 and C * .
In this case the octagon value of a graph equals (8,8,8). Possible I-graphs containing these three 8-cycles are calculated in Table 3, using existence conditions of C 3 , C 4 and considering that an I-graph admits C * whenever j = k. Table 3: I-graphs containing C 3 , C 4 and C * .

Coexistence of C 5 , C 6 and C *
Also in this case the octagon value of a graph equals to (8,8,8). Using similar approaches as before we get results that are summed up in Table 4.
not exist not exist Table 4: I-graphs containing C 5 , C 6 and C * .

No 8-cycles.
In this case the octagon value is (0, 0, 0). A triangular prism graph or G (3,1) is the only such graph from the family of I-graphs.

[1, λ, 8]-cycle regular I-graphs
After considering all the cases we see that there is a finite list of [1, λ, 8]-cycle regular I-graphs. Using isomorphism properties of I-graphs we can determine which graphs from Tables 3 and 4 are isomorphic. It turns out that they are all in the family of generalized Petersen graphs. All [1, λ, 8]-cycle regular I-graphs are listed in Table 5.
All [1, λ, 8]-cycle regular graphs are listed in Table 5 together with their well-known names and are depicted in Figure 3.

Double generalized Petersen graphs
Double generalized Petersen graphs DP(n, k) represent another natural generalization of generalized Petersen graphs. They are defined for integers n ≥ 3, k < n/2, on the vertex set {u 0 , u 1 , . . . u n−1 , w 0 , w 1 , . . . , w n−1 , x 0 , x 1 , . . . , x n−1 , y 0 , y 1 , . . . , y n−1 } and the edge set consisting of outer edges u i u i+1 , x i x i+1 , inner edges w i y i+k , y i w i+k and spoke edges u i w i , x i y i , where the subscripts are taken modulo n. To get a better feeling for the structure of this graph family we append two interesting observations. Theorem 9 (Qin et al. [23]). DP(n, k) and G(n , k ) are isomorphic if and only if n is an odd integer and gcd(n, k) = 1. In this case n = 2n and k is a unique even integer, such that kk ≡ ±1 (mod n). Theorem 4. Let n, k be positive integers, where n is even and k < n/2. Then the graph DP(n, k) is isomorphic to DP(n, n/2 − k).
Proof. All subscripts in the proof are taken modulo n. Let We define a permutation Π on vertices of DP(n, k) as follows: for i = 0, 1, . . . , n − 1. If we want Π to be an isomorphism it needs to preserve all the edges set-wise. It is easy to see that the outer edges u i u i+1 , x i x i+1 are mapped to outer edges and spoke edges u i v i , x i y i to spoke edges. In the case of inner edges, Π maps w i y i+k to w i y i+k+n/2 . Since k + n/2 ≡ n − (k + n/2) ≡ n/2 − k ≡ j (mod n), we can write this edge as w i y i+j . Similarly we check that y n/2+i w n/2+i+k is mapped to y i w i+j . Therefore DP(n, k) ∼ = DP(n, j).

Equivalent 8-cycles
Every double generalized Petersen graph admits the rotation ρ, defined as: and an automorphism α that interchanges vertices of one copy of a generalized Petersen graph with another: When acting with ρ and α on any double generalized Petersen graph we get 3 edge orbits: orbit of outer edges E J , orbit of spoke edges E S and orbit of inner edges E I . Orbit of outer edges induces two cycles of length n, orbit of spoke edges induces a perfect matching and orbit of inner edges induces either 2 · gcd(n, k) cycles of length n/ gcd(n, k) if n/ gcd(n, k) is even and gcd(n, k) > 1, or gcd(n, k) cycles of length 2n/ gcd(n, k) otherwise. Each double generalized Petersen graph admits at least one 8-cycle.

Claim 10.
For positive integers n, k where n ≥ 3 and k < n/2, graph DP(n, k) always admits an 8-cycle To study the structure of 8-cycles in double generalized Petersen graphs we use the same approaches as in the case of I-graphs, therefore some notation and calculation is omitted. We say that two 8-cycles are equivalent if we can map one into the other not only using the rotation ρ but also automorphism α. To calculate the contribution τ of an 8-cycle, to the octagon value of a graph, we again calculate δ j , δ s , δ i by counting the number of outer, spoke and inner edges but in this case we multiply these numbers with γ/2n.

Characterization of non-equivalent 8-cycles
In this section we provide a list of all possible 8-cycles in double generalized Petersen graphs and determine their contribution to the octagon value of a graph. The results are summarized in Tables 6 and 7 and shown on Figure 6.  The related case analysis is discussed in the subsections below, and organized as follows. We first distinguish 8-cycles by the number of spoke edges they admit. Indeed, it is easy to see that an arbitrary 8-cycle can have either 4, 0 or 2 spoke edges. The first two cases correspond to Sections 3.2.1 and 3.2.2, respectively. For the last case we further distinguish cases by the number of outer and inner edges within a given 8-cycle. Those cases are discussed in Section 3.2.3.
Even though double generalized Petersen graphs are undirected, we use the orientation of edges in the following 8-cycle analysis, to make the process easier. We say that an edge

8-cycles with four spoke edges
In this case the 8-cycle admits also two inner and two outer edges. We distinguish 3 different such 8-cycles regarding the orientation of outer and inner edges. If one of the outer edges and one of the inner edges have positive orientation and the other outer and inner edge have negative orientation, we have a cycle of the form C * (see Figure 5a). If all edges have the same orientation ( Figure 5b) the cycle is of the following form If outer edges are positively oriented and inner edges negatively, or vice versa, the cycle is of form also see Figure 5c.

8-cycle with no spoke edges
There are two such non-equivalent 8-cycles, one on outer edges and one on inner edges

Constant octagon value
Similarly as in the case of I-graphs, we are interested in double generalized Petersen graphs with constant octagon value. Here we also have some 8-cycles with more than one existence condition, so it can happen that a double generalized Petersen graph admits two 8-cycles of the same type. This happens only in the case of cycle C 5 and with the graph DP(8, 2), which has a non-constant octagon value. Therefore we can assume that an arbitrary double generalized Petersen graph admits at most one 8-cycle of each form. Considering all existence conditions of these cycles we can calculate parameters n, k of [1, λ, 8]-cycle regular graphs, see Table 8. Using Theorem 4 we determine that there are just two [1, λ, 8]-cycle regular double generalized Petersen graphs, with the value of λ being 8. They are depicted in Figure 6. 2k + 4 = n 2k − 4 = n 4k + 2 = n not exist DP(10, 2) 2k + 1 = n not exist DP(5, 2) 4k − 2 = n DP(10, 3) not exist 4k − 2 = 0 not exist not exist Table 8: DP graphs containing C 4 , C 5 and C * .
It is worth mentioning that these [1, λ, 8]-cycle regular graphs are edge transitive, in fact they are the only edge transitive double generalized Petersen graphs (see Kutnar and Petecki [16]). Notice, Theorem 9 implies that the graph DP(5, 2) is isomorphic to the Desargues graph, i.e. G (10, 2). The other [1, λ, 8]cycle regular graphs are not isomorphic to a generalized Petersen graph.

Folded hypercubes
An n-dimesional hypercube Q n is a graph on 2 n vertices, where vertices are represented with a binary string (x 1 x 2 . . . x n ), while two vertices are adjacent whenever they differ in exactly one bit. We call these edges hypercube edges and denote them by H. For a binary value x we use x to denote 1 − x. The n folded hypercube FQ n is formed by adding complementary edges, i.e. edges between (x 1 x 2 . . . x n ) and (x 1 x 2 . . . x n ), to the hypercube Q n . We also call these edges diagonal edges and denote them by D. Note, the set of edges of a folded hypercube is partitioned into H and D.
Every hypercube edge gets a label i from {1, 2, . . . n}, where its value represents the bit at which adjacent vertices differ. Every diagonal edge is labeled with d. With d * we denote the diagonal edge between vertices (0, 0, . . . , 0) and (1, 1, . . . , 1). Cycles in this section are labeled using a sequence of edges, instead of vertices, as it was done in previous sections.
One should note that there are multiple edges with the same label, but they can never be incident, since each vertex is incident to exactly one edge of each label. For example, see Figure 7. Remark 11. Let C be an arbitrary cycle in a folded hypercube FQ n . Then all edge labels {1, 2, . . . , n, d} in C appear in C either all even or odd times.
Some of the results relevant to our study are summed up in the following theorems.
Theorem 12 (Ming, Meijie [26]). FQ n is a bipartite graph if and only if n is odd.
Theorem 13 (Ming, Meijie [26]). Every edge of FQ n lies on every cycle of even length from 4 to 2 n . Moreover, if n is even then every edge lies also on every cycle of odd length from n + 1 to 2 n − 1.
As an introduction to this section we prove the following observation regarding 4-cycles in folded hypercubes. Proof. Since FQ 1 K 2 and FQ 3 K 4,4 , the claim trivially holds for n ∈ {1, 3}. So assume n / ∈ {1, 3} and observe that two diagonal edges cannot be consecutive, therefore an arbitrary 4-cycle admits at most two of them. In fact, with the exception of FQ 3 , 4-cycles in all folded hypercubes admit either 2 or 0 diagonal edges.
To prove that an FQ n is [1, n, 4]-cycle regular, when n / ∈ {2, 3}, we need to take an arbitrary edge, denote it e, and check in how many 4-cycles it lays. We have two possibilities, either e is a diagonal edge or a hypercube edge. In the case e is a diagonal edge, the 4-cycle consists of an additional diagonal edge and two hypercube edges. There are n such cycles. In the case e is a hypercube edge, the 4-cycle admits also either 2 or 0 diagonal edges. If there are 2 diagonal edges the cycle is uniquely determined, if there are no diagonal edges there are n − 1 such cycles.
Since FQ n graphs are [1, λ, 4]-cycle regular we cannot use 4-cycles to determine their edge orbits. It turns out that this can be done using 6-cycles.

Equivalent 6-cycles
We want to determine the hexagon value of an arbitrary folded hypercube G. It is not hard to see that all hypercube edges admit the same hexagon value and that the same holds for all diagonal edges. Therefore we denote the hexagon value of G as a pair of integers (σ H , σ D ), where σ H and σ D represent the number of 6-cycles a hypercube or diagonal edge belongs to.  (a 1 a 2 a 3 a 4 a 5 a 6 ) and For better understanding of the definition see the following example. holds C 1 (f ) = C 2 . However, C 3 is not equivalent to any of the given 6-cycles, because there does not exist such a permutation on F 6 that would map 2 or 5 to d.

Characterization of non-equivalent 6-cycles
In this section we provide all possible non-equivalent 6-cycles that appear in folded hypercubes. For each such cycle we determine what is its contribution towards the hexagon value of a graph. We do this in two steps. First we write all cycles with the edge sequence starting with a hypercube edge and then with a diagonal edge, from which determining hexagon values of H and D edges follows easily.

Contribution of 6-cycles to σ H
In this part we write all 6-cycles where the first edge is a hypercube edge. Because of the equivalence of 6-cycles, we can write them starting with edge labeled 1. We distinguish these cycles by the number of diagonal edges they admit. Since two diagonal edges are never consecutive, a 6-cycle can admit either 0, 1, 2 or 3 of them. Throughout this section, n is the dimension of the folded hypercube FQ n , the diagonal edge is denoted by d and i, j, k, l > 1 are distinct, positive integers, smaller than n + 1. All of the calculation is summarized in Table 9 and Figure 8.
If a cycle admits no diagonal edges it has to be of one of the following forms: i, j, 1, j, i).
The contribution of each cycle to the hexagon value of hypercube edges of a graph is (n − 1)(n − 2).
(a) Cycle C0. If a cycle admits only one diagonal edge it has one of the five following forms: (1, d, i, j, k, l) or These cycles exists only in the case of FQ 5 and contribute 24 to the hexagon value of hypercube edges.

If a cycle admits three diagonal edges it is of the form
This cycle exists only in the case of FQ 3 and contributes 2 to the hexagon value of hypercube edges. Table 9: All non-equivalent 6-cycles of FQ n -graphs (n / ∈ {3, 5}) starting with hypercube edge 1.

Contribution of 6-cycles to σ D
Again we distinguish 6-cycles by the number of diagonal edges they admit. Since these cycles start with d * they can admit either 1, 2 or 3 diagonal edges. All of the calculation is summarized in Table 10 and Figure 9.
(a) Cycle Ca. If a cycle admits two diagonal edges it has one of the following forms: i, j, i, d, j).
These cycles contribute n(n − 1) to the hexagon value of diagonal edges.
If a cycle admits three diagonal edges it exists only in the case of FQ 3 and is of the form:C = (d * , i, d, j, d, k).
It contributes 6 to the hexagon value of diagonal edges. Whenever we have a folded hypercube for which σ H = σ D we are not able to recognize any of its edge orbits. Using the above calculations we get the following result. Using this result we can recognize all folded hypercubes in quasilinear time.

Recognition algorithms
In this section we describe recognition algorithms for all of the described graph families. Since recognition algorithms for I-graphs and double generalized Petersen graphs are very similar, we analyze them together (see Section 5.1) and then we proceed with the analysis of the recognition algorithm of folded hypercubes (see Section 5.2). All of the algorithms are robust, which means that they receive as an input an arbitrary graph and then in linear or quasilinear time determine if the graph is a part of the family of I-graphs, double generalized Petersen graphs or folded hypercubes. In the case the input graph belongs to the observed family, the algorithm provides its parameters, together with the certificate of correctness (exact isomorphsim).

Recognizing I-graphs and double generalized Petersen graphs
This algorithm uses some of the properties of graph families discussed above and is presented in Algorithm 1.
Recall, the set of edges of an arbitrary I-graph or double generalized Petersen graph can be partitioned into 3 parts, where edges from each part admit the same octagon value.
In particular, whenever the input graph G is from the family of I-graphs or double generalized Petersen graphs, unless it is [1, λ, 8]-cycle regular, we can immediately identify one of its edge orbits (E I , E J , or E S ) of size |V (G)|/2. Theorems 1 and 2 guarantee that such a graph is [1, λ, 8]-cycle regular only in one of the cases described in previous sections (see Figures 3 and 6). Since the octagon value of each edge is computed in constant time and there is a finite number of the [1, λ, 8]-cycle regular I-graphs and double generalized Petersen graphs, the first part of Corollary 6 holds.

Description of Algorithm 1
We first note, that if G is not cubic then it does not belong to any of our graph families. Since checking whether a graph is cubic takes linear time we simply assume that the input graph is cubic. Furthermore, if G is not connected then it can only be a member of a family of I-graphs -this only happens whenever it consists of components isomorphic to an I-graph with the same parameters. However, this case can easily be resolved by separately checking each part, so we also assume that the input graph is connected. Algorithm 1 consists of the following 3 parts.

Algorithm 1
Recognition procedure for I-graphs or for DP graphs, depending on the subprocedure Extend(G, U ). Using set U for determining parameters of a given graph.

Require
The algorithm uses computed set U to determine exact isomorphism between G and an I-graph or a double generalized Petersen graph, if it exists. This procedure differentiates regarding the graph family we are consiedering. The related procedure Extend(G, U ) is performed in Θ(|E(G)|) time.

Subprocedure Extend(G, U ) for I-graphs
It is easy to see that Extend(G, U ) can safely reject G, if |V (G)| is not divisible by 2. For this subprocedure, set n = |V (G)|/2 and G[U ] by H. Again, there are two possibilities. H = G. In this case graph G has a constant octagon value. All ten I-graphs with constant octagon value are depicted in Figure 3, and checking G against them takes constant time.
H is of order 2n and is 1-regular. Since U is a perfect matching of G the set E(G) \ U is a collection of cycles. If G is an I-graph, then there exist positive integers i, j, l 1 , l 2 with j ≤ i such that there are j cycles of length l 1 and i cycles of length l 2 . It remains to determine parameter k and check whether G I(n, j, k). This procedure is described in Section 5.1.4. Again, the whole procedure Extend(G, U ) is performed in linear time.

Subprocedure Extend(G, U ) for double generalized Petersen graphs
It is easy to see that Extend ( H is of order 4n and is 1-regular. Since U is a perfect matching of G the set E(G) \ U is a collection of cycles. In order for G to be a double generalized Petersen graph, there must be two cycles of length n and m cycles of length a, where m, a are positive integers. It remains to determine parameter k. Since we already uniquely identified the set of spokes U , this can be achieved easily (for the detailed procedure see Section 5.1.4), and hence the whole procedure Extend(G, U ) is performed in linear time.
If H and G do not satisfy any of the above two possibilities, or if the isomorphism does not exist, the algorithm returns False. If there is an isomorphism, then the algorithm returns parameters of the corresponding double generalized Petersen graph. For the detailed description of how to check isomorphisms see Section 5.1.4.

Finding exact isomorphisms
In this section we provide a procedure for determining exact isomorphisms with I-graphs or double generalized Petersen graphs.

Exact isomorphism of double generalized Petersen graphs
Since U is a perfect matching of G, the set E(G) \ U is a collection of cycles. There are two cycles of length n and m cycles of length a. To determine parameter k first fix one n-cycle as (u 0 , . . . , u n−1 ). Using U determine their neighbours w i . With the help of a cycle from E(G) \ U that goes through vertex w 0 , label its neighbours, different than u 0 , as y k and y −k , in an arbitrary way. Again using a perfect matching U determine x k and x −k . Now, using an n-cycle from E(G) \ U , that goes through x k and x −k , label vertices x 0 , x 1 , . . . x n−1 in such a way that p = x −k , x −k+1 , . . . x 0 , x 1 , . . . , x k is a path using an even number of edges. From this determine also parameter k. In the case of n being even we get two paths from x −k to x k of even length. Both paths will give us a different value for parameter k, but since Theorem 4 holds, their graphs are isomorphic. Now that all vertices x i are labeled, determine all vertices y i using U . At this point it remains to check if all cycles from E(G) \ U respect computed labeling. In the case they do a graph G is isomorphic to DP(n, k), if they do not, then G is not from our family.
It is easy to see that this procedure is completed in Θ(|E(G)|) time.

Exact isomorphism of I-graphs
Algorithm 2 is an extension of the subprocedure Extend(G, U ) of Algorithm 1 and provides an exact isomorphism from a graph G to an I-graph, if there exists. When considering the given algorithm one should note that all the subscripts are given modulo n where n equals |V (G)|/2.

Algorithm 2 Finding exact isomorphisms with an I-graph.
Require: connected cubic graph G on 2n vertices, together with a perfect matching U 1: k, j, l 1 , l 2 ← number of cycles in the set F = E(G) \ U and their lengths 2: Take a l 1 -cycle C from F and label its vertices as (u 0 , u j , . . . , u (l1−1)j ). 3: for both cycles of type C * through u 0 u j do 4: label the corresponding vertices w 0 , w k , u k , u k+j , w k+j , v j 5: for e ∈ {u 0 u j , u j u 2j , . . . , u (l1−1)j u 0 } do 6: Identify cycle C through e of form C * respecting current labeling.

7:
Label unlabeled vertices accordingly. 8: for any l 2 -cycle C do 9: find an edge of C labeled on both ends and label the rest of C. 10: Using U label remaining vertices.

11:
If labeling is consistent return True. 12: Return False.
Graph G and set U meet the requirements as this was checked already by Algorithm 1. Let n = |V (G)|/2. During the whole analysis we consider indices modulo n.
Because U is the perfect matching, F = E(G) \ U is the union of at least two disjoint cycles. Since G is connected F admits either 2 cycles of length n or more cycles of two different lengths. On line 1 we set the number of loneger cycles as j and fix their lengths as l 1 and the number of shorter cycles as k with the length l 2 . This is done in time O(|E(G)|).
Then we take an l 1 -cycle C from F and fix it on the outer rim as (u 0 , u j , . . . , u (l1−1)j ). For an edge u 0 u j we construct a cycle of form C * and label its vertices accordingly. Since the orientation of inner edges can be chosen in two ways and only one of these two produce the desired 8-cycle, we repeat the procedure at most 2 times. When C * is determined, we cyclicly go through the rest of the edges of C, identify their corresponding cycle C of form C * and label its vertices. Now we take one l 2 -cycle and find an edge with both incident vertices already labeled and we extend this labeling trough the whole cycle. At the end, we use U to label all remaining vertices. If the labeling is not consistent then either C * at line 3 was not oriented properly or G is not an I-graph. In the case of cycles from F being of the same lengths, constructing C * actually constructs a 4-cycle, which labels just 2 new vertices instead of 6, but the procedure still returns labeled I-graph. This procedure is performed in O(|E(G)|) time.
It is easy to see that Algorithm 2 labels all vertices.

Recognizing folded hypercubes
This algorithm uses properties of folded hypercubes discussed in Section 4 and the method for recognizing hypercubes, developed by Hammack et. al. [10]. The recognition algorithm identifies the set of the diagonal edges, by counting the number of 6-cycles an edge belongs to and uses this to find the parameters of the folded hypercube. From Theorem 3 follows that all folded hypercubes, except FQ 2 , can be recognized in such a way. Moreover, since FQ 2 is of constant size, the second part of Corollary 6 holds.

Description of Algorithm 3
Before we start with the description of the algorithm, we need to fix some notation. A folded hypercube of dimension n has 2 n vertices, denoted as N and 2 n−1 (n + 1) edges, which equals 1/2N log 2 N . For an algorithm we say that it is quasilinear if it needs O(N log k N ) time to complete, where k is a positive integer. For vertices u, v of graph G, the set W uv represents all the vertices of a graph that are closer to u than v.
Let us start with the analysis of our recognition algorithm for folded hypercubes.
If G is not connected, (n + 1)-regular on 2 n vertices, then it does not belong to the family of folded hypercubes. Since checking these conditions takes linear time, we simply assume that the input graph of the Algorithm 3 meets requirements. The algorithm consists of 2 parts.
Partitioning the edge partition set with respect to hexagon value. The algorithm determines hexagon value of each edge e ∈ E(G) and builds a partitions set P of graph edges (see lines 4-7). Since G is regular and all 6-cycles containing edge e consist of edges which are at distance at most 3 from e, it is enough to check a subgraph H of G of order O(n 3 ), to calculate hexagon value of edge e. Therefore, calculation of hexagonValue(e) takes O(log 3 N ) time for each edge e and this whole part is performed in Θ(N log 4 N ) time.
Identifying set of diagonal edges D and calculating graphs parameters. Since the only [1, λ, 6]-cycle regular folded hypercube is FQ 2 (this case is checked already at the beginning in line 1), there are exactly two partition sets in P, from where determining diagonal edges D takes constant time.
1: if n = 2 then 2: Check G ∼ = FQ 2 . return false. 10 Append label 0 to vertex in W uv and 1 to vertex in W vu . 15

17:
Append label 0 to vertices in W uv and 1 to vertices in W vu . 18: Check if diagonal edges U respect the labeling of vertices in G.
To determine graph parameters we first need to check that H = G[E(G)\D] is an n-dimensional hypercube and label it. We use similar approaches as Hammack et. al [10], who proved the existence of linear time recognition algorithm for them. We take an arbitrary edge e = uv of H and determine sets W uv , W vu , this is performed in O(|E(G)|) time. If H is an n-dimensional hypercube then W uv , W vu are two copies of an (n − 1)-dimensional hypercube. Therefore we need to check if edges between H[W uv ] and H[W vu ] induce a perfect matching on H and an isomorphism. This is again performed in O(|E(G)|) time. The algorithm adds 0 to vertices in the first set and 1 to vertices in the second one and recursively breaks them down. The procedure ends in n steps, labels all the vertices and is performed in linear time. When H is labeled, the algorithm inspects vertices joined by a diagonal edge and checks if they are labeled correctly. In the case the labeling is correct, the input graph G is isomorphic to the folded hypercube of dimension n. This part is performed in O(|V (G)|).
Since the slowest part of the algorithm needs Θ(N log 4 N ) time to perform, the whole algorithm runs in quasilinear time.

Conclusion
In this paper we settled [1, λ, 8]-cycle regularity for the families of I-graphs and double generalized Petersen graphs. For the latter family we also observed some isomorphisms. The full characterization of isomorphisms for the family of double Petersen graphs remains open. Besides that we proved that with the exception of FQ 2 , all folded hypercubes are [1, λ, 4]-cycle regular and none is [1, λ, 6]-cycle regular.
For a fixed edge, counting the number of distinct 6 or 8-cycles it belongs to enabled us to design linear time recognition algorithms for I-graphs and double generalized Petersen graphs and a quasilinear one for folded hypercubes. To the best of our knowledge, in addition to this work, such a procedure was so far only used in [15] for the family of generalized Petersen graphs. We believe that a similar approach should give interesting results for other parametric graph families of bounded degree, such as Johnson graphs, rose window graphs, or Tabačjn graphs.