Physica A 465 (2017) 449–453
Contents lists available at ScienceDirect
Physica A journal homepage: www.elsevier.com/locate/physa
On the Hosoya index of a family of deterministic recursive trees Xufeng Chen, Jingyuan Zhang, Weigang Sun ∗ Department of Mathematics, School of Science, Hangzhou Dianzi University, Hangzhou 310018, China
highlights • Calculating the Hosoya index of a family of deterministic recursive trees. • Obtaining a solution of the Hosoya index based on the operations of a determinant. • The computational complexity of our proposed algorithm is lower than that of the existing numerical methods.
article
info
Article history: Received 15 December 2015 Received in revised form 30 June 2016 Available online 25 August 2016 Keywords: Hosoya index Computational complexity Deterministic recursive tree
abstract In this paper, we calculate the Hosoya index in a family of deterministic recursive trees with a special feature that includes new nodes which are connected to existing nodes with a certain rule. We then obtain a recursive solution of the Hosoya index based on the operations of a determinant. The computational complexity of our proposed algorithm is O(log2 n) with n being the network size, which is lower than that of the existing numerical methods. Finally, we give a weighted tree shrinking method as a graphical interpretation of the recurrence formula for the Hosoya index. © 2016 Elsevier B.V. All rights reserved.
1. Introduction The Hosoya index was first introduced by Hosoya to report a good correlation of the boiling points of a molecular graph [1]. Since then, much effort has been devoted to understanding the properties of Hosoya index and its applications. The detailed survey may be found in Ref. [2]. Till now, it has been used in a graph-based molecular descriptor [3]. The Hosoya index of a graph G, denoted by Z (G), is defined as the total number of independent edge sets of G, where two edges of a graph are independent if they have no vertex in common. Note that an independent edge set of G is also called a matching of G in graph theory. Let m(G, j) be the number of matchings of G with j edges and set m(G, 0) = 1 by convention, then the Hosoya index can be formulated as follows, Z (G) = m(G, 0) + m(G, 1) + · · · + m(G, [n/2]), where n is the number of vertices of G. For a general graph G, the computation of Z (G) is NP-Complete [4], which means that there does not exist polynomial time algorithm to solve this problem. However, several methods have been proposed to compute this problem for some special graphs. Farrell and Wahid studied a special class of graphs G with no cycle of even length, and proved that Z (G) equals the determinant of matrix (I + A(Go )), where I is an identity matrix, A(Go ) is the skew adjacency matrix of Go and
∗
Corresponding author. E-mail address:
[email protected] (W. Sun).
http://dx.doi.org/10.1016/j.physa.2016.08.026 0378-4371/© 2016 Elsevier B.V. All rights reserved.
450
X. Chen et al. / Physica A 465 (2017) 449–453
Fig. 1. The illustration of Ut with m = 3 at steps t = 0, 1, 2. Black vertices are existing vertices in each generation, and grey vertices are newly generated vertices, which are connected to their parents by dashed lines.
Go is an arbitrary orientation of G [5]. The computational complexity of Farrell’s method is the same as the computational complexity of the determinant of matrix. Presently, the best computational complexity of computing this determinant of order n is O(n2.373 ) [6–9]. Further, if G is a tree, the Hosoya index can be represented as the sum of the absolute values of the coefficients of the characteristic polynomial [10], and can be computed in O(n log2 n) time [11]. Recently the studies of deterministic recursive trees have attracted increasing attention, e.g., the random walks [12–14]. As opposed to random trees, deterministic recursive trees have an advantage with precise formulations for analysis and calculation. Therefore, we will calculate the Hosoya index of a family of deterministic recursive trees proposed in Ref. [12]. Through the structures of this family of trees, we obtain a recursive solution of the Hosoya index, and propose an algorithm to calculate its value. The time complexity of the presented algorithm is O(log2 n), which is lower than that of the existing numerical methods. Finally we provide the detailed algorithm codes. The rest of this paper is organized as follows. In Section 2, we introduce a model of deterministic recursive trees. A solution of the Hosoya index based on the operations of a determinant is provided in Section 3. In Section 4, we present a weighted tree shrinking method which gives a good graphical interpretation of the recurrence formula. The conclusions are included in the last section. Notations: Throughout this paper, some necessary notations are first introduced. det(A) denotes the determinant of a matrix A. I is an identity matrix of the appropriate size. 2. Deterministic recursive trees The deterministic recursive trees Ut [12] are generated as follows. For t = 0, the initial tree U0 has only one vertex, which is called the root. For t ≥ 1, Ut is obtained from Ut −1 , where each existing vertex in Ut −1 gives birth to m (a positive integer) new vertices, and the connections are made between newly produced vertices and their parents, see Fig. 1. From the above structure of Ut , it is clear that the degree dv of each vertex v in Ut evolves as dv (t ) = dv (t − 1) + m, which gives dv (t ) = 1 + m(t − tv ), for t ≥ tv , where tv denotes the step when the vertex v was produced. Let N (t ) and V (t ) be the number of newly generated vertices t and the number of all vertices at step t (t ≥ 1), respectively. Straightforwardly, N (t ) = m(m + 1)t −1 , and V (t ) = 1 + s=1 N (s) = (m + 1)t . 3. Solution of the Hosoya index The adjacency matrix of a simple graph G = (V , E ) is a 0–1 matrix A indexed by the vertex set V (G), where Axy = 1 when there is an edge from x to y in G, otherwise, Axy = 0. The diagonal matrix W (G) is defined as diag(w1 , w2 , . . . , wn ), where wi is the weight of vertex vi in G, 1 ≤ i ≤ n, and n is the number of the vertices. Suppose that Go is an orientation of G, that is, a directed graph by assigning the direction of all edges in graph G. Let A(Go ) = (aoij )n×n be the skew adjacency matrix of Go , where aoij is defined as follows: 1, = −1, 0,
aoij
if (vi , vj ) ∈ E (Go ), if (vj , vi ) ∈ E (Go ), otherwise.
Lemma 1 ([5]). Let Go be an arbitrary orientation of a simple graph G with n vertices and no cycle of even length. Then, Z (G) = det(I + A(Go )), where A(Go ) is the skew adjacency matrix of Go .
X. Chen et al. / Physica A 465 (2017) 449–453
451
Theorem 1. For the given deterministic recursive trees Ut , the Hosoya index of Ut is Z (Ut ) = w0 Πkt=1 (wk )N (k) ,
(1)
where N (k) = m(m + 1)k−1 , wk−1 = wk + m/wk , and wt = 1. Proof. Suppose that the vertex set of Ut is labelled as Vt := {v1 , v2 , . . . , v(m+1)t }, then the adjacency matrix A(Ut ) of Ut reads as, A(Ut −1 ) I I
.. .
I
I 0 0
I 0 0
··· ··· ···
0
0
···
.. .
.. .
I 0 0
,
.. .
0 (m+1)×(m+1)
where each block is a (m + 1)t −1 × (m + 1)t −1 matrix, A(Ut −1 ) is the adjacency matrix of Ut −1 and A(U0 ) is a 1 × 1 zero matrix. From the above adjacency matrix A(Ut ), we obtain that if vi is the parent of vj , then i < j. Hence, we construct an orientation Uto of Ut as follows: For each edge (vi , vj ) of Ut , its direction is defined from vi to vj if i < j, otherwise, from vj to vi . Then, the skew adjacency matrix A(Uto ) of Uto is
A(U o ) t −1 −I −I . . . −I
I
I
0 0
0 0
··· ··· ···
0
0
···
.. .
.. .
I 0 0
,
.. .
0 (m+1)×(m+1)
and the matrix wt I + A(Uto ) becomes
w I + A(U o ) t t −1 −I −I .. .
I
wt I
−I
I 0
0
.. .
wt I .. .
0
0
··· ··· ··· ···
I 0 0
.. . wt I (m+1)×(m+1)
.
By using the elementary operations of matrix [15], the determinant of the above matrix can be written as
(wt +
m(m+1)t −1 (wt ) det
m
)I + A(Uto−1 )
wt −I /wt −I /wt .. . −I /wt
0
0
···
0
I 0
0 I
··· ···
0 0
0
0
···
.. .
.. .
.
.. .
I
(m+1)×(m+1)
Then, we have the recurrence det(wt I + A(Uto )) = (wt )N (t ) det(wt −1 I + A(Uto−1 )),
(2)
where wt −1 = wt + m/wt and N (t ) = m(m + 1) . Substituting for det(wt −1 I + A(Uto−1 )) in the recurrence Eq. (2), we obtain t −1
det(wt I + A(Uto )) = (wt )N (t ) (wt −1 )N (t −1) · · · (w1 )N (1) det(w0 I + A(U0o )). Since A(U0 ) = 0 and w0 I + A(U0o ) is a 1 × 1 matrix, it is easy to see that det(w0 I + A(U0o )) = w0 . If we let wt = 1, then we have det(I + A(Uto )) = w0 Πkt=1 (wk )N (k) .
(3)
The proof is thus completed since Z (Ut ) = det(I + A(Uto )) by Lemma 1. It is obvious that a straightforward method to calculate the Hosoya index of Ut by Eq. (1) is to iteratively multiply t wk by itself N (k) times for k from 0 through t. The total number of multiplications is Θ (n) because n = V (t ) = 1 + k=1 N (k). Therefore, the running time of this straightforward method is Θ (n), which is linear time, but not efficient since the size n of
452
X. Chen et al. / Physica A 465 (2017) 449–453
Fig. 2. The shrinking procedures of a rooted tree with four vertices.
tree Ut increases exponentially. The main drawback of this straightforward method is that the cost of computing (wt )N (t ) is too higher. For given two positive integers x and N, a faster method for computing xN is provided by the induction technique in Ref. [16]. Let s = [N /2], if s = 0, then xs = 1. When N is even, then xN = (xs )2 ; otherwise xN = x(xs )2 . This idea yields a recursive algorithm for computing the Nth power of x, denoted by POWER(x, N ). Since the procedure POWER is recursively called by log N + 1 times, the running time is Θ (log N ). We can improve the straightforward method by calling the procedure POWER. A detailed description of this improved method for computing the Hosoya index of Ut , denoted by Fast-Hosoya-Index, is provided in Algorithm 1. We observe that the procedure POWER is called 2(t − 1) times. Hence, the running time of the improved method is O(t log n). Since n = (m + 1)t , then t ∼ log n. Therefore, we have the following corollary. Corollary 2. The algorithm of Fast-Hosoya-Index of Ut takes O(log2 n) time. Algorithm 1 Fast-Hosoya-Index Input: Two positive integers m and t of the deterministic recursive tree Ut . Output: The Hosoya index Z of the deterministic recursive tree Ut . 1: w[t ] ← 1; 2: Z ← 1; 3: for k = t − 1 down to 1 do 4: w[k] ← w[k + 1] + m/w[k + 1]; 5: y ← m ∗ pow er (m + 1, k − 1); 6: Z ← Z ∗ pow er (w[k], y); 7: end for 8: w[0] ← w[1] + m/w[1]; 9: Z ← Z ∗ w[0]; 10: return Z .
4. Shrinking method for a weighted tree In this section, we give a weighted tree shrinking method as a graphical interpretation of the recurrence formula
wk−1 = wk + m/wk . Let vi be a leaf and vj be the parent of vi in a weighted tree T . we define a leaf-deleting operation as follows: Delete the leaf vi from T , and update the weight of the vi ’s parent vertex vj by adding 1/wi , that is, wj = wj + 1/wi , where wi is the weight of vertex vi .
When performing the leaf-deleting operation one time, we obtain a new weighted tree, in which only one vertex’s weight is changed and the number of vertices is decreased by one. For a weighted tree T with n vertices, if the leaf-deleting operation is called n − 1 times, then the final tree has only one vertex, which is the root. Fig. 2 illustrates the shrinking procedures of a weighted tree. There are four vertices at the beginning of operation, in which the black vertex is the root. Initially, the vertices have the weights w1 , w2 , w3 , w4 , respectively. The weight of the vertex is updated when one of its children is deleted. After three times of leaf-deleting operations, only the root is left. Let the vertex in U0 be the root r. For the recursive tree Ut , assume that the vertices in Ut have the same weight, denoted by wt . Note that all the leaves in Ut are newly generated vertices from tree Ut −1 , and the number of these leaves is N (t ) = m(m + 1)t −1 . If we delete all these newly generated vertices from Ut by leaf-deleting operations, then the remained tree is Ut −1 , and the new weight wt −1 of every vertex in Ut −1 equals wt + m/wt since every vertex in Ut −1 produces m new vertices. Let wt = 1, and H (Ut , wt ) be the value of multiplying the weights of the deleted vertices when Ut shrinks to Ut −1 , we have H (Ut , wt ) = (wt )N (t ) .
(4)
X. Chen et al. / Physica A 465 (2017) 449–453
453
Fig. 3. The detailed shrinking operations for U2 with m = 3. From wi−1 = wi + m/wi and N (t ) = m(m + 1)t −1 , it gives w2 = 1, w1 = 4, w0 = 19/4, and N (2) = 12, N (1) = 3.
Clearly, the Hosoya index of Ut can be obtained by applying the shrinking procedure t times, that is, Z (Ut ) = w0 Πkt=1 H (Uk , wk ).
(5)
Fig. 3 provides an example of the weighted tree shrinking method for shrinking the tree U2 to U0 . The first tree is U2 with m = 3, the second tree is U1 by deleting all the leaves of U2 , and the last tree is U0 . With the aid of the shrinking method, the Hosoya index of tree U2 can be calculated as Z (U2 ) = (w2 )N (2) ∗ (w1 )N (1) ∗ w0 = 112 ∗ 43 ∗ 19/4 = 304. 5. Conclusions Presently the calculations of the Hosoya index on many types of graphs have been widely studied, however the considered graphs are random. In the current study, we have calculated the Hosoya index of a family of deterministic recursive trees. Based on the operations of a determinant, we have obtained a recursive solution. In addition, we have given a weighted shrinking method as a graphical interpretation for calculating the Hosoya index. Future work regarding the relationship between the Hosoya index and random walks is underway. Acknowledgements This work was supported by the National Natural Science Foundation of China (No. 61673144) and the Zhejiang Provincial Natural Science Foundation of China (No. LY16A010014). References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
H. Hosoya, Bull. Chem. Soc. Jpn. 44 (1971) 2332–2339. I. Gutman, O.E. Polansky, Mathematical Concepts in Organic Chemistry, Springer, Berlin, 1986. M. Randić, J. Zupan, On interpretation of well-known topological indices, J. Chem. Inf. Comput. Sci. 41 (2001) 550–560. M. Jerrum, J. Stat. Phys. 48 (1987) 121. E.J. Farrell, S.A. Wahid, Bull. Inst. Combin. Appl. 15 (1995) 81. V.V. Williams, Proc. 44th ACM Symposium on Theory of Computation, 2012. A.V. Aho, J.E. Hopcroft, J.D. Ullman, The Design and Analysis of Computer Algorithms, Addison-Wesley, 1974. X.G. Lv, T.Z. Huang, J. Le, Appl. Math. Comput. 206 (2008) 327. Y.H. Chen, C.Y. Yu, Appl. Math. Comput. 218 (2011) 4433. A.E. Brouwer, W.H. Haemers, Spectra of Graphs, Springer, 2011. M. Fürer, Algorithmica 68 (2014) 626. S. Jung, S. Kim, B. Kahng, Phys. Rev. E 65 (2002) 056101. F. Comellas, A. Miralles, Phys. Rev. E 81 (2010) 061103. J.H. Peng, J. Xiong, G.A. Xu, Physica A 407 (2014) 231. C.D. Godsil, Algebraic Combinatorics, Chapman & Hall, 1993. M.H. Alsuwaiyel, Algorithms Design Techniques and Analysis, Publishing House of Electronics Industry, 2013.