Efﬁcient Algorithm for Generating Maximal L-Reﬂexive Trees †

: The line graph of a graph G is another graph of which the vertex set corresponds to the edge set of G , and two vertices of the line graph of G are adjacent if the corresponding edges in G share a common vertex. A graph is reﬂexive if the second-largest eigenvalue of its adjacency matrix is no greater than 2. Reﬂexive graphs give combinatorial ground to generate two classes of algebraic numbers, Salem and Pisot numbers. The difﬁcult question of identifying those graphs whose line graphs are reﬂexive (called L-reﬂexive graphs) is naturally attacked by ﬁrst answering this question for trees. Even then, however, an elegant full characterization of reﬂexive line graphs of trees has proved to be quite formidable. In this paper, we present an efﬁcient algorithm for the exhaustive generation of maximal L-reﬂexive trees.


Introduction
Throughout this paper, we consider connected simple graphs, i.e., connected undirected graphs without loops or multiple edges. Let G be a simple graph, and A be the adjacency matrix of G. Zeroes of polynomial det(xI − A) are called the eigenvalues of G and comprise the spectrum of G. Since A is symmetric, the spectrum of G consists of only real numbers (not necessarily distinct).
The line graph of G, denoted by L(G), is a graph whose vertex set corresponds to the edge set of G, and two vertices of L(G) are adjacent if the corresponding edges in G share a common vertex (see [1][2][3] for more details). The subdivision graph of G, denoted by S(G), is a graph obtained from G by inserting a vertex of degree two into each edge of G.
A graph G is reflexive if its second-largest eigenvalue is not greater than 2. Since graph reflexivity is a hereditary property, research on reflexive graphs is usually centered on maximal reflexive graphs, i.e., those graphs that cannot be extended within the observed class (by adding vertices and/or edges) without violating reflexivity.
A graph G is called L-reflexive if its line graph L(G) is reflexive. Similarly, a graph G is called S-reflexive if its subdivision graph S(G) is reflexive. These two notions are actually equivalent, as shown in ( [4], Theorem 3).
Graph reflexivity has been investigated for various classes of graphs [5], such as trees [6,7], unicyclic graphs [8], bicyclic graphs [9], and cactuses [4,10]. Reflexive graphs are also related to two classes of algebraic numbers, Salem and Pisot numbers. In [11], a class of reflexive graphs (called Salem graphs) are associated with Salem numbers (called graph Salem numbers) whose limiting points are Pisot numbers. In the same paper, all reflexive trees that defined Salem numbers were described as well. In [12], a procedure for finding Pisot numbers as limiting points of graph Salem numbers was given.
Describing L-reflexive graphs, i.e., graphs whose line graphs are reflexive, is a difficult problem. The first, natural approach in solving this problem is to consider its restricted version for trees. Even then, however, an elegant full characterization of reflexive line graphs of trees has proven to be quite formidable. More light on the structural composition of such trees was shed in [4,12], and we used these results as the basis for our considerations.
In this paper, we focus on an algorithm for generating all L-reflexive trees that are maximal in the sense that adding one edge to a pendant vertex of such an L-reflexive tree violates its reflexivity. In Section 2, we define the problem that we considered, and provide some background results that were needed in Section 3, where we describe an efficient algorithm for generating all maximal L-reflexive trees. In Section 4, we present some computational experiments to test our algorithm, and in Section 5, we close with some concluding remarks.

Preliminaries
In this section, we clearly define the problem with which we are dealing and provide some background results from [4,12] used in the paper.
In ([12], Theorem 2.4), it was shown that the structure of an L-reflexive tree has the general form given in Figure 1 apart from a few sporadic cases. A nonsporadic L-reflexive tree contains a central vertex v with different branches emanating from it whose shape is illustrated in Figure 1. All m i s and p, q values in the figure refer to the number of edges, whereas k, l, and t values refer to the number of corresponding branches. Some of the t-branches can also be unbounded, so their length is infinite.
The following criterion from ( [12], Theorem 3.1) determines whether a tree in Figure 1 is L-reflexive.

Theorem 1.
Let T be a tree as in Figure 1. For some s and j = 0, 1, . . . , s, denote by t j the number of m i s equal to j + 1, and by t s+1 denote the number of infinite m i s (i.e, the number of unbounded t-branches). Then, T is L-reflexive if and only if where 1 ≤ p ≤ q and p + q ≥ 4.
It is also argued in [12] that we can simplify the left-hand side of Inequality (1) by taking k = 0 and l = 0, so Inequality (1) is reduced to Furthermore, from the discussion on the values of p and q in [12], it basically follows that the right-hand side of Inequality (2) can be taken to have discrete values, such as 6, 3, 2 2 5 , 2 1 7 , 2, . . .. Thus, for one of these (fixed) discrete values of the right-hand side of Inequality (2), without losing too much generality, we can regard L-reflexive trees as trees having the canonical structure given in Figure 2. To summarize, if and R = 6, 3, 2 2 5 , 2 1 7 , 2, . . ., then a canonical tree from Figure 2 is L-reflexive if and only if L ≤ R for some s ≥ 0, and some sequence t 0 , . . . , t s , t s+1 with each t i ≥ 0, where i = 0, . . . , s, s + 1. Such an L-reflexive tree T is also maximal if adding one edge to any finite branch of the tree T makes its corresponding new sum L strictly greater than R.
The problem we are, therefore, interested in is: Given a fixed value R = 6, 3, 2 2 5 , 2 1 7 , 2, . . ., generate all maximal L-reflexive trees with the canonical structure shown in Figure 2 (the number of such trees is finite, as shown in [4]). Now, for j = 1, . . . , s, s + 1, consider number of nodes k j at level j of the canonical tree from Figure 2. This is illustrated in Figure 3.
It is easy to see from Figure 3 that The next lemma shows that sum L for a canonical tree from Figure 2 can be computed in a different way using k j s instead of t i s as coefficients.
Coefficients t i s can easily be recovered from coefficients k j s, as the next lemma shows.

Algorithm
The basic idea of the algorithm for discovering a maximal L-reflexive tree (mlrt) having the structure given in Figure 2 is to use Lemma 1 to incrementally compute its corresponding sum L until it exceeds value R. Assuming for the moment that a maximal L-reflexive tree is finite, starting from k 1 nodes, 1 ≤ k 1 ≤ d, at level 1, and going up level by level, at next level j we add k j ≤ k j−1 nodes (and edges) so that their total contribution, i.e., k j /((2j + 1)(2j − 1)), to already computed sum L does not exceed R. Clearly, if adding even one node at some level j makes already computed sum L greater than value R, then the tree encoded by sequence k 1 , . . . , k j−1 is maximally L-reflexive.
The search space for all (finite and infinite) maximal L-reflexive trees is the set of all canonical trees from Figure 2. To facilitate systematic and efficient search, we modelled this space as an infinite tree with nodes representing subsets of all canonical trees from Figure 2. More precisely, the root of the search-space tree represents the set of all canonical trees from Figure 2, i.e., the set of such trees that have k 1 nodes on level 1, denote it by T 1,k 1 . Set T 1,k 1 can be partitioned into mutually disjoint subsets T 2,k 1 ,k 1 , T 2,k 1 ,k 1 −1 ,. . . ,T 2,k 1 ,1 of canonical trees having k 1 , k 1 − 1, . . . , 1, respectively, nodes on level 2. Similarly, each set of trees T 2,k 1 ,m on level 2, where m = k 1 , k 1 − 1, . . . , 1, can be further divided into mutually disjoint subsets T 3,k 1 ,m,m , T 3,k 1 ,m,m−1 , . . . , T 3,k 1 ,m,1 of canonical trees having m, m − 1, . . . , 1, respectively, nodes on level 3. Continuing this procedure in the same fashion, we can thus represent the search space for all maximal L-reflexive trees from Figure 2 as a tree shown in Figure 4.      Figure 4 shows that set T j,k 1 ,k 2 ,k 3 ,...,k j , where k 1 ≥ k 2 ≥ k 3 ≥ · · · ≥ k j ≥ 1, is represented by the subtree whose root is node T j,k 1 ,k 2 ,k 3 ,...,k j at level j on the path that starts from node T 1,k 1 on level 1. This path goes next to node T 2,k 1 ,k 2 on level 2, then to node T 3,k 1 ,k 2 ,k 3 on level 3, and so on. The path in this way ends with node T j,k 1 ,k 2 ,k 3 ,...,k j on level j. We also slightly abused our notation by using T j,k 1 ,k 2 ,k 3 ,...,k j to denote both a set of trees and a node in Figure 4 representing that set.
To each node T j,k 1 ,k 2 ,...,k j in Figure 4, we assigned a value S(T j,k 1 ,k 2 ,...,k j ) = k j and called it the node's size, because T j,k 1 ,k 2 ,...,k j represents canonical trees that have k j nodes on level j. Different sizes of nodes are indicated in Figure 4 by the scaled diameters of the corresponding circles.
The following lemma is an immediate consequence of the construction of the search-space tree. Figure 2 and let T ∈ T l,k 1 ,k 2 ,...,k l and T ∈ T j,k 1 ,k 2 ,...,k j . Then

Lemma 3. Let T and T be two canonical trees from
T is a subtree of T if and only if l ≤ j and k i ≤ k i for each i = 2, . . . , l.
We also assigned another value to each node T j,k 1 ,k 2 ,...,k j in Figure 4, called the node's load, representing partial sum L accumulated when we follow the path going from the root to that node. In other words, node load L = L(·) is computed recursively as We can now establish criteria for detecting whether a node of the search-space tree from Figure 4 represents a finite or infinite maximal L-reflexive tree. The first criterion for a finite maximal L-reflexive tree is obvious and stated here without proof.

Lemma 4.
A node T j,k 1 ,k 2 ,...,k j in Figure 4 represents a finite maximal L-reflexive tree encoded by sequence k 1 , k 2 , . . . , k j if and only if its load L is not greater than R, and the load of all of its children is (strictly) greater than R.
On the other hand, whether a node of the tree from Figure 4 represents an infinite maximal L-reflexive tree can be determined using the following lemma.
Lemma 5. Node T j,k 1 ,k 2 ,...,k j in Figure 4 represents an infinite L-reflexive tree encoded by sequence k 1 , k 2 , . . . , k j if and only if its load L satisfies inequality Proof. Node T j,k 1 ,k 2 ,...,k j on level j in Figure 4 represents an infinite L-reflexive tree if and only if for every This inequality can be rewritten as Letting n → ∞ in the last inequality we get which is desired Inequality (3).
We can use Lemma 5 to discover an infinite maximal L-reflexive tree if Inequality (3) is satisfied for the corresponding node in Figure 4 on the lowest level.
To now find all maximal L-reflexive trees, we can apply depth-first search to explore the search-space tree from Figure 4, computing the load of visited nodes along the way, and using Lemmas 4 and 5 to end a path from the root. However, we can actually do better by applying a kind of branch-and-bound technique to considerably cut the search space.
Namely, we first need to explore all children of a given node, but only those (if any) whose load does not exceed R. Clearly, the subtrees rooted at the children whose load already exceed R cannot possibly even contain L-reflexive trees, let alone maximal. The children whose load does not exceed R must be explored because the subtrees rooted in them each contain at least one maximal L-reflexive tree.
The second observation encompassed in the following lemma relates to nodes representing infinite maximal L-reflexive trees. Namely, Lemma 6 allows us to further cut the search space because, once a node representing an infinite maximal L-reflexive tree is found during depth-first search, all children nodes of its ancestors from the lemma can be ignored since they represent subtrees of the first-time-found infinite maximal L-reflexive tree. Lemma 6. Let node T j,k 1 ,k 2 ,...,k j in Figure 4 represent an infinite maximal L-reflexive tree, and for l = 1, . . . , j − 1 consider any ancestor T l,k 1 ,k 2 ,...,k l of that node. Then, all children T l+1,k 1 ,k 2 ,...,k l ,k l , T l+1,k 1 ,k 2 ,...,k l ,k l −1 , . . . , T l+1,k 1 ,k 2 ,...,k l ,1 of ancestor T l,k 1 ,k 2 ,...,k l also represent infinite L-reflexive trees.
Previous considerations are incorporated into recursive algorithm mlrt given in Figure 5. Therefore, the following theorem is straightforward.

Experiments
We tested our algorithm for the "hardest" cases of the right-hand side of Inequality (2), i.e., the five different values of R = 6, 3, 2 2 5 , 2 1 7 , 2. For each value of R, we also used corresponding meaningful values for maximal degree d of central vertex v of a maximal L-reflexive tree from Figure 2. Results are shown in Table 1, where N fin and N inf denote the number of finite and infinite maximal L-reflexive trees, respectively. Not all rows in the table give exact values for N fin and N inf , only their lower bounds, because the algorithm did not terminate in a reasonable amount of time due to a huge number of maximal L-reflexive trees.

Conclusions
In the paper, we considered L-reflexive trees that are those trees for which the second-largest eigenvalue of their line graph is at most 2. Previous work [4,12] showed that, apart from some sporadic examples, any L-reflexive tree is a subtree of a universal tree T(k, l, t, m 1 , . . . , m t ; p, q) from Figure 1. The work in [4,12] also gave a criterion in the form of an inequality involving k, l, t, m i 's,p, q that precisely determines when these parameters yield an L-reflexive tree.
This paper used this inequality to devise an efficient recursive algorithm that searches for parameters that make the inequality true. In particular, the aim was to find maximal examples. The search has a natural rooted-tree structure, and some paths from the root may infinitely extend. These infinite trees can be neatly identified, in theory giving a finite search space.