A new characterization and a recognition algorithm of Lucas cubes

. Fibonacci and Lucas cubes are induced subgraphs of hypercubes obtained by excluding certain binary strings from the vertex set. They appear as models for interconnection networks, as well as in chemistry. We derive a characterization of Lucas cubes that is based on a peripheral expansion of a unique convex subgraph of an appropriate Fibonacci cube. This serves as the foundation for a recognition algorithm of Lucas cubes that runs in linear time


Introduction
Graphs based on binary strings are used as models for interconnection networks.Hypercube, being a popular interconnection scheme for multicomputers, has often been replaced by other models with similar properties comparable to those of hypercubes, where the number of vertices and edges in these alternative models does not increase as rapidly.
A Fibonacci string of length n is a binary string b 0 b 1 . . .b n−1 such that b i •b i+1 = 0, for i = 0, 1, . . .n− 2. Equivalently, it is a binary string of length n without two consecutive ones.
The Fibonacci cube Γ n of order n has the Fibonacci strings as vertices, with two vertices being adjacent whenever they differ in exactly one coordinate.We also set Γ 0 = K 1 .See Fig. 1 for Fibonacci cubes of order n, for n = 0, 1, . . ., 5, with appropriate Fibonacci strings assigned to the vertices (these are omitted for Γ 5 for the clarity of the figure).The Lucas cube Λ n of order n is the graph with Lucas strings as vertices, again, with two vertices being adjacent whenever they differ in exactly one coordinate.We set Λ 0 = K 1 .See Fig. 2 for Lucas cubes of order n, for n = 0, 1, . . ., 5, with appropriate Lucas strings assigned to the vertices (again, these are omitted for Λ 5 for the clarity of the figure).Note, that vertices of Λ n can be obtained from the vertices of Fibonacci cubes Γ n−1 and Γ n−3 as follows: V (Λ n ) = 0V (Γ n−1 ) ∪ 10V (Γ n−3 )0 (Munarini et al., 2001).
It is known that Fibonacci cubes and Lucas cubes are median graphs (Klavžar, 2005).For median graphs several efficient recognition algorithms are known.To mention the first polynomial algorithm with complexity O(nm) presented in Jha and Slutzki (1992) and the much more advanced O((m log n) 1.41 ) algorithm stated in Hammack et al. (2011).This raises the natural question whether a faster recognition algorithm for special families of median graphs exists.For Fibonacci cubes this question was partially answered by presenting a recognition algorithm with the complexity O(m log n) (Taranenko and Vesel, 2007).Even more, Vesel (2013) recently answered the problem of existence of a linear recognition algorithm for Fibonacci cubes, presented in Klavžar (2013).For Lucas cubes no recognition algorithm exists to our knowledge and is presented in this paper.
The paper is structured as follows.The next section contains some basic definitions and results concerning median graphs and Lucas cubes.In Section 3 several structural properties and a characterization of Lucas cubes are given.Using these results in the final Section 4 a recognition algorithm for Lucas cubes is presented.The presented algorithm correctly recognizes a Lucas cube in linear time.

Preliminaries
The hypercube Q n of order n is the graph with the vertex set containing all binary strings of length n, where two vertices are adjacent whenever the two strings differ in exactly one position.Isometric graphs of hypercubes are called partial cubes.
The Fibonacci numbers form a sequence of positive integers F n , where F 0 = 0, F 1 = 1 and for n ≥ 2 satisfy the recurrence Since a Lucas string is a binary string without two consecutive ones and without one both in the first and last position, we can say that a Lucas string contains no two consecutive ones in a circular manner.Moreover, in the rest of the paper, when dealing with Lucas strings, we will always compute indices modulo n, even when not explicitly stated.
For a triple of vertices u, v and w of a given graph G, a vertex x of G is a median of u, v and w if x lies simultaneously on shortest paths joining u and v, u and w, and v and w, respectively.If G is connected and every triple of vertices admits a unique median, then G is a median graph.It is well known that median graphs are partial cubes (cf.(Hammack et al., 2011)).
Let G be a connected graph with e = xy and f = uv two edges in 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 Θ = Θ * . For Let H be a fixed subgraph of a graph G, H ⊆ G.The peripheral expansion pe(G; H) of G with respect to H is the graph obtained from the disjoint union of G and an isomorphic copy of H, in which every vertex of the copy of H is joined by an edge with the corresponding vertex of H.
For an edge ab of graph G we define: Let ab be an edge of a median graph G for which We will need the following well known lemma, cf.(Hammack et al., 2011).
Lemma 2.1 Let e = ab be an edge of a connected bipartite graph G.
(ii) G\F ab has exactly two components.
The next theorem characterizes median graphs.
Theorem 2.2 (Mulder, 1978) Let ab be an edge of a connected, bipartite graph G. Then G is a median graph if and only if the following three conditions are satisfied:

Characterization
Before we present the theorem that characterizes Lucas cubes, we will state some properties concerning this family of graphs.
Let 0 p denote a binary string of length p ≥ 0 with all bits equal to zero, similarly 1 p is a binary string of length p with all bits equal to 1. Let x and y be two arbitrary binary strings, we write xy for the concatenation of x and y.
Obviously the vertex 0 n , has exactly n neighbours in Λ n , moreover it is the only vertex of degree n in Λ n (Klavžar et al., 2011).Proposition 3.2 All neighbours of the vertex 0 n in the Lucas cube Λ n of order n ≥ 3 are of degree n − 2.
Proof: Let v = 0 n .All the neighbours of v are binary strings with exactly one 1.Consider such a vertex u with one 1, say at p th position, 0 ≤ p ≤ n − 1.Since the bits at positions p − 1 and p + 1 must be 0, there are n − 3 vertices with exactly two bits equal to 1, that are adjacent to u.The vertex v is also adjacent to u, therefore u is of degree n − 2. Since u was arbitrarily chosen, this concludes the proof.✷ While it is known (Munarini et al., 2001) that a Lucas cubes of order n is composed from two Fibonacci cubes of order n − 1 and n − 3 with some additional edges between the two, the next proposition characterizes, how these two Fibonacci cubes are induced.
Then the following hold: From Theorem 2.2 and Propositions 3.3 and 3.4 we immediately obtain the following corollary.
Let H be a subgraph of a graph G. Then ∂H is the set of all edges xy of G with x ∈ H and y / ∈ H.
Theorem 3.6 There exist exactly one convex subgraph H ⊆ Γ n isomorphic to Γ n−2 , such that the peripheral expansion pe(Γ n ; H) is isomorphic to the Lucas cube Λ n+1 .
Proof: Let H be a convex subgraph of Γ n such that pe(Γ n ; H) is isomorphic to Λ n+1 (assuming such H exists).Note that the peripheral expansion increases the degree of each vertex in the chosen subgraph H by 1 in the graph obtained by the peripheral expansion.Since Λ n+1 contains exactly one vertex of degree n+1, the vertex 0 n ∈ V (Γ n ) must be in H.Moreover, the vertices which are both of degree n − 1 cannot be in H, since by Proposition 3.2 all the neighbouring vertices of a = 0 n+1 ∈ V (Λ n+1 ) are of degree n − 1, these two would be of degree n in the graph pe(Γ n ; H), they would of course both be adjacent to a in this graph.
Let b = 10 n−1 ∈ V (Γ n ).Suppose a vertex x ∈ W ba is in V (H).Since H is connected and we have established that a ∈ V (H), there exists a shortest path from x to a, which is completely in H (since H is convex).But a ∈ W ab , therefore any shortest path from a to x must contain an edge uv from F ab (due to Lemma 2.1).By the Convexity lemma (Imrich and Klavžar, 1998), H is convex if and only if no edge of ∂H is in relation Θ to any edge in H.The edge ab ∈ ∂H, moreover ab ∈ F ab and is therefore in relation Θ with uv ∈ E(H), which is a contradiction.So none of the vertices in W ba are in H.
By the same reasoning, with c = 0 n−1 1 ∈ V (Γ n ), none of the vertices from W ca are in H.
Recall, that W ba (W ca ) contains all the vertices with 1 in the first and the last position, respectively.Consider the set S := V (Γ n )\(W ba ∪ W ca ) = W ab ∩ W ac .Since the graphs induced by W ab and W ac are convex in Γ n , the intersection (the graph induced by S) is also convex in Γ n .Then every vertex s ∈ S is of the form 0b 1 b 2 . . .b n−2 0, moreover it clearly contains all such vertices where b 1 b 2 . . .b n−2 is a Fibonacci string.Since two vertices are adjacent if they differ in exactly one position it follows that S induces a Fibonacci cube of order n − 2. Set H := Γ n [S], which is clearly the unique subgraph induced on vertices of S isomorphic to Γ n−2 , so H exists.
It remains to prove, that pe(Γ n ; H) is isomorphic to Λ n+1 .As seen, the vertices of H are all of the form 0b 1 b 2 . . .b n−2 0. Let all the vertices in the isomorphic copy of H (introduced by the peripheral expansion) have the same assigned Fibonacci string as the corresponding vertices in H. Add a 0 to the beginning all vertices of Γ n , and a 1 to the beginning of all vertices in the isometric copy.In this way we obtain all Lucas strings of length n + 1.From the construction of the strings it is clear that two strings are connected in pe(Γ n ; H) if and only if they differ in exactly one position.✷ The next theorem characterizes Lucas cubes.
Theorem 3.7 Let G be a connected bipartite graph, a ∈ V (G) of degree n and ab ∈ E(G).G is isomorphic to Λ n if and only if the following conditions are upheld: (1) All the neighbours of a are of degree n − 2. ( (3) F ab defines an isomorphism between G[U ab ] and (5) W ba = U ba .
Proof: Suppose G is isomorphic to Λ n .Condition (1) is true by Proposition 3.2.Since Λ n is a median graph (Klavžar, 2005), by Theorem 2.2 conditions (2) and ( 3) are also true.Proposition 3.3 settles the condition (4).From Proposition 3.4 and its proof the final condition is also satisfied.For the reverse, suppose for a graph G all conditions are met.Let a ∈ V (G) be the vertex of degree n, and b ∈ V (G) be an arbitrary neighbour of a (which by assumption is of degree n − 2).Clearly, if no such a exists or if there exists a neighbour b of a, such that the degree of b differs from n − 2, G is not isomorphic to a Lucas cube of order n, therefore these conditions are necessary.Assign Fibonacci strings of length n − 1 to all vertices of G[W ab ], we will refer to them as labels.From the convexity of G[U ab ] in G[W ab ] and the proof of Theorem 3.6 we can choose the labelling such that the vertices in G[U ab ] are of the form 0b 1 b 2 . . .b n−2 0. The set F ab defines an isomorphism between G[U ab ] and G[U ba ], so assign to the vertices in G[U ba ] the same Fibonacci string as their corresponding vertex in G[U ab ].Now, add a 0 and 1 at the left hand side to all labels in G[W ab ] and G[W ba ], respectively.Since U ba = W ba , all the vertices have been assigned a (different) label.Moreover, the construction of the labels implies, that they are all Lucas strings of length n.What is left to prove is that two vertices are adjacent whenever the assigned labels differ in exactly one position.This clearly holds for all pairs of vertices, when both are either in W ab or W ba .Suppose, x ∈ U ab and y ∈ U ba .Then xy ∈ E(G) whenever xy ∈ F ab , it follows that the corresponding labels differ in exactly one position.By Lemma 2.1 the sets W ab and W ba are disjoint, therefore two vertices x ∈ W ab \U ab and y ∈ U ba are not adjacent in G.By construction, the labels of x and y differ in more than one position.It follows that G is isomorphic to Λ n .This concludes our proof.✷ Note that condition (1) of Theorem 3.7 is necessary, since b has been arbitrarily chosen.There exists a graph G = pe(Γ n ; H) such that H is a convex subgraph of Γ n isomorphic to Γ n−2 where G is not isomorphic to Λ n+1 .See Fig. 3 for an example.

H Γ 4
Fig. 3: A peripheral expansion pe(Γ4; H) where H is a convex subgraph isomorphic to Γ2 4 Recognition algorithm Theorem 3.7 is also good from algorithmic point of view since it serves as the basis for the algorithm presented with procedure LUCAS for recognition of Lucas cubes.Procedure Fibonacci(G, n, uv) used in procedure LUCAS is from Vesel (2013) and returns ACCEPT if a given graph G is isomorphic to a Fibonacci cube of order n, and REJECT otherwise.The input parameter uv represents an edge of the input graph G with one end-vertex of degree n.Moreover, it runs in O(|E(Γ n )|) time.
Before calling procedure LUCAS some preprocessing of the input graph is required.It is well known for some h ≥ 1 and it is bipartite, otherwise graph is rejected.The computed value of h is also an input parameter of procedure LUCAS.The input graph fulfilling these conditions is declared isomorphic to a Lucas cube of order h if procedure LUCAS terminates without encountering REJECT statement.
In the presented procedure we denote by N S (v) the set of all neighbours of a vertex v, where neighbours are from the set S .

Procedure LUCAS(G, h)
Result: Proof: The steps from preprocessing can clearly be done in linear time.Note, that Steps 2-4 of procedure LUCAS can be computed in O(m) time.It has been show in Jha and Slutzki (1992) that Steps 5-7 can be performed in time linear in the number of edges of the input graph.Moreover, Step 8 can be easily executed in linear time in the number of elements of the sets.Steps 9 and 10 can be done in constant time.So the complexity of the recognition algorithm depends on the complexity of the procedure Fibonacci(G,h,uv), which runs in linear time in the number of edges of the input graph (Vesel, 2013).So the time complexity of the procedure LUCAS is linear in the number of edges, ie.O(|E(Λ h )|). ✷

Fig. 1 :
Fig. 1: Fibonacci cubes Γn, for n = 0, 1, . . ., 5.A Lucas string of length n is a binary string b 0 b 1 . . .b n−1 such that b i • b i+1 = 0, for i = 0, 1, . . ., n − 1, where indices are computed modulo n.In other words, Lucas string is a binary string without two consecutive ones and without one both in the first and last position.TheLucas cube Λ n of order n is the graph with Lucas strings as vertices, again, with two vertices being adjacent whenever they differ in exactly one coordinate.We set Λ 0 = K 1 .See Fig.2for Lucas cubes of order n, for n = 0, 1, . . ., 5, with appropriate Lucas strings assigned to the vertices (again, these are omitted for Λ 5 for the clarity of the figure).Note, that vertices of Λ n can be obtained from the vertices of Fibonacci cubes Γ n−1 and Γ n−3 as follows: V (Λ n ) = 0V (Γ n−1 ) ∪ 10V (Γ n−3 )0(Munarini et al., 2001).It is known that Fibonacci cubes and Lucas cubes are median graphs(Klavžar, 2005).For median graphs several efficient recognition algorithms are known.To mention the first polynomial algorithm with complexity O(nm) presented inJha and Slutzki (1992) and the much more advanced O((m log n) 1.41 ) algorithm stated inHammack et al. (2011).This raises the natural question whether a faster recognition algorithm for special families of median graphs exists.For Fibonacci cubes this question was partially answered by presenting a recognition algorithm with the complexity O(m log n)(Taranenko and Vesel, 2007).Even more,Vesel (2013) recently answered the problem of existence of a linear recognition algorithm for Fibonacci cubes, presented inKlavžar (2013).For Lucas cubes no recognition algorithm exists to our knowledge and is presented in this paper.The paper is structured as follows.The next section contains some basic definitions and results concerning median graphs and Lucas cubes.In Section 3 several structural properties and a characterization of Lucas cubes are given.Using these results in the final Section 4 a recognition algorithm for Lucas cubes is presented.The presented algorithm correctly recognizes a Lucas cube in linear time.
where x has 0 at p th position} and W ba = {x ∈ V (Λ n ) | where x has 1 at p th position}.(i) Consider a vertex x ∈ W ab .We know that the vertex x is of the form b 0 . . .b p−1 0b p+1 . . .b n−1 , which is a Lucas string.Then the binary string of length n − 1 defined as b p+1 . . .b n−1 b 0 . . .b p−1 is clearly a Fibonacci string, since binary strings b 0 . . .b p−1 and b p+1 . . .b n−1 contain no two consecutive 1s, and b 0 and b n−1 cannot both be 1, since they are at the first and the last position of a Lucas string.The set W ab contains all Lucas string of the described form, therefore we obtain all Fibonacci strings of length n − 1 in this manner.Since two vertices of W ab are connected if they differ in exactly one position, and the bit at position p, in the original Lucas string, we removed with this construction was equal to 0 in all strings, W ab induces a Fibonacci cube of order n − 1 in Λ n and the assertion follows.(ii) Consider a vertex x ∈ W ba .We know that the vertex x is of the form b 0 . . .b p−1 1b p+1 . . .b n−1 , which is a Lucas string.Moreover, b p−1 = b p+1 = 0. Again, we construct a binary string of the form b p+2 . . .b n−1 b 0 . . .b p−2 , which is of length n − 3. The rest follows the same line of thought as in (i), therefore the assertion follows.✷ Proposition 3.4 Let E be a Θ-class of the Lucas cube Λ n .Then E is peripheral.Proof: Let a = 0 n be the unique vertex of degree n in Λ n .All the edges with one end-vertex equal to a belong to different Θ classes.Since there are n such edges and Λ n contains n different Θ-classes, we can arbitrarily choose one such edge.Let b be a vertex with exactly one 1 at p th position, 0 ≤ p ≤ n − 1.Let e = ab ∈ E(Λ n ) and E = {f ∈ E(Λ n ) | eΘf }.We claim that E is peripheral with W ba = U ba .By Proposition 3.3 the graph Λ n [W ba ] is isomorphic to Γ n−3 .A vertex x ∈ W ba is adjacent (among others) to the vertex y which differs from x in exactly position p.Since W ba contains all and only vertices with 1 at position p, all vertices in W ba are adjacent to a vertex in W ab .It follows by definition of U ba that U ba = W ba and therefore E is peripheral.✷ return ACCEPT 2 Find e = uv ∈ E(G) such that d(u) = h and d(v) = h − 2 Compute sets W uv , W vu , U uv , U vu and F uv 5 if F uv is not a matching defining an isomorphism between G[U uv ] and G[U vu ] then Since procedure LUCAS returns ACCEPT if and only if the conditions from Theorem 3.7 are satisfied, the following theorem follows immediately.Theorem 4.1 Procedure LUCAS correctly recognizes a Lucas cube.Theorem 4.2 Procedure LUCAS runs in O(|m|) time to successfully recognize a Lucas cube Λ h .
3 if e does not exist then return REJECT4 uv ] is not convex in G[W uv ] then return REJECT 9 if U vu = W vu then return REJECT 10 u ′ ∈ N Wuv (u) 11 v ′ ∈ N Wvu (v) 12 if Fibonacci(G[W uv ], h − 1, uu ′ ) returns REJECT then return REJECT 13 if Fibonacci(G[W vu ], h − 3, vv ′ ) returns REJECT then return REJECT