Abstract
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 reflexive if the second-largest eigenvalue of its adjacency matrix is no greater than 2. Reflexive graphs give combinatorial ground to generate two classes of algebraic numbers, Salem and Pisot numbers. The difficult question of identifying those graphs whose line graphs are reflexive (called L-reflexive graphs) is naturally attacked by first answering this question for trees. Even then, however, an elegant full characterization of reflexive line graphs of trees has proved to be quite formidable. In this paper, we present an efficient algorithm for the exhaustive generation of maximal L-reflexive trees.
MSC:
15A18; 05C50
1. 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 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 , is a graph whose vertex set corresponds to the edge set of G, and two vertices of are adjacent if the corresponding edges in G share a common vertex (see [,,] for more details). The subdivision graph of G, denoted by , 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 is reflexive. Similarly, a graph G is called S-reflexive if its subdivision graph is reflexive. These two notions are actually equivalent, as shown in ([], Theorem 3).
Graph reflexivity has been investigated for various classes of graphs [], such as trees [,], unicyclic graphs [], bicyclic graphs [], and cactuses [,]. Reflexive graphs are also related to two classes of algebraic numbers, Salem and Pisot numbers. In [], 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 [], 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 [,], 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.
2. Preliminaries
In this section, we clearly define the problem with which we are dealing and provide some background results from [,] used in the paper.
In ([], 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.

Figure 1.
Structure of L-reflexive trees.
A nonsporadic L-reflexive tree contains a central vertex v with different branches emanating from it whose shape is illustrated in Figure 1. All 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 ([], 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 , denote by the number of s equal to , and by denote the number of infinite s (i.e, the number of unbounded t-branches). Then, T is L-reflexive if and only if
where and .
It is also argued in [] that we can simplify the left-hand side of Inequality (1) by taking and , so Inequality (1) is reduced to
Furthermore, from the discussion on the values of p and q in [], it basically follows that the right-hand side of Inequality (2) can be taken to have discrete values, such as . 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.

Figure 2.
Canonical structure of L-reflexive trees.
To summarize, if
and , then a canonical tree from Figure 2 is L-reflexive if and only if for some , and some sequence with each , where . 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 , generate all maximal L-reflexive trees with the canonical structure shown in Figure 2 (the number of such trees is finite, as shown in []).
Now, for , consider number of nodes at level j of the canonical tree from Figure 2. This is illustrated in Figure 3.

Figure 3.
Levelled canonical structure of L-reflexive trees.
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 s instead of s as coefficients.
Lemma 1.
Let
for some and some sequence with each , . If and
then
Proof.
Since
telescoping gives
as claimed. □
Coefficients s can easily be recovered from coefficients s, as the next lemma shows.
Lemma 2.
Let
for some and some sequence such that . If and for , then
Proof.
Similar telescoping technique. □
3. 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 nodes, , at level 1, and going up level by level, at next level j we add nodes (and edges) so that their total contribution, i.e., , 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 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 nodes on level 1, denote it by . Set can be partitioned into mutually disjoint subsets , ,…, of canonical trees having , , …, 1, respectively, nodes on level 2. Similarly, each set of trees on level 2, where , can be further divided into mutually disjoint subsets , , …, of canonical trees having m, , …, 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.
Search-space tree for maximal L-reflexive trees.
Figure 4 shows that set , where , is represented by the subtree whose root is node at level j on the path that starts from node on level 1. This path goes next to node on level 2, then to node on level 3, and so on. The path in this way ends with node on level j. We also slightly abused our notation by using to denote both a set of trees and a node in Figure 4 representing that set.
To each node in Figure 4, we assigned a value and called it the node’s size, because represents canonical trees that have 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.
Lemma 3.
Let and be two canonical trees from Figure 2 and let and . Then is a subtree of if and only if and for each .
We also assigned another value to each node 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 is computed recursively as
for and .
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 in Figure 4 represents a finite maximal L-reflexive tree encoded by sequence 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 in Figure 4 represents an infinite L-reflexive tree encoded by sequence if and only if its load L satisfies inequality
Proof.
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 in Figure 4 represent an infinite maximal L-reflexive tree, and for consider any ancestor of that node. Then, all children , , …, of ancestor also represent infinite L-reflexive trees.
Proof.
By Lemma 3, children , , …, of ancestor are subtrees of . □
Previous considerations are incorporated into recursive algorithm mlrt given in Figure 5. Therefore, the following theorem is straightforward.

Figure 5.
Maximal L-reflexive tree (mlrt) algorithm.
Theorem 2.
An initial call mlrtfor fixed and correctly generates all maximal L-reflexive trees from Figure 2.
4. Experiments
We tested our algorithm for the “hardest” cases of the right-hand side of Inequality (2), i.e., the five different values of . 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 and denote the number of finite and infinite maximal L-reflexive trees, respectively. Not all rows in the table give exact values for and , 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.

Table 1.
Number of maximal L-reflexive trees.
5. 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 [,] showed that, apart from some sporadic examples, any L-reflexive tree is a subtree of a universal tree from Figure 1. The work in [,] also gave a criterion in the form of an inequality involving ’s, 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.
Author Contributions
Conceptualization, M.A. and D.Ž.; methodology, M.A.; validation, D.Ž.; writing—original draft, D.Ž. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Cvetković, D.; Rowlinson, P.; Simić, S. Spectral Generalizations of Line Graphs: On Graphs with Least Eigenvalue −2; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
- Cvetković, D.; Rowlinson, P.; Simić, S. An Introduction to the Theory of Graph Spectra; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
- Cvetković, D.; Rowlinson, P.; Simić, S.K. Graphs with least eigenvalue −2: Ten years on. Linear Algebra Appl. 2015, 483, 504–539. [Google Scholar] [CrossRef]
- Simić, S.K.; Živković, D.; Anđelić, M.; da Fonseca, C.M. Reflexive line graphs of trees. J. Algebraic Combin. 2016, 43, 447–464. [Google Scholar] [CrossRef]
- Simić, S.K.; Anđelić, M.; da Fonseca, C.M.; Živković, D. Notes on the second largest eigenvalue of a graph. Linear Algebra Appl. 2015, 465, 262–274. [Google Scholar] [CrossRef]
- Maxwell, G. Hyperbolic trees. J. Algebra 1978, 54, 46–49. [Google Scholar] [CrossRef][Green Version]
- Neumaier, A. The second largest eigenvalue of trees. Linear Algebra Appl. 1982, 46, 2–25. [Google Scholar] [CrossRef]
- Radosavljević, Z. On unicyclic reflexive graphs. Appl. Anal. Discrete Math. 2007, 1, 228–240. [Google Scholar]
- Radosavljević, Z.; Simić, S. Which bicyclic graphs are reflexive? Fak. Ser. Mat. 1996, 7, 90–104. [Google Scholar]
- Rašajski, M.; Radosavljević, Z.; Mihailović, B. Maximal reflexive cactii with four cycles, The approach via Smith graphs. Linear Algebra Appl. 2011, 435, 2530–2543. [Google Scholar] [CrossRef]
- McKee, J.; Smyth, C. Salem Numbers, Pisot numbers, Mahler measure, and graphs. Exp. Math. 2005, 14, 211–229. [Google Scholar] [CrossRef]
- Anđelić, M.; Simić, S.K.; Živković, D. Reflexive line graphs of trees and Salem numbers. Mediterr. J. Math. 2019, 16, 127. [Google Scholar] [CrossRef]
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).