Linear recognition of generalized Fibonacci cubes Q h ( 111 ) ∗

The generalized Fibonacci cube Qh(f) is the graph obtained from the h-cube Qh by removing all vertices that contain a given binary string f as a substring. In particular, the vertex set of the 3rd order generalized Fibonacci cube Qh(111) is the set of all binary strings b1b2 . . . bh containing no three consecutive 1’s. We present a new characterization of the 3rd order generalized Fibonacci cubes based on their recursive structure. The characterization is the basis for an algorithm which recognizes these graphs in linear time.


Introduction
The study of interconnection topologies is not just an important subject in the area of parallel or distributed systems, it also initiates the research work on several new interesting classes of graphs Liu and Hsu (1992).Besides hypercubes, Fibonacci cubes are the most known class of graphs which are applied as a model for interconnection network.They were studied from several points of view and they are known to possess many appealing properties Gregor (2006); Hsu (1993).
The Fibonacci cube Γ h , h ≥ 1, is defined as follows.The vertex set of Γ h is the set of all binary strings b 1 b 2 . . .b h containing no two consecutive 1's.Two vertices are adjacent in Γ h if they differ in precisely one bit.Several structural properties and applications including different metric aspects such as recursive construction, hamiltonicity, degree sequence and other enumeration have been investigated Castro and Mollard (2012); Dedó et al. (2002); Klavžar (2005); Klavžar andMollard (2012, 2014).For an extensive survey of Fibonacci cubes see Klavžar (2013).
Suppose f is an arbitrary binary string and h ≥ 1.The generalized Fibonacci cube, Q h (f ), was introduced as the graph obtained from Q h by removing all vertices that contain f as a substring Ilić et al. (2012).In this notation the Fibonacci cube Q h is Q h (11).The question for which strings f , Q h (f ) is an isometric subgraph of Q h is raised and answered in Ilić et al. (2012) for some small lengths of f .Also, for a given large length of f , the proportion of f such that Q h (f ) is an isometric subgraph of Q h is investigated Klavžar and Shpectorov (2012).
The subclass of generalized Fibonacci cubes, the graphs Q h (1 k ), have been introduced already in Hsu and Chung (1993) and further studied in Liu et al. (1994); Wasserman and Ghozati (2003); Zagaglia Salvi (1996).They are called the k-th order generalized Fibonacci cubes (of dimension h) in this paper (note that they were defined as "generalized Fibonacci cubes" in Hsu and Chung (1993)).
Hsu and Chung raised the following question Hsu and Chung (1993): Question 1.1 Given a graph, how to quickly decide whether it is the k-th order generalized Fibonacci cube of dimension h?
The question has been answered only for Fibonacci cubes in Vesel (2015) where a linear recognition algorithm for Q h (11) is presented.This result provides a linear recognition algorithm for a closely related class of Lucas cubes Taranenko (2013).
The main contribution of this paper is a linear-time algorithm which recognizes the 3rd order generalized Fibonacci cubes.The paper is organized as follows.In the next section we give basic definitions and concepts needed in this paper.In Section 3, a new characterization of the 3rd order generalized Fibonacci cubes is given.This characterization is the basis for the algorithm presented in the last section, which recognizes these graphs in linear time.

Preliminaries
The hypercube of order h, denoted by Q h , is the graph G = (V, E) where the vertex set V (G) is the set of all binary strings u = u 1 u 2 . . .u h , u i ∈ {0, 1}, and two vertices x, y ∈ V (G) are adjacent in Q h if and only if x and y differ in precisely one place.
Fibonacci numbers form a sequence of non-negative integers F n , where F 0 = 0, F 1 = 1 and for n ≥ 0 satisfy the recurrence The k-th order generalized Fibonacci numbers form a sequence of positive integers F k n , where We will use [n] for the set {1, 2, . . ., n} in this paper.The k-th order Fibonacci string of length h is a binary string In other words, the k-th order Fibonacci string is a binary string without k consecutive ones.
The 3rd order generalized Fibonacci cube Q h (111) is the subgraph of Q h induced by the 3rd order Fibonacci strings of length h.For convenience we also set Q 0 (111) = K 1 .The 3rd order generalized Fibonacci cubes Q h (111) are shown in Fig. 1 It is easy to see that the following lemma holds (see also Hsu and Chung (1993)).
Let G be a connected graph and e = xy, f = uv be two edges of G.We say that e is in relation Θ is reflexive and symmetric, but need not be transitive.We denote its transitive closure by Θ * .It was proved in Winkler (1984) that G is a partial cube if and only if G is bipartite and Θ * = Θ.The Θ-classes of a partial cube G constitute a partition of E(G) and will be denoted with 1, . . ., h in the sequel.
Any isometric embedding of G with idim(G) into Q h describes the same family of semicubes and pairs of complementary semicubes, which are indexed in a different way.For a partial cube G and a complementary pair of semicubes W (i,0) , W (i,1) , the set of edges with one end vertex in W (i,0) and the other in W (i,1) forms a Θ-class i of G.
For an edge ab of G we write: We will need the following well known lemma, cf.(Hammack et al., 2011, Proposition 11.7).
Lemma 2.3 Let e = ab be an edge of a connected bipartite graph G and For an edge ab of a partial cube with an isometric embedding α into Q h , let the vertices a and b differ in the coordinate i, i.e. α i (a) = 0 and α i (b) = 1.Then W ab = W (i,0) , W ba = W (i,1) and F ab = {xy | xy edge in E(G) such that α i (x) = 0, α i (y) = 1 and α j (x) = α j (y), for all j = i}.

Note that the vertices of
denote the subgraph of G induced by the set X. Let 0 h stand for the vertex with zero at all coordinates and 0 i−1 10 h−i for the vertex with one exactly at the i − th coordinate for i ∈ [h].We write xy for the concatenation of binary strings x and y.We will also denote by e i = 0 i−1 10 h−i the i-th unit string in {0, 1} h .
For binary strings u and v of equal length let u + v denote their sum computed bitwise modulo 2. In particular, u + e i is the string obtained from u by complementing its i-th bit.

Characterization
Let ab be an edge of a partial cube G for which Taranenko and Vesel (2007).Here we show that the same holds for the 3rd order generalized Fibonacci cubes.
Note that an edge e = uv belongs to a Θ-class i if and only if u and v differ exactly in the i-th coordinate.Suppose w.l.o.g. that u ∈ W (i,1) and v ∈ W (i,0) .Let x be a vertex of W (i,1) and let x be obtained from x by changing the i − th position of x to 0. Since it is straightforward to see that x is a vertex of W vu , it follows that xx ∈ F uv and W uv = W (i,1) = U uv .This assertion completes the proof. 2 Let f h , h ≥ 1, denote the number of the 3rd order Fibonacci strings of length h, i.e.
The following result shows the recursive structure of Q h (111) (see also Fig. 2). .
) and the assertion easily follows.The proof of (v) is analogous.
(ii) Since we can see from Table 2 , and x = 0 h−1 1.In particular, an analog to Lemma 3.3 is as follows: Proof: (i) Since v cannot have three consecutive ones and h ≥ 3, we have v i−1 = 0 or v i+2 = 0. Suppose w.l.o.g. that v i−1 = 0. Let u ∈ N (v).Note that v and u differ in precisely one coordinate.Since v i = v i+1 = 1 and v i−1 = 0, u and v cannot differ in the (i − 1)-st coordinate and the case is settled.The proof for (ii) is analogous.
by Lemma 3.6.It follows that there exist a vertex u adjacent to v such that either u i+1 = 1 or u i−1 = 1.But then we have either u i = u i+1 = 1 or u i−1 = u i = 1.From Lemma 3.6 it follows that u admits less then h neighbors and we obtain a contradiction.
(ii) Note that 10 h−1 and 0 h−1 1 have h − 2 neighbors of degree h in Q h (111).Assume to the contrary that Q h (111) admits a vertex v = 0 i 10 h−i−1 with exactly h − 2 neighbors of degree h such that 2 ≤ i ≤ h − 1.We can see from Lemma 3.6 that v + e i+1 and v + e i−1 are neighbors of v with a degree less then h.Moreover, since h ≥ 4, at least one of v + e i+2 and v + e i−2 exists in Q h (111).Since both have less then h neighbors in Q h (111) by Lemma 3.6, we again obtain a contradiction. 2 , denote a graph obtained from G by exchanging the i-th and the j-th coordinate in every vertex of V (G).Note that G i,j is an isometric subgraph of Q h isomorphic to G. From Fig. 1 we can see ] 2,3 are the 3rd order Fibonacci strings.
The next theorem gives a new characterization of Q h (111).
Theorem 3.9 Let ab be an edge of a connected, bipartite graph G such that a has h neighbors of degree h and b has h − 2 neighbors of degree h.
If h ≥ 10 or h ∈ {4, 5, 6, 7}, then G is isomorphic to Q h (111) if and only if the following conditions hold: and is adjacent to a vertex d ∈ W ab \ U ab . (iv (ii) Since a = 0 h and b = 10 h−1 , we have W ab = W (1,0) and W ba = W (1,1) .Thus, an edge of F ab has one end-vertex with zero at the first position and one end-vertex with one at the first position.Since all Θ-classes of Q h (111) are peripheral by Lemma 3.1, it follows that W ba = U ba .Let u, v ∈ W ba and u , v ∈ W ab such that uu , vv ∈ F ab .Since u and u (resp.v and v ) differ precisely in the first coordinate (iii) From (i) and Proposition 3.7 it follows that c = 010 h−2 or c = 00 h−2 1.Since b = 10 h−1 , Proposition 3.2(vii) yields W ab \ U ab = W (1,0) ∩ W (2,1) ∩ W (3,1) , hence c = 010 h−2 and d = 0110 h−3 .
(iv) Every u ∈ W ab \ U ab has the first four coordinates fixed such that u 4 = 0. Hence, one can construct all the 3rd order Fibonacci strings of length h − 4 at the coordinates 5, 6, . . .h and we have Since the proof for b = 0 h−1 1 is analogous (see also Remark 3.5), the first part of the proof is complete.
We can now apply β in order to construct an embedding α of vertices of G into Q h (111) as follows.For every vertex x ∈ W ab we set α 1 (x) := 0 and α i (x) := β i−1 (x), 2 ≤ i ≤ h.Note that for every vertex y ∈ W ba there exist a vertex x ∈ W ab such that xy ∈ F ab .Thus, we set α 1 (y) := 1 and α Obviously, for every vertex v of G we constructed the embedding α such that α 1 (v)α 2 (v) . . .α h (v) is a 3rd order Fibonacci string.In order to conclude the proof, we have to show that for every G we have uv 111), the claim is obvious for every u, v ∈ W ab .For u, v ∈ W ba note that since the matching F ab defines an isomorphism between G[W ba ] and G[U ab ], for every u, v ∈ W ba we have u , v ∈ U ab such that uu , vv ∈ F ab and Before GENERALIZED3 FIBONACCI is started, some preprocessing has to be done.A given graph G is examined only if |V (G)| = F 3 h+3 , for some h ≥ 1, otherwise the graph is rejected.Moreover, we have to establish whether G is bipartite.Note that this can be done in O(m) time.
The given bipartite graph G is then declared the 3rd order generalized Fibonacci cube if and only if GENERALIZED3 FIBONACCI(G,h) terminates without ever encountering a REJECT statement.In other words, GENERALIZED3 FIBONACCI for a graph G terminates with success if and only if either h ≥ 4 and the conditions of Theorem 3.9 and Proposition 3.10 are fulfilled for G or h ≤ 3 and G is isomorphic to one of {Q 1 , Q 2 , Q − 3 }.This gives us the following Theorem 4.1 GENERALIZED3 FIBONACCI correctly recognizes Q h (111).
In order to find the time complexity of the algorithm, we first show two lemmas.
We obtain above telescoping series in which all terms f i − The assertion now clearly follows. 2 Theorem 4.3 GENERALIZED3 FIBONACCI runs in linear time.
Proof: Let m denote the number of edges of G.
Concerning the time complexity, we will show that the time complexity of every step of the algorithm with the exception of Step 8.1 is bounded by O(m).Since for h ≤ 3 the graphs Q h = Q h (111) are very simple, this is obviously true for Step 1.For Steps 2 and 3 it is convenient to arrange the vector deg, such that deg v equals the number of vertices adjacent to v for every v ∈ V (G).We then first determine vertex a with h neighbors of degree h, by inspecting the adjacency list for every vertex of a graph.The total number of all examined entries in the adjacency list is clearly bounded by O(m).If a is found, then we check its neighbors in order to find the vertex b.Analogously, this can be done again in linear time and the proof for Steps 2 and 3 is settled.Concerning Steps 4, 5, and 7 it has been shown in Jha and Slutzki (1992) that they can be performed in time linear in the number of edges of the input graph.Since the proof for Step 6 is analogous to the proof for Steps 2 and 3, we may proceed with Step 8.It has also been shown in Jha and Slutzki (1992) that Step 8.2 can be performed in time linear in the number of edges of the input graph.If we mark every vertex of U ab ∪ U ba , W ab , W ca , and W dc , then Steps 8.3 and 8.4 can be implemented to run within the same time bound.Thus, neglecting the recursive call, the total time needed to check G is bounded by O(m), i.e. the cost per edge processed by a single call of the algorithm is O(1).
By Lemma 2.2 we have m = Θ(n log n).If follows that we can find a constant C such the the total time needed to check G, neglecting the recursive call, is bounded by C hf h .
Let m h denote the total number of edges checked by the algorithm.
From the above discussion we have while Lemma 4.2 yields We showed that the total number of edges processed by GENERALIZED3 FIBONACCI(G, h) cannot exceed 5 2 |E(G)|.Moreover, since we showed that the cost per edge processed by a single call of the the algorithm is O(1), the proof is complete. 2