Next Article in Journal
A New Approach to Intertemporal Choice: The Delay Function
Previous Article in Journal
Electron Transfer via Helical Oligopeptide to Laccase Including Chiral Schiff Base Copper Mediators

Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

# Efficient Algorithm for Generating Maximal L-Reflexive Trees †

by
Milica Anđelić
1,* and
Dejan Živković
2
1
Department of Mathematics, Kuwait University, Safat 13060, Kuwait
2
Faculty of Informatics and Computing, Singidunum University, 11000 Belgrade, Serbia
*
Author to whom correspondence should be addressed.
In fond memory of our coauthor Slobodan K. Simić (1948–2019).
Symmetry 2020, 12(5), 809; https://doi.org/10.3390/sym12050809
Submission received: 17 April 2020 / Revised: 4 May 2020 / Accepted: 5 May 2020 / Published: 13 May 2020

## 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 $det ( x I − 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.

## 2. 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
$4 k + l + ∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1 ≤ p + q + 1 ( 2 p − 1 ) ( 2 q − 1 ) − 4 + 1 ,$
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
$∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1 ≤ p + q + 1 ( 2 p − 1 ) ( 2 q − 1 ) − 4 + 1 .$
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
$L = ∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1$
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
$k j = ∑ i = j − 1 s + 1 t i , j = 1 , … , s , s + 1 .$
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.
Lemma 1.
Let
$L = ∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1$
for some $s ≥ 0$ and some sequence $t 0 , … , t s , t s + 1$ with each $t i ≥ 0$, $i = 0 , … , s , s + 1$. If $k s + 2 = t s + 1$ and
$k j = ∑ i = j − 1 s + 1 t i , j = 1 , … , s , s + 1$
then
$L = ∑ j = 1 s + 1 1 ( 2 j + 1 ) ( 2 j − 1 ) k j + 1 2 k s + 2 .$
Proof.
Since
$1 ( 2 j + 1 ) ( 2 j − 1 ) = j 2 j + 1 − j − 1 2 j − 1 , j = 1 , … , s + 1 ,$
telescoping gives
$∑ j = 1 s + 1 1 ( 2 j + 1 ) ( 2 j − 1 ) k j + 1 2 k s + 2 = ∑ j = 1 s + 1 j 2 j + 1 − j − 1 2 j − 1 ∑ i = j − 1 s + 1 t i + 1 2 t s + 1 = ∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1 = L ,$
as claimed. □
Coefficients $t i$s can easily be recovered from coefficients $k j$s, as the next lemma shows.
Lemma 2.
Let
$L = ∑ j = 1 s + 1 1 ( 2 j + 1 ) ( 2 j − 1 ) k j + 1 2 k s + 2$
for some $s ≥ 0$ and some sequence $k 1 , … , k s + 1 , k s + 2$ such that $k 1 ≥ k 2 ≥ ⋯ ≥ k s + 1 ≥ k s + 2 ≥ 0$. If $t s + 1 = k s + 2$ and $t i = k i + 1 − k i + 2$ for $i = 0 , … , s$, then
$L = ∑ i = 0 s i + 1 2 i + 3 t i + 1 2 t s + 1 .$
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 $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 / ( ( 2 j + 1 ) ( 2 j − 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.
Lemma 3.
Let $T ′$ and $T ″$ be two canonical trees from Figure 2 and let $T ′ ∈ T l , k 1 , k 2 ′ , … , k l ′$ and $T ″ ∈ T j , k 1 , k 2 ″ , … , k j ″$. Then $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
$L ( T 1 , k 1 ) = k 1 / 3 , L ( T j , k 1 , k 2 , … , k j ) = L ( T j , k 1 , k 2 , … , k j − 1 ) + k j ( 2 j + 1 ) ( 2 j − 1 ) ,$
for $j = 2 , 3 , …$ and $1 ≤ k j ≤ k j − 1 ≤ ⋯ ≤ k 1 ≤ d$.
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
$L + k j 2 ( 2 j + 1 ) ≤ R .$
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 $n ≥ j$
$L + ∑ i = j n k j ( 2 i + 3 ) ( 2 i + 1 ) < R .$
This inequality can be rewritten as
$L + k j · ∑ i = 0 n 1 ( 2 i + 3 ) ( 2 i + 1 ) − ∑ i = 0 j − 1 1 ( 2 i + 3 ) ( 2 i + 1 ) < R$
or
$L + k j · ∑ i = 0 n 1 ( 2 i + 3 ) ( 2 i + 1 ) − j 2 j + 1 < R .$
Letting $n → ∞$ in the last inequality we get
$L + k j · 1 2 − j 2 j + 1 ≤ R ,$
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.
Proof.
By Lemma 3, 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$ are subtrees of $T j , k 1 , k 2 , … , k j$. □
Previous considerations are incorporated into recursive algorithm mlrt given in Figure 5. Therefore, the following theorem is straightforward.
Theorem 2.
An initial call mlrt$( 1 , k 1 , k 1 / 3 )$for fixed $k 1 ≤ d = deg ( v )$ and $R = 6 , 3 , 2 2 5 , 2 1 7 , 2 , …$ 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 $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.

## 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 [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.

## 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

1. 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]
2. Cvetković, D.; Rowlinson, P.; Simić, S. An Introduction to the Theory of Graph Spectra; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
3. 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]
4. 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]
5. 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]
6. Maxwell, G. Hyperbolic trees. J. Algebra 1978, 54, 46–49. [Google Scholar] [CrossRef] [Green Version]
7. Neumaier, A. The second largest eigenvalue of trees. Linear Algebra Appl. 1982, 46, 2–25. [Google Scholar] [CrossRef] [Green Version]
8. Radosavljević, Z. On unicyclic reflexive graphs. Appl. Anal. Discrete Math. 2007, 1, 228–240. [Google Scholar]
9. Radosavljević, Z.; Simić, S. Which bicyclic graphs are reflexive? Fak. Ser. Mat. 1996, 7, 90–104. [Google Scholar]
10. 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] [Green Version]
11. McKee, J.; Smyth, C. Salem Numbers, Pisot numbers, Mahler measure, and graphs. Exp. Math. 2005, 14, 211–229. [Google Scholar] [CrossRef] [Green Version]
12. 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]
Figure 1. Structure of L-reflexive trees.
Figure 1. Structure of L-reflexive trees.
Figure 2. Canonical structure of L-reflexive trees.
Figure 2. Canonical structure of L-reflexive trees.
Figure 3. Levelled canonical structure of L-reflexive trees.
Figure 3. Levelled canonical structure of L-reflexive trees.
Figure 4. Search-space tree for maximal L-reflexive trees.
Figure 4. Search-space tree for maximal L-reflexive trees.
Figure 5. Maximal L-reflexive tree (mlrt) algorithm.
Figure 5. Maximal L-reflexive tree (mlrt) algorithm.
Table 1. Number of maximal L-reflexive trees.
Table 1. Number of maximal L-reflexive trees.
 $R = 6$ $d = 18$:   $N fin = 1 , N inf = 0$ $d = 17$:   $N fin = 10 , N inf = 2$ $d = 16$:   $N fin = 6474 , N inf = 131$ $d = 15$:   $N fin ≥ 20310 , N inf ≥ 401$ $d = 14$:   $N fin ≥ 13502 , N inf ≥ 254$ $d = 13$:   $N fin ≥ 24957 , N inf ≥ 554$ $d = 12$:   $N fin = 0 , N inf = 1$ $R = 3$ $d = 8$:   $N fin = 10 , N inf = 2$ $d = 7$:   $N fin = 6463 , N inf = 130$ $d = 6$:   $N fin = 0 , N inf = 1$ $R = 2 2 5$ $d = 7$:   $N fin = 1 , N inf = 0$ $d = 6$:   $N fin = 32 , N inf = 4$ $d = 5$:   $N fin ≥ 28498 , N inf ≥ 298$ $d = 4$:   $N fin = 0 , N inf = 1$ $R = 2 1 7$ $d = 6$:   $N fin = 2 , N inf = 0$ $d = 5$:   $N fin = 590 , N inf = 17$ $d = 4$:   $N fin = 0 , N inf = 1$ $R = 2$ $d = 6$:   $N fin = 1 , N inf = 0$ $d = 5$:   $N fin = 10 , N inf = 2$ $d = 4$:   $N fin = 0 , N inf = 1$

## Share and Cite

MDPI and ACS Style

Anđelić, M.; Živković, D. Efficient Algorithm for Generating Maximal L-Reflexive Trees. Symmetry 2020, 12, 809. https://doi.org/10.3390/sym12050809

AMA Style

Anđelić M, Živković D. Efficient Algorithm for Generating Maximal L-Reflexive Trees. Symmetry. 2020; 12(5):809. https://doi.org/10.3390/sym12050809

Chicago/Turabian Style

Anđelić, Milica, and Dejan Živković. 2020. "Efficient Algorithm for Generating Maximal L-Reflexive Trees" Symmetry 12, no. 5: 809. https://doi.org/10.3390/sym12050809

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.