Some Preliminary Result About the Inset Edge and Average Distance of Trees
Some Preliminary Result About the Inset Edge and Average Distance of Trees
M. H. Khalifeh *, A.-H. Esfahanian Department of Computer Science and Engineering Michigan State University East Lansing, MI 48824, USA
Abstract:
An added edge to a graph is called an inset edge. Predicting ๐ inset edges which minimize the average distance of a graph is known to be NP-Hard. However, when ๐ = 1 the complexity of the problem is polynomial. In this paper, some tools for a precise analysis of the problem for the trees are established. Using the tools, we can avoid using the distance matrix. This leads to more efficient algorithms and a better analysis of the problem. Several applications of the tools as well as a tight bound for the change of average distance when an inset edge is added to a tree are presented. keywords: Average distance, Inset edge, Wiener index, Tree, Unicyclic graphs 2000 AMS Subject Classification Number: 05C12, 05A15,68Q15 ,05C05, 11Y16. Introduction:
Average distance, degree distribution and clustering coefficient are the three most robust measures of network topology. The average distance of a graph is the average of distances between every pair of vertices with finite distances [1]. The sensitivity of average distance of a network, both after missing a link [5] or adding a link is interesting for the researchers [3]-[4]. The efficiency of mass transfer in a โ Corresponding authorสผs Email: [email protected] metabolic network can be judged by studying its average path length [5]. On the other hand, finding ๐ new links which minimize the average distance is an NP-Hard problem [7]. According to [7] there exists a polynomial time algorithm for finding an edge with maximum change on the average distance. In this paper we base some tools which helps to analyze the change of average distance of a tree after adding one edge. After adding one edge to a tree some distances change. The tools let us to avoid re-calculating the distances with no changes. A tree ๐ on ๐ vertices has ! ! " = |๐ธ(๐ % )| inset edges. Using the tools, we can limit, the search space of inset edge(s), with maximum change on the average distance. Other applications of the tools such as finding bounds for the average distance change are achieved. From here on we switch to the relevant standard graph theory terminology to state notations, definitions and results. Definitions, Notations and Results:
For a graph ๐บ and ๐ข, ๐ฃ โ ๐(๐บ) , ๐ & (๐ข, ๐ฃ) denotes the distance between ๐ข and ๐ฃ which is the length of a shortest path between ๐ข and ๐ฃ , if there is a path between them, and is equal to infinity otherwise. Using this, for ๐ด, ๐ต โ ๐ (๐บ) let: ๐ & (๐ด, ๐ต) = 12 6 ๐ & (๐, ๐) (1) ((,*) โ . ร0 Thus, we have the sum of distances between all pair of vertices as,
๐ท(๐บ) = ๐ & :๐(๐บ), ๐(๐บ);. ๐ท(๐บ) is also known as Wiener number of ๐บ [10]. Therefore, the average distance of a graph is equal to ๐ด๐ท(๐บ) = ๐ท(๐บ) ยท ๐ "1 where ๐ denotes the number of pairs of vertices of ๐บ with finite distances. When ๐บ is a connected simple graph, ๐ = : |3(&)|$ ; . For ease we may use
๐ท(๐บ) instead of
๐ด๐ท(๐บ) since the difference is a constant coefficient in our case. For a given graph,
๐บ โ ๐พ ! (complete graph on ๐ vertices) and ๐ โ ๐ธ(๐บ) , let ๐บ =๐บ + ๐ . Therefore, for a tree ๐ and ๐ฅ๐ฆ โ ๐ธ(๐) , ๐ is a unicyclic graph. In this case we call the edge ๐ฅ๐ฆ the inset edge. When we know the length of the cycle of ๐ is ๐ we indicate it by ๐ . Definition 1:
For ๐บ we define the ๐ท (cid:9356) and ๐ด๐ท (cid:9356) indices as follows: ๐ซ (cid:9356) ( ๐ฎ ๐ ) = ๐ซ(๐ฎ) โ ๐ซ( ๐ฎ ๐ )|๐| , and ๐จ๐ซ (cid:9356) ( ๐ฎ ๐ ) = ๐จ๐ซ(๐ฎ) โ ๐จ๐ซ( ๐ฎ ๐ )|๐| . Note that in ๐, " | ๐ | = | { ๐ฅ๐ฆ } | = 1 . Therefore ๐ท (cid:9356) (๐) = ๐ท(๐) โ ๐ท: ๐ ๐ฅ๐ฆ ; . Moreover, for a connected graph ๐บ, : |3(&)|$ ;๐ด๐ท (cid:9356) (๐บ) = ๐ท (cid:9356) (๐บ) . Informally the prime notation denotes change of average distances after a change on the graph. Suppose ๐ถ is the cycle of ๐ โ" , we define, ๐ถ = { ๐ฃ โ ๐(๐ถ) | ๐ (๐ฅ, ๐ฃ) < ๐ (๐ฆ, ๐ฃ) }, ๐ถ = { ๐ฃ โ ๐(๐ถ) | ๐ (๐ฅ, ๐ฃ) > ๐ (๐ฆ, ๐ฃ) }, ๐ถ : = { ๐ฃ โ ๐(๐ถ) | ๐ (๐ฅ, ๐ฃ) = ๐ (๐ฆ, ๐ฃ) }. Note that |๐ถ | = |๐ถ | = O P . | ๐ถ : | = 0 when ๐ is even and | ๐ถ : | = 1 otherwise. Now we propose an indexing of ๐ถ to ๐ฅ ; สผs, P , such that ๐ (๐ฅ, ๐ฅ ; ) = ๐ โ 1 . Similarly, we index the elements of ๐ถ to ๐ฆ ; สผs. Moreover, if ๐ถ : has its single element we call it ๐ฅ : . As we observe the indexing is unique and partitions the vertices of ๐ถ , the cycle of ๐ . On the other hand, for ๐ฃ โ ๐(๐ถ) suppose ๐ < to be the maximal subtree of ๐ such that, ๐(๐ < ) โฉ ๐(๐ถ) = {๐ฃ} . Informally ๐ < is the sub-tree attached to the vertex ๐ฃ โ ๐(๐ถ) of the cycle of ๐ . We denote the number of vertices of ๐ < , |๐(๐ < )| , by ๐ค < . Using the notations and definitions we have the following theorem which has a critical role for our analysis and reduction of time complexity of the actual calculations. Theorem 1: For a tree ๐ป , ๐ซ (cid:9356) : ๐ป ๐๐๐ ; = 6 (๐๐ ๐ป (๐, ๐) โ ๐). ๐ ๐ . ๐ ๐(๐,๐)โ๐ช ๐ ร๐ช ๐ ๐ ๐ป (๐,๐)E๐๐ Proof:
Suppose ๐ถ is the cycle of ๐ . Using the definition of ๐ท and our notations, ๐ท: ๐ ; = 6 ๐ %&โ (๐(๐ G ), ๐(๐ < )) {G,<}โ3(K & โช K ) ) + 6 ๐ %&โ (๐(๐ G ), ๐(๐ < )) {G,<}โ3MK โ โช K ) N + 6 ๐ %&โ (๐(๐ < ), ๐(๐ < )) + 6 ๐ %&โ (๐(๐ G ), ๐(๐ < )) (G,<)โK & รK โ O * (G,<)P7$ <โ3(K) + 6 ๐ %&โ (๐(๐ G ), ๐(๐ < )) (G,<)โK & รK โ O * (G,<)E7$ (2) Looking at the updated distances from ๐ to ๐ one can check that, ๐ %&โ (๐(๐ G ), ๐(๐ < )) = ๐ (๐(๐ G ), ๐(๐ < )) except for (๐ข, ๐ฃ) โ ๐ถ ร ๐ถ ๐ (๐ข, ๐ฃ) > . Therefore,
๐ท(๐) โ ๐ท: ๐ ; = 6 ๐ (๐(๐ G ), ๐(๐ < )) (G,<)โK & รK โ O * (G,<)E7$ โ 6 ๐ %&โ (๐(๐ G ), ๐(๐ < )). (G,<)โK & รK โ O * (G,<)E7$ (3) In addition, for every ๐ข โ ๐:๐ + ; , ๐ฃ โ ๐:๐ + ; , if ๐ :๐ฅ ; , ๐ฆ Q ; > , ๐ :๐ฅ ; , ๐ฆ Q ; > ๐ ๐ป ๐๐๐ :๐ฅ ; , ๐ฆ Q ;. (4) ๐ (๐ข, ๐ฅ ; ) = ๐ ๐ป ๐๐๐ (๐ข, ๐ฅ ; ), (5) ๐ (๐ฃ, ๐ฆ ; ) = ๐ ๐ป ๐๐๐ (๐ฃ, ๐ฆ ; ), (6) More precisely for the given condition we can use the new paths formed after adding the inset edge, ๐ฅ๐ฆ , which gives us, ๐ (๐ฅ ; , ๐ฆ ; ) โ ๐ ๐ป ๐๐๐ (๐ฅ ; , ๐ฆ ; ) = 2. ๐ (๐ฅ ; , ๐ฆ ; ) โ ๐ . Since we have |๐ + | = ๐ค + and |๐ + | = ๐ค + so for ๐(๐ฅ ; , ๐ฆ ; ) > using (4) to (6), ๐ j๐:๐ + ;, ๐:๐ + ;k โ ๐ ๐ป ๐๐๐ j๐:๐ + ;, ๐:๐ + ;k = (2. ๐ (๐ฅ ; , ๐ฆ ; ) โ ๐). ๐ค + . ๐ค + . (7) The equations (3) and (7) leads us to, ๐ท (cid:9356) : ๐ ; = 6 (2๐ (๐ข, ๐ฃ) โ ๐). ๐ค G . ๐ค <(G,<)โK & รK โ O * (G,<)E7$ . This completes the proof. โ As a useful example of last theorem, ๐ท (cid:9356) ( ๐ ) = ๐ค G . ๐ค < . Corollary 1:
For a tree ๐ , ๐๐๐ ๐๐โ๐ฌ(๐ป ๐ ) ๐ซ (cid:9356) : ๐ป ๐๐ ; = ๐๐๐ ๐๐โ๐ฌ(๐ป ๐ ) ๐ซ: ๐ป ๐๐๐ ;. Proof:
By the definition 1 and the fact that
๐ท(๐) is a constant here. โ
Remark 1:
As defined, when we introduce a graph, ๐ we mean that the inset edge is ๐ฅ๐ฆ which makes a ๐ -cycle for ๐ . Since in the indexing of the cycle of ๐ , ๐ฅ = ๐ฅ and ๐ฆ = ๐ฆ so ๐ = ๐ . . . Moreover, we abuse the indexing of the cycle of ๐ to say that the inset edge of ๐ ! . is ๐ฅ $ ๐ฆ . Also, ๐ / . means its inset edge is ๐ฅ T ๐ฆ where ๐ฅ T is a neighbor of ๐ฅ except from ๐ฅ $ . A similar argument applies for ๐ + regarding the indexing of the cycle of ๐ . โฒ To use the benefits of Theorem 1 we require to create some tools to be able to use some matrix calculations. For ease hereafter let ๐ (cid:9356) = O P . Suppose we are given a ๐ . We associate the vectors ๐พ or ๐พ = [ ๐ค ] to it which is a ๐ (cid:9356) โ vector and ๐ค = ๐ค + = |๐ + | . Similarly, we define ๐พ or ๐พ =u ๐ค v where ๐ค = ๐ค + = |๐ + | . Finally, we associate a matrix ๐พ ๐๐ to ๐ as follows, ๐พ = ๐พ ร ( ๐พ) . Therefore, in a ๐พ = [๐ค ;Q ] , ๐ค ;Q = ๐ค . ๐ค = ๐ค + . ๐ค . Next, we introduce the matrix ๐ญ . The matrix ๐ญ is a ๐ (cid:9356) ร ๐ (cid:9356) matrix as follows, ๐ญ = x๐ซ + ๐ถ ๐ is odd, ๐ซ otherwise. where ๐ซ = [๐ ;Q ] and ๐ถ = [๐ ;Q ] are also ๐ (cid:9356) ร ๐ (cid:9356) matrices as follows, ๐ ;Q = x2(๐ (cid:9356) โ ๐ โ ๐ + 1) ๐ + ๐ โค ๐ (cid:9356) , 0 otherwise. and ๐ ;Q = x1 ๐ + ๐ โ 1 โค ๐ (cid:9356) , 0 otherwise. For more resolution, ๐ญ = โฃโขโขโขโขโขโก 2๐ (cid:9356) โ 1 2๐ (cid:9356) โ 3 2๐ (cid:9356) โ 5 โฆ 12๐ (cid:9356) โ 3 2๐ (cid:9356) โ 5 โฆ 1 02๐ (cid:9356) โ 5 โฆ 1 0 0 โฎ โฎ 1 โฎ โฎ 1 0 โฆ 0 1 0 0 โฆ 0 0 โฆโฅโฅโฅโฅโฅโค ๐ is odd ๐ญ = โฃโขโขโขโขโขโขโขโก 2๐ (cid:9356) โ 2 2๐ (cid:9356) โ 4 2๐ (cid:9356) โ 6 โฆ 2 02๐ (cid:9356) โ 4 2๐ (cid:9356) โ 6 โฆ 2 0 02๐ (cid:9356) โ 6 โฎ โฆ 2 0 0 0 โฎ 0 โฎ 2 โฎ 2 0 โฎ 2 0 0 โฆ 0 0 0 0 โฆ 0 0 โฆโฅโฅโฅโฅโฅโฅโฅโค ๐ is even ๐ถ = โฃโขโขโขโขโขโก 1 1 1 โฆ 11 1 โฆ 1 01 โฆ 1 0 0 โฎ โฎ 1 โฎ โฎ 1 0 โฆ 0 1 0 0 โฆ 0 0 โฆโฅโฅโฅโฅโฅโค ๐พ = โฃโขโขโขโก๐ค ! ๐ค " โฎ๐ค (cid:9356) โฆโฅโฅโฅโค E๐ค ! ๐ค " โฆ ๐ค (cid:9356) F = โฃโขโขโขโขโขโขโขโก ๐ค ! . ๐ค ! ๐ค ! . ๐ค " ๐ค ! . ๐ค % โฆ ๐ค ! . ๐ค (cid:9356) ๐ค " . ๐ค ! ๐ค " . ๐ค " โฎ โฆ ๐ค " . ๐ค (cid:9356) ๐ค % . ๐ค ! โฎ โฆ ๐ค % . ๐ค (cid:9356) โฎ โฆ โฎ ๐ค (cid:9356) &" . ๐ค ! โฆ โฎ ๐ค (cid:9356) &" . ๐ค (cid:9356) ๐ค (cid:9356) &! . ๐ค ! โฆ โฎ ๐ค (cid:9356) &! . ๐ค (cid:9356) &! ๐ค (cid:9356) &! . ๐ค (cid:9356) ๐ค (cid:9356) . ๐ค ! โฆ ๐ค (cid:9356) . ๐ค (cid:9356) &" ๐ค (cid:9356) . ๐ค (cid:9356) &! ๐ค (cid:9356) . ๐ค (cid:9356) โฆโฅโฅโฅโฅโฅโฅโฅโค In fact, ๐ญ is an upper-triangular matrix which provides the coefficients of ๐ค G . ๐ค < in the formula of ๐ท (cid:9356) in the Theorem 1. To express our next result, we remind the Hadamard multiplication and norm one of matrices as follows. If
๐จ = [๐ ;Q ] is a matrix then the norm one of ๐ด is the following: โ๐จโ = โ |๐ ;Q | ;,Q . The Hadamard product of two matrices ๐จ = [๐ ;Q ] and ๐ฉ = [๐ ;Q ] with the same dimensions is an element-wise product which is defined as follows, ๐จ โ ๐ฉ = [๐ ;Q . ๐ ;Q ] . Note also that ๐ ; denotes the ๐ th standard vector of proper dimension on the text. Lemma 1:
For a tree ๐ we have: ๐ซ (cid:9356) : ๐ป ๐๐๐ ; = (cid:134)๐ญ ๐ โ ๐พ ๐๐ (cid:134). Proof:
Suppose ๐ถ is the cycle of ๐ and ๐ข, ๐ฃ โ ๐(๐ถ) . According to the definition, the ๐๐ สผth entry of ๐ is equal to ๐ค G . ๐ค < . And the ๐๐ สผth entry of ๐น for ๐ (๐ข, ๐ฃ) > is equal to (2๐ (๐ข, ๐ฃ) โ ๐ ) and is zero otherwise. Therefore, using the definition of norm one and Hadamard multiplication: (cid:134)๐ญ โ ๐พ (cid:134) = 6 (2๐ (๐ข, ๐ฃ) โ ๐). ๐ค G . ๐ค <(G,<)โK & รK โ O * (G,<)E7$ By Theorem 1 the RHS of the above equation is equal to ๐ท (cid:9356) : ๐ ; . โ The next theorem gives the lower and upper bound of ๐ท (cid:9356) : ๐ ; over the set of all trees with ๐ vertices. The upper bound is interesting since for a tree ๐ with ๐ vertices (๐ โ 1) $ โค ๐ท(๐) โค : ! ; , see [9]. We underline that ๐ ! and ๐ ! denotes a path and a star over ๐ vertices respectively. Moreover ๐ ; is the ๐ สผth unit standard vector. Theorem 2:
For a tree ๐ with ๐ vertices, (cid:9356) ( ๐ป) โค ๐
๐๐ โ ๐
๐๐ โ ๐๐๐ + ๐. ๐๐ Moreover, the lower bound holds if and only if ๐ has two leaves with the distance equal to 2. The upper bound holds if and only if the following holds, 1) ๐ โก 0 ๐๐๐ 8, ๐ โฅ 16, ๐ is formed by attaching an arbitrary vertex of an arbitrary tree with !W vertices to a leaf of a ๐ and also attaching an arbitrary vertex of another arbitrary tree with !W vertices to the other leaf of ๐ . 3) ๐ฅ๐ฆ corresponds to the leaves of ๐ S in the tree formed in the previous step. Proof :
To prove the upper bound, suppose we are given the graph ๐ with some non-trivial ๐ + , where ๐ฅ ; belongs to ๐ถ /{๐ฅ } and |๐ (๐ )| = ๐ . Accordingly, ๐ โ 1 . Moreover let ๐ถ to be the cycle of ๐ . Detach the elements of
๐(๐ + )/{๐ฅ ; } and attach arbitrarily to the vertices of ๐ . and call the new graph, ๐บ . By lemma 1 we can see that if (cid:149)๐:๐ + ;/{๐ฅ ; }(cid:149) = ๐ค , ๐ท (cid:9356) (๐บ) = (cid:150)๐ญ โ : ๐พ + ๐ค. ๐ โ ๐ค. ๐ ; ;. : ๐พ ; U (cid:150)= ๐ท (cid:9356) : ๐ ; + (cid:134)๐ญ โ ( ๐ค. ๐ ). ( ๐พ ) U (cid:134) โ (cid:134)๐ญ โ (๐ค. ๐ ; ). ( ๐พ ) U (cid:134). (8) This is straightforward to check that, (cid:134)๐ญ โ ( ๐ค. ๐ ). ( ๐พ ) U (cid:134) > (cid:134)๐ญ โ (๐ค. ๐ ; ). ( ๐พ ) U (cid:134). Therefore by (8) , ๐ท (cid:9356) (๐บ) > ๐ท (cid:9356) : ๐ ;. Consequently, since ๐ was arbitrary and ๐ โ 1 : ๐ท (cid:9356) : ๐ ; is maximum โ โ ๐ + ,
2 โค ๐ โค ๐ (cid:9356) , is trivial. 2.
Like wisely, ๐ท (cid:9356) : ๐ ; is maximum โ โ ๐ + ,
2 โค ๐ โค ๐ (cid:9356) , is trivial. 3.
Since the matrix ๐พ is independent of ๐ค ) , ๐ท (cid:9356) : ๐ ; is maximum โ ๐ ) is trivial. 4. Using the facts 1 To 3, I: ๐ท (cid:9356) : ๐ ; is maximum โ โ๐ฃ โ ๐(๐ถ)/{๐ฅ, ๐ฆ}, |๐ < | = ๐ค < = 1 . II: Since |๐ถ| = ๐ and |๐(๐)| = ๐ so ๐ท (cid:9356) : ๐ ; is maximum โ ๐ค + ๐ค = ๐ โ ๐ + 2. (9) Using the lemma 1 and (9) we can see that ๐ท (cid:9356) : ๐ ; is maximal โ ๐ค . ๐ค = (cid:154)๐ โ ๐ + 22 (cid:155) (cid:156)๐ โ ๐ + 22 (cid:157) (๐ โ 2). Consequently, by the facts 1 to 5 and the Lemma 1, if ๐ท (cid:9356) : ๐ ; is maximal and ๐ โก2 ๐๐๐ 4: ๐ท (cid:9356) : ๐ ; = (cid:154)๐ โ ๐ + 22 (cid:155) (cid:156)๐ โ ๐ + 22 (cid:157) (๐ โ 2) + 14 (๐ โ 2)(๐ โ 4)(๐ โ ๐ + 2)+ 12 (๐ โ 4)(๐ โ 6) โ 18 (๐ โ 6)(๐ โ 2) , (10) and for ๐ โก 0 ๐๐๐ 4 : ๐ท (cid:9356) : ๐ ; = (cid:154)๐ โ ๐ + 22 (cid:155) (cid:156)๐ โ ๐ + 22 (cid:157) (๐ โ 2) + 14 (๐ โ 2)(๐ โ 4)(๐ โ ๐ + 2)+ 12 (๐ โ 4)(๐ โ 6) โ 18 (๐ โ 4) $ , (11) and for odd ๐ สผs: ๐ท (cid:9356) : ๐ ; = (cid:154)๐ โ ๐ + 22 (cid:155) (cid:156)๐ โ ๐ + 22 (cid:157) (๐ โ 2) + 14 (๐ โ 3) $ (๐ โ ๐ + 2) + 12 (๐ โ 5) $ โ 18 (๐ โ 5)(๐ โ 3). (12) Since ๐ = |๐(๐)| is a constant so
๐ทโฒ: ๐ ; in (10) to (12) is a function of ๐ = |๐ถ| . To find the maximum of ๐ท (cid:9356) : ๐ ; we can take derivative of ๐ท (cid:9356) : ๐ ; respect to ๐ for each case of (11) to (12) and find the critical points. To do this we require to consider 2 cases. First if !"7S$$ is an integer then the roots of XY (cid:9356) M 9 %&โ
NX7 in the (10) to (12) are equal to the following respectively, ๐ = ๐ $ + 2๐ โ 242๐ โ 7 , ๐ $ = ๐ $ โ 2๐ โ 242๐ โ 7 and ๐ = ๐ $ โ 2๐ โ 252๐ โ 7 . Second if !"7S$$ is not an integer then the critical points of XY (cid:9356) M 9 %&โ
NX7 in the (10)-(12) are respectively, ๐ = ๐ $ + 2๐ โ 262๐ โ 7 , ๐ $ = ๐ $ โ 2๐ โ 252๐ โ 7 and ๐ = ๐ $ โ 2๐ โ 262๐ โ 7 . Now for ๐ ; , ๐ = 1 ๐๐ 2 ๐๐ 3 we require to use the values โ๐ ; โ ๐๐ โ๐ ; โ to find the maximum of ๐ท (cid:9356) : ๐ ; in their respective equations. After doing so, we observe that the maximum reachable value is equal to ๐
16 โ ๐ $
32 โ 9๐8 + 2.
This proves the upper bound. One can check that the described trees of the theorem touches the above upper bound. Moreover, other cases with their respective values cannot reach this upper bound. The lower bound is clear since for any given ๐ , by the theorem 1, ๐ท (cid:9356) ( ๐ ) โฅ 1 , as we had, ๐ท (cid:9356) ( ๐ ) = 6 (2๐ (๐ข, ๐ฃ) โ ๐). ๐ค G . ๐ค <(G,<)โK & รK โ O * (G,<)E7$ . On the other hand, if either of ๐ค G , ๐ค < ๐๐ (2๐ (๐ข, ๐ฃ) โ ๐) for some cases is greater than 1 then ๐ท (cid:9356) : ๐ ; > 1 . This means the only trees which can touch the lower bound are the describe case of the theorem. This completes the proof. โ Remark 2:
The previous theorem gives the best upper bound of ๐ท (cid:9356) : ๐ ; where ๐(๐) = ๐ and ๐ is divisible by 8. Using the theoremsสผ proof, it is possible establish a lower tight upper bound when ๐ โข ๐๐๐ 8 . Generally, if ๐ท (cid:9356) : ๐ ; with |๐(๐)| = ๐ is maximum then: ๐ = ๐2 + ๐, ๐ = 1 or 2 or 3 or 4. and ๐ค = (cid:154)๐ โ ๐ + 22 (cid:155) , ๐ค = (cid:156)๐ โ ๐ + 22 (cid:157) and ๐ค < = 1, โ๐ฃ โ ๐(๐ถ)/{๐ฅ, ๐ฆ} . Note that as in theorem 2, ๐ and ๐ are arbitrary trees. โฒ Suppose we are given a ๐ which means the inset edge is ๐ฅ ๐ฆ . If we remove ๐ฅ ๐ฆ and substitute with ๐ฅ $ ๐ฆ $ then we have a (๐ โ 2) -cycle in ๐ ! ! . Precisely, we can make just one change to the vectors ๐พ and ๐พ and calculate ๐ท (cid:9356) ( ๐) ! ! . This lets us to prevent recalculating and thus we can save our time. In the next two theorems we present a variation of this fact. Theorem 3:
Suppose ๐ is a tree and the vectors ๐พ , ๐พ and the matrix ๐พ =[๐ค ;Q ] are associated to ๐ , where ๐ (๐ฅ, ๐ฆ) > 3 . Then ๐ท (cid:9356) ( ๐ ) ! ! โฅ ๐ท (cid:9356) ( ๐ ) . . if and only if: โฉโชโชโจโชโชโง 6 ๐ ๐๐ โฅ ๐ ๐ ๐ข๐ฌ ๐๐ฏ๐๐ง (cid:9356) S๐๐,๐E๐ , 2( 6 ๐ ๐๐ ) + 6 ๐ ๐๐ โฅ ๐๐ (cid:9356) S๐๐P๐S๐P๐ (cid:9356)
S๐๐,๐E๐ ๐ ๐ข๐ฌ ๐จ๐๐.
Proof:
Suppose we have ๐ . . and ๐ (๐ฅ , ๐ฆ ) > 3 . If we remove ๐ฅ ๐ฆ from ๐ . . and add ๐ฅ $ ๐ฆ $ to ๐ regarding the indexing of ๐ถ . and ๐ถ . in the ๐ . . then we reach to ๐ ! ! . Therefore, we see that: ๐พ ! ! ! = ๐พ[2: ] + . . . ๐ค . . . . ๐ , and ๐พ ! ! ! = ๐พ[2: ] + . . . ๐ค . . . . ๐ . Moreover, we know that
๐พ = ๐พ ! ! ! ร ( ๐พ ! ! ! ) ๐5 ! ! . Therefore, using lemma 1, ๐ท (cid:9356) : ๐ ! ! ; โ ๐ท (cid:9356) : ๐ . . ; = (cid:134)๐ญ โ ๐พ ! ! (cid:134) โ (cid:134)๐ญ โ ๐พ . . (cid:134) that is: ๐ท (cid:9356) : ๐ ! ! ; โ ๐ท (cid:9356) : ๐ . . ; = โฉโชโชโจโชโชโง 6 ๐ค ;Q โ ๐ค ๐ is even, WP;SQP7 (cid:9356)
S1;,QE1
2( 6 ๐ค ;Q ) + 6 ๐ค ;Q โ 2๐ค (cid:9356) S$WP;SQP7 (cid:9356)
S1;,QE1 ๐ is odd.
This completes the proof. โ In the next theorem we compare ๐ท (cid:9356) ( ๐ . . ) and ๐ท (cid:9356) ( ๐ ! . ) regarding the indexing of ๐ถ . and ๐ถ . . That is, we remove the ๐ฅ ๐ฆ from ๐ . . and insert the edge ๐ฅ $ ๐ฆ to the ๐ . Theorem 4:
Suppose ๐ is a tree and the vectors ๐พ , ๐พ and the matrix ๐พ =[๐ค ;Q ] are associated to ๐ , where ๐ (๐ฅ, ๐ฆ) > 2 . Then ๐ท (cid:9356) ( ๐ ) ! . โฅ ๐ท (cid:9356) ( ๐ ) . . if and only if: โฉโชโชโจโชโชโง 6 ๐ ๐๐ โฅ 6 ๐ ๐ ๐ข๐ฌ ๐๐ฏ๐๐ง, ๐โ๐ (cid:9356) ๐S๐P๐ (cid:9356) S๐๐E๐, ๐โ๐ (cid:9356) ๐๐ โฅ 6 ๐ ๐ ๐ข๐ฌ ๐จ๐๐. ๐P๐ (cid:9356) ๐S๐ P ๐ (cid:9356) S๐๐E๐, ๐โ๐ (cid:9356)
Proof:
Suppose ๐ฅ and ๐ฆ are two non-neighbor vertices of a tree ๐ with ๐ (๐ฅ, ๐ฆ) > 2 . By lemma 1, ๐ท (cid:9356) : ๐ . . ; = (cid:134)๐น โ ( ๐พ) . . . . ( ๐พ) . . . U (cid:134), (13) and ๐ท (cid:9356) : ๐ ! . ; = (cid:134)๐น โ ( ๐พ) ! . ! . ( ๐พ) ! . . U (cid:134). (14) Note that changing the inset edge from ๐ฅ ๐ฆ to ๐ฅ $ ๐ฆ reduces the length of cycle of respective graphs by 1. And remember that the ๐ญ matrices are different depends on whether ๐ is odd or even. This is very interesting to see that for both even and odd ๐ : (cid:134)๐น โ ( ๐พ) ! . ! . ( ๐พ) ! . . U (cid:134) = (cid:134)(๐น + ๐ ) โ ( ๐พ . . . โ ๐ค . . . . ๐ + ๐ค . . . . ๐ $ ). ( ๐พ) . . . U (cid:134) . The RHS of the above equation is equal to ๐ท (cid:9356) : ๐ ! . ; . Expanding the LHS for odd and even cases separately, we can see that: ๐ท (cid:9356) : ๐ ! . ; โ ๐ท (cid:9356) : ๐ . . ; = โฉโชโชโจโชโชโง 6 ๐ค ;Q โ 6 ๐ค ๐ ๐๐ ๐๐ฃ๐๐, Qโ7 (cid:9356) ;SQP7 (cid:9356)
S1;E1, Qโ7 (cid:9356) ;Q โ 6 ๐ค ๐ ๐๐ ๐๐๐. QP7 (cid:9356) ;SQ P 7 (cid:9356)
S1;E1, Qโ7 (cid:9356)
Therefore ๐ท (cid:9356) : ๐ ! . ; โฅ ๐ท (cid:9356) : ๐ . . ; if and only if: โฉโชโชโจโชโชโง 6 ๐ค ;Q โฅ 6 ๐ค ๐ ๐๐ ๐๐ฃ๐๐, Qโ7 (cid:9356) ;SQP7 (cid:9356)
S1;E1, Qโ7 (cid:9356) ;Q โฅ 6 ๐ค ๐ ๐๐ ๐๐๐. QP7 (cid:9356) ;SQ P 7 (cid:9356)
S1;E1, Qโ7 (cid:9356)
This completes the proof. โ In the next results we present an application of the theorems 3 and 4 to see that we can almost ignore the leaves of a tree ๐ in order to find max ) ๐ท (cid:9356) : ๐ ; . Corollary 2:
Suppose ๐ is a tree on ๐ > 6 vertices and ๐ โ ๐ ! . Then there is a non-leaf vertex ๐ฃ โ ๐(๐) such that ๐ท (cid:9356) ( ๐ ) = max ) ๐ท (cid:9356) : ๐ ; . Proof:
Suppose we are given a ๐ such that ๐๐๐(๐ฅ) = ๐๐๐(๐ฆ) = 1 . This means ๐ค = ๐ค = 1 . If ๐ > 5 then by theorem 3, ๐ท (cid:9356) ( ๐ ) ! ! โฅ ๐ท (cid:9356) ( ๐ ) . . . If ๐ = 4 then by theorem 4, ๐ท (cid:9356) ( ๐ ) ! . โฅ ๐ท (cid:9356) ( ๐ ) . . . If ๐ = 5 and |๐(๐)| > 6 by theorem 4 either ๐ท (cid:9356) ( ๐ ) ! . or ๐ท (cid:9356) ( ๐ ) . ! or ๐ท (cid:9356) ( ๐ ) ) . (๐ท (cid:9356) ( ๐ ) ) . = 1 + ๐ค ! + ๐ค ) ) is greater than ๐ท (cid:9356) ( ๐ ) . . . If ๐ = 3 the problem is clear by the Theorem 2. โ Theorem 5:
Suppose ๐ฃ is a leaf of a tree ๐ . Then for every ๐ง โ ๐(๐) , ๐ (๐ฃ, ๐ง) โโ/{2,3,4,6} , there is ๐ฆ โ ๐(๐) such that ๐ฆ is not a leaf and ๐ท (cid:9356) ( ๐ ) โค
We break the proof to two claims which cover the theorem conditions.
Claim (1): If ๐ฃ is an arbitrary leaf of a tree ๐ , ๐ง โ ๐ฃ , ๐ (๐ฃ, ๐ง) = ๐ โ 1 and ๐ > 4 is an even number then there is a non-leaf ๐ข โ ๐(๐) such that ๐ท (cid:9356) ( ๐ ) โค
By theorem 4สผs proof: ๐ท (cid:9356) ( ๐ ) โ ๐ท (cid:9356) ( ๐ ) = < ! b . ;Q โ 6 ๐ค , Qโ7 (cid:9356) ;SQ P 7 (cid:9356)
S1;E1, Qโ7 (cid:9356) < . b . (15) Since deg(๐ฃ) = 1 so ๐ค
Qโ7 (cid:9356)
Thus using (15-17),
๐ธ๐ท( ๐ ) โค < . b . ๐ธ๐ท( ๐ ) < ! b . . Claim (2): If ๐ฃ is an arbitrary leaf of a tree ๐ , ๐ง โ ๐ฃ , ๐ (๐ฃ, ๐ง) = ๐ โ 1 and ๐ > 7 is an odd number then there is a non-leaf ๐ข โ ๐(๐) such that ๐ท (cid:9356) ( ๐ ) โค
The proof for the odd ๐ (cid:9356)s is tricky and needs a precise comparison. First, we know that by the theorem 4สผs proof: ๐ท (cid:9356) ( ๐ ) โ ๐ท (cid:9356) ( ๐ ) = < ! b . ;Q โ 6 ๐ค (cid:9356) ;SQ P 7 (cid:9356) S1;E1, Qโ7 (cid:9356) < . b . (18) And by the theorem 3สผs proof: ๐ท (cid:9356) ( ๐ ) โ ๐ท (cid:9356) ( ๐ ) = < ! b !
2( 6 ๐ค ;Q ) + 6 ๐ค ;Q โ 2๐ค ;Q , ;SQ^7 (cid:9356) S$WP;SQP7 (cid:9356)
S1;,QE1< . b . (19) According to (18) and (19) respectively if ๐ท (cid:9356) ( ๐ ) โฅ ๐ท (cid:9356) ( ๐ ) < ! b . < . b . , ๐ท (cid:9356) ( ๐ ) โฅ ๐ท (cid:9356) ( ๐ ) < ! b ! < . b . , ๐พ = [1,1, โฆ ,1]
U
๐พ = [๐ ; ] U
It is not hard to take care of the exceptions of theorem 5 by specifying the number of vertices and diameter of the input trees. Our ultimate goal is to apply theorems 3 and 4 through an algorithm to find {๐ท (cid:9356) ( ๐) } ) and max ) ๐ท (cid:9356) : ๐ ; . However, by theorem 5 and corollary 2, using the facts that for a tree ๐ on ๐ vertices |๐ธ(๐ % )| โ ! ! $ and the following result by Renyi: Proposition 1: The expected number of leaves in a random labeled tree on ๐ vertices is ๐/๐ where ๐ is the base of the natural number. โ we can limit our search space from : !$ ; โ |๐ธ(๐)| inset edges to almost j !" $ k inset edges, where we are looking for the min ) ๐ด๐ท: ๐ ; . This means we can prone c dM N โ 1 โ j e"1e k $ โ %60 of edges in average, in sake of min ) ๐ด๐ท: ๐ ; . โฒ The next theorem shows how to apply theorems 3 and 4 through an algorithm. Theorem 6: Suppose ๐ is a tree, ๐ฅ๐ฆ โ ๐(๐ % ) and ๐ (๐ฅ, ๐ฆ) = ๐ โ 1 . If we are given the vectors ๐พ and ๐พ then we can obtain ยฟ๐ท (cid:9356) ( ๐ ) + + (cid:192) (cid:9356) "1 โช ยฟ๐ท (cid:9356) ( ๐ ) +5. + (cid:192) (cid:9356) "1 โช ยฟ๐ท (cid:9356) ( ๐ ) + +5. (cid:192) (cid:9356) "1 , with ๐(๐ $ ) operations. Proof: Suppose for a tree ๐ , ๐ฅ๐ฆ โ ๐ธ(๐ % ) and the related vectors of ๐ , ๐พ and ๐พ , are given. Using Lemma 1: ๐ท (cid:9356) : ๐ ; = (cid:134)๐ญ โ ( ๐พ ร ๐พ )(cid:134), which clearly costs us ๐(๐ $ ) operations to calculate ๐ท (cid:9356) : ๐ ; , ๐พ and (cid:134)๐ถ ๐ โ ๐พ (cid:134) . Now we prove that if we have ๐ท (cid:9356) ( ๐ ) + + and ๐พ then we can obtain ๐ท (cid:9356) ( ๐ ) +9. +9. by at most ๐(๐) operations. Without loss of generality suppose we are given ๐ท (cid:9356) ( ๐ ) . . then by theorem 3 if ๐ is even, ๐ท (cid:9356) : ๐ ! ! ; โ ๐ท (cid:9356) : ๐ . . ; = 6 ๐ค ;Q โ ๐ค , WP;SQP7 (cid:9356) S1;,QE1 (22) Since we already have (cid:134)๐ถ โ ๐พ (cid:134) , this is enough to subtract the first row and column of ๐พ from it to obtain ๐ท (cid:9356) : ๐ ! ! ; . This means, ;Q โ ๐ค (cid:9356) S1;,QE1 = (cid:134)๐ถ โ ๐พ (cid:134) โ ๐ค 565 1 ยด 6 ๐ค 566 ;1P;P7 (cid:9356) ห โ ๐ค 566 1 ยด 6 ๐ค 565 ;1P;P7 (cid:9356) ห (23) Using (22, 23) we can obtain ๐ท (cid:9356) : ๐ ! ! ; from the given data, with ๐(๐) operations as well as calculating (cid:134)๐ถ โ ๐พ ! ! (cid:134) and ๐พ ! ! . Correspondingly, we can obtain ๐ท (cid:9356) : ๐ ; with ๐(๐) operations. Therefore, we obtained ยฟ๐ท (cid:9356) ( ๐ ) + + (cid:192) (cid:9356) "1 in ๐(๐ $ ) . A similar argument applies for odd ๐ สผs. Similarly, using Theorems 4 we can reach to ยฟ๐ท (cid:9356) ( ๐ ) +5. + (cid:192) (cid:9356) "1 and ยฟ๐ท (cid:9356) ( ๐ ) + +5. (cid:192) (cid:9356) "1 in ๐(๐ $ ) . This completes the proof. โ Remark 4: The average diameter of a tree ๐ on ๐ vertices is ๐๐๐ (๐) [8]. On the other hand, by theorem 6 we can reach to ยฟ๐ท (cid:9356) ( ๐ ) + + (cid:192) (cid:9356) "1 in ๐(๐ $ ) . Thus, in average, we could obtain each ๐ท (cid:9356) ( ๐ ) + + , 1 โค ๐ โค ๐ (cid:9356) โ 1, in ๐(๐) , subject to the given condition. Since ๐ < ๐๐๐๐(๐) + 1 and the number of inset edges is ๐(๐ $ ) we have the following question: Question 1: Suppose ๐ is a tree on ๐ vertices. Is it possible to obtain ยฟ๐ด๐ท( ๐) (cid:192) ) with the average time complexity of ๐(๐ $ log(๐)) ? References: [1] F. Chung, L. Lu, The Average Distances in Random Graphs with Given Expected Degrees, Proceedings of the National Academy of Sciences, 99, (2002), 15879- 15882. [2] A. Clauset, C. Moore, M.E.J. Newman, Hierarchical Structure and the Prediction of Missing Links in Networks, Nature, 453, (2008), 98-101. [3] J. Copic, M.O. Jackson, A. Kirman, Identifying Community Structures from Network Data via Maximum Likelihood Methods, The B.E. Journal of Theoretical Economics, 9, (2005), 09-27. [4] S. Currarini, M.O. Jackson, P. Pin, An Economic Model of Friendship: Homophily, Minorities and Segregation, Econometrica, 77, (2009), 1003- 1045. [5] A. Drger, M. Kronfeld, M.J. Ziller, J, Supper, H. Planatscher, J.B. Magnus, M. Oldiges, O. Kohlbacher, A. Zell, Modeling metabolic net- works in C. glutamicum: a comparison of rate laws in combination with various parameter optimization strategiesโ. BMC Systems Biology. doi:10.1186/1752-0509-3-5. [6] Y. Matsuo, Y. Ohsawa, M. Ishizuka, Average-Clicks: A New Measure of Distance on the World Wide Web, Journal of Intelligent Information Systems, 20, (2003), 20- 51.[1] F. Chung, L. Lu, The Average Distances in Random Graphs with Given Expected Degrees, Proceedings of the National Academy of Sciences, 99, (2002), 15879- 15882. [2] A. Clauset, C. Moore, M.E.J. Newman, Hierarchical Structure and the Prediction of Missing Links in Networks, Nature, 453, (2008), 98-101. [3] J. Copic, M.O. Jackson, A. Kirman, Identifying Community Structures from Network Data via Maximum Likelihood Methods, The B.E. Journal of Theoretical Economics, 9, (2005), 09-27. [4] S. Currarini, M.O. Jackson, P. Pin, An Economic Model of Friendship: Homophily, Minorities and Segregation, Econometrica, 77, (2009), 1003- 1045. [5] A. Drger, M. Kronfeld, M.J. Ziller, J, Supper, H. Planatscher, J.B. Magnus, M. Oldiges, O. Kohlbacher, A. Zell, Modeling metabolic net- works in C. glutamicum: a comparison of rate laws in combination with various parameter optimization strategiesโ. BMC Systems Biology. doi:10.1186/1752-0509-3-5. [6] Y. Matsuo, Y. Ohsawa, M. Ishizuka, Average-Clicks: A New Measure of Distance on the World Wide Web, Journal of Intelligent Information Systems, 20, (2003), 20- 51.