The structure of graphs with given number of blocks and the maximum Wiener index
St\'ephane Bessy, Fran\c{c}ois Dross, Katar\'ina Hri\v{n}\'akov\'a,, Martin Knor, Riste \v{S}krekovski

TL;DR
This paper determines the maximum Wiener index for connected graphs with a fixed number of blocks, showing that it is achieved by a specific structure involving two cycles connected by a path.
Contribution
It characterizes the structure of graphs with a given number of blocks that maximize the Wiener index, extending known results for special cases.
Findings
Maximum Wiener index for p=1 is achieved by an n-cycle.
Maximum Wiener index for p=n-1 is achieved by an n-path.
For 2 ≤ p ≤ n-2, the maximum is achieved by two cycles joined by a path.
Abstract
The Wiener index (the distance) of a connected graph is the sum of distances between all pairs of vertices. In this paper, we study the maximum possible value of this invariant among graphs on vertices with fixed number of blocks . It is known that among graphs on vertices that have just one block, the -cycle has the largest Wiener index. And the -path, which has blocks, has the maximum Wiener index in the class of graphs on vertices. We show that among all graphs on vertices which have blocks, the maximum Wiener index is attained by a graph composed of two cycles joined by a path (here we admit that one or both cycles can be replaced by a single edge, as in the case for example).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
The structure of graphs with given number of blocks and the maximum Wiener index
Stéphane Bessy111Laboratoire d’Informatique, de Robotique et de Microélectronique de Montpellier (LIRMM), Université de Montpellier, France, [email protected]., François Dross222Laboratoire d’Informatique, de Robotique et de Microélectronique de Montpellier (LIRMM), Université de Montpellier, France, [email protected]., Katarína Hriňáková333Department of Mathematics, Faculty of Civil Engineering, Slovak University of Technology in Bratislava, Radlinského 11, 810 05, Bratislava, Slovakia, [email protected].,
Martin Knor444Department of Mathematics, Faculty of Civil Engineering, Slovak University of Technology in Bratislava, Radlinského 11, 810 05, Bratislava, Slovakia, [email protected]., Riste Škrekovski555Faculty of Information Studies, 8000 Novo Mesto & Faculty of Mathematics and Physics, University of Ljubljana, 1000 Ljubljana & FAMNIT, University of Primorska, 6000 Koper, Slovenia, [email protected].
Abstract
The Wiener index (the distance) of a connected graph is the sum of distances between all pairs of vertices. In this paper, we study the maximum possible value of this invariant among graphs on vertices with fixed number of blocks . It is known that among graphs on vertices that have just one block, the -cycle has the largest Wiener index. And the -path, which has blocks, has the maximum Wiener index in the class of graphs on vertices. We show that among all graphs on vertices which have blocks, the maximum Wiener index is attained by a graph composed of two cycles joined by a path (here we admit that one or both cycles can be replaced by a single edge, as in the case for example).
1 Introduction
Let be a simple graph. By and we denote the vertex set and the edge set of , respectively. Let and be two vertices of . The length of a shortest path is denoted by , or simply by if no confusion is likely. The Wiener index is defined as the sum of the distances between all (unordered) pairs of vertices of ,
[TABLE]
The transmission of a vertex is the sum of the distances from to other vertices of , i.e., . Then the Wiener index of equals .
The Wiener index was introduced by Wiener [12] in 1947, thus it is one of the oldest topological descriptors. At first it was used for predicting the boiling points of paraffins, later some other applications of the Wiener index were revealed. Many years later it was studied also from a purely graph-theoretical point of view. But mathematicians studied the Wiener index under different names, such as the gross status [4], the distance of a graph [3] and the transmission [10]. More details can be found in some of the many surveys, see e.g. [2, 5, 6, 11].
If is a connected graph and is a cut-vertex that partitions into subgraphs and , i.e., and , then we write , or simply . By , and we denote a cycle, path and a complete graph, respectively, on vertices. We will abuse this notation by writing . Then our main result is the following statement.
Theorem 1.1**.**
Let and be numbers such that . Among all graphs on vertices with blocks, the maximum Wiener index is attained by the graph for some integers and , where , and and are distinct endvertices of .
Note that or can also be , i.e. an edge, and then we obtain , which is a graph composed of one cycle with an attached path. In the case when , both and are edges, i.e. .
The proof of Theorem 1.1 is rather technical. Therefore, the exact values of and will be determined in a forthcoming paper [1]. Let be the maximum Wiener index of a graph which has vertices and blocks. In [1] we study and we determine its minimum values.
Now, we introduce notations and definitions which we use throughout the paper. If are graphs, we denote by , respectively, their numbers of vertices. For , by we denote the eccentricity of in , i.e., the maximal distance from in .
A graph is nonseparable if it is connected and has no cut-vertices (i.e. either it is -connected or it is ). A block of is a maximal non-separable subgraph of . Two blocks sharing a common vertex are said to be adjacent. We refer to [8] concerning the structure of blocks in a connected graph. In particular, it is known that the bipartite graph built on the set of blocks of and the set of cut-vertices of by linking a block to the cut-vertices it contains, is a tree. This tree is called the blocks-tree of .
Let be a subgraph of , such that is a connected union of several (at least one) blocks of . An attachment vertex of is a vertex of which has a neighbour in . The subgraph is terminal if contains exactly one attachment vertex. It is traversal if it contains exactly two attachment vertices.
Let be a connected graph on vertices. The distance vector of a vertex is the -dimensional vector given by . If is a vector, then is the value . Observe that .
Now we define . If is even, the vector has dimension and contains the value in each coordinate except for the last one which is 1. If is odd, has dimension and each of its coordinates has value 2. For example and . Observe that the vectors and are the same for every vertex of the cycle . Hence we obtain if is even and if is odd. Also observe that if is a -connected graph, then the distance vector of every vertex of satisfies for every , and so . Moreover, if is different from a cycle then it has a vertex , such that , which means that . So we get the following classical result.
Proposition 1.2**.**
Let be a -connected graph on vertices and let . Then
[TABLE]
Moreover, if is then equality holds for every vertex . Further, the cycle is the unique graph which has the maximal Wiener index over the class of 2-connected graphs on vertices, and
[TABLE]
We use also the following obvious statement.
Proposition 1.3**.**
Let be an endvertex of . Then
[TABLE]
2 Proof of Theorem 1.1
In this section we prove Theorem 1.1 using a couple of auxiliary results. The first two propositions will be useful to calculate Wiener index of a graph composed of two or more subgraphs joined by cut-vertices. The proofs are straightforward, so we omit them. Recall that the number of vertices of is denoted by .
Proposition 2.1**.**
Let . We have
[TABLE]
Observe that the subgraphs and in the previous proposition do not need to be blocks. In fact, each of these graphs is either a block or a connected union of blocks of . Using an inductive argument we can get the following generalization of Proposition 2.1
Proposition 2.2**.**
Let be blocks or connected unions of blocks of , such that is an edge decomposition of . Denote by the attachment vertex of which separates from . Then
[TABLE]
Observe that the last term in the second sum of Proposition 2.2 is [math] if and are adjacent blocks. We remark that Proposition 2.2 holds even in the case when some of the are “trivial”, i.e., if they consist of a single vertex, since then all the terms containing , , or are zeros.
Now we show that terminal blocks are cycles or edges in extremal graphs.
Lemma 2.3**.**
Let be a terminal block of such that is not a cycle and . Let be the graph obtained from by replacing by a cycle on vertices. Then .
Proof.
Denote by the attachment vertex of in . Further, denote by the block and denote by the subgraph of such that . By Proposition 2.1 we have (recall that )
[TABLE]
and so
[TABLE]
Since is not a cycle, we have by Proposition 1.2. Moreover, by Proposition 1.2 we have also . Hence we obtain . ∎
In a cycle , two vertices and are opposite (or antipodal) if they satisfy .
Lemma 2.4**.**
Let be a traversal block of with , and let and be the two attachment vertices of . Let be a cycle in which and are opposite and let be obtained from by replacing by . If is not a cycle or if is a cycle and and are not opposite in , then .
Proof.
Denote by and the subgraphs of attached to at and , respectively, such that . By Proposition 2.2 we have
[TABLE]
By Proposition 1.2 we have and equality holds if and only if is a cycle. By Proposition 1.2 we have also and . Finally, since every vertex in a -connected graph satisfies e_{H}(v)\leq\big{\lfloor}\frac{|V(H)|}{2}\big{\rfloor} (recall that for every we have ), we have . Hence, all the terms on the right hand side of the equality for are nonnegative and they are all zeros if and only if and . ∎
Next lemma gives a condition for extremal graphs.
Lemma 2.5**.**
Let be a graph with at least blocks and let and be two terminal cycles of with attachment vertices and , respectively. Let be a vertex opposite to in for . Denote by (resp. ) a graph obtained from by removing the block (resp. ) and attaching it to (resp. ). Suppose that and . Then .
Proof.
Let be the graph obtained from by removing the cycles and , such that . Observe that does not need to be a single block, but it is a connected union of blocks. Anyway, , and . By Proposition 2.2 we have
[TABLE]
where . Since and , we get
[TABLE]
Analogously, from we get
[TABLE]
and summing the last two inequalities we obtain
[TABLE]
Now since and are opposite in for , we have
[TABLE]
Thus we obtain and consequently
[TABLE]
since . ∎
Let . Take paths of length (i.e. on vertices), on each path choose one endvertex, and identify these endvertices. We denote by the resulting graph. Observe that has vertices and is homeomorphic to the star . In [7, Theorem 3] we have the following statement.
Theorem 2.6**.**
Let be a connected graph on vertices. Then for every -tuple of its vertices, , there are two, say and where , such that
[TABLE]
Moreover, if
[TABLE]
then , the graph is and are the endvertices of .
Using Theorem 2.6 and Lemma 2.5 we prove the following statement.
Lemma 2.7**.**
Let . Let be a graph on vertices with blocks which has the maximum Wiener index. Then has at most three terminal blocks.
Proof.
By way of contradiction, suppose that has at least four terminal blocks, say , , and . By Lemma 2.3 we know that each of these blocks is either a cycle or . Let be the unique attachment vertex of and let be a vertex opposite to in , . Denote
[TABLE]
and assume that this minimum is attained by the pair . By Theorem 2.6 we know that . We distinguish two cases.
Case 1: . Denote and . Now construct and by reattaching of and as in Lemma 2.5. Since , either or . Since all , and have vertices and blocks, we get a contradiction.
Case 2: . By Theorem 2.6, in this case is , and so . It is well-known that among trees on vertices, is the unique graph with the maximum Wiener index. So , a contradiction. ∎
Now we prove some results useful for sequences of traversal blocks. The following theorem was proved in [9].
Theorem 2.8**.**
For every , the graph has the maximal Wiener index among the graphs from the family . Moreover for and , it holds and .
We extend Lemma 2.8 to blocks of size . (Recall that we denote the complete graph on vertices by .)
Lemma 2.9**.**
For every , among the graphs on vertices with exactly two blocks, the maximal Wiener index is attained by .
Proof.
For the graph is the unique graph with two blocks, thus it has the largest Wiener index. For , , it is enough to show that , by Theorem 2.8.
Using Proposition 2.1 we get the Wiener index of .
[TABLE]
In we can also use Proposition 2.1 to evaluate the Wiener index.
[TABLE]
Hence, using Proposition 1.2 we get
[TABLE]
Since , in both cases we get .
By Theorem 2.8, for and it suffices to show that . Direct computation gives , , and , which completes the proof. ∎
Using Lemma 2.9 we prove the following statement. Here we allow the smaller end-block to be just a single vertex, i.e. , see below.
Lemma 2.10**.**
Let , where and are cycles, and are antipodal in , and and are antipodal in . Let , and . Then has maximal Wiener index if and only if
* and , or* 2. 2.
, and .
Proof.
Let , where is antipodal to in and is antipodal to (i.e., different from) in (). Denote and . By Proposition 2.2 we have
[TABLE]
By Lemma 2.9 we have and equality holds if and only if (i.e., if or if ). Further, , and so the last term is nonnegative as well. Let
[TABLE]
We show that .
If is even, we have , and , where these vectors both have dimension . If is odd, we get , and , where both these vectors have dimension . To compute , and we distinguish four cases according to the parity of and .
Case 1: Both and are even. Then is odd and , where is a vector of dimension , such that the -th coordinate is , i.e., , and , where is also a vector of dimension . So
[TABLE]
This is nonnegative since and . Moreover, if and only if and .
Case 2: * is even and is odd.* Then is even and , where is a vector of dimension , and , where is also a vector of dimension , in which . So
[TABLE]
This is nonnegative since . Moreover, if and only if , since .
Case 3: * is odd and is even.* Then is even and , where is a vector of dimension , such that and , where is also a vector of dimension , in which . Since , we have
[TABLE]
This is nonnegative since and . Moreover if and only if or .
Case 4: Both and are odd. Then is odd and , where both these vectors are of dimension . So
[TABLE]
Now combining these cases with Lemma 2.9, which states that and the equality holds if and only if (see Case 3), yields the result. ∎
In the following lemma we consider chains of traversal blocks.
Lemma 2.11**.**
Let . Let be a graph on vertices with blocks which has the maximum Wiener index. Moreover, suppose that , where , all are blocks and is a connected union of blocks. Then . Moreover, if is a terminal block or if , then as well.
Proof.
Since is a terminal block and are traversal, each of these blocks is either a cycle or , by Lemmas 2.3 and 2.4. Moreover, by Lemma 2.4 we know that the attachment vertices and are opposite on , .
Suppose that among there is a cycle on at least vertices, say . By Lemma 2.10 both and must be isomorphic to . Denote and . We distinguish two cases.
Case 1: . Denote , , and . (Observe that if then is trivial consisting of a single vertex.) Then . Hence, by Lemma 2.10 we have , a contradiction.
Case 2: . Denote , , and . Then . Hence, by Lemma 2.10 we have , a contradiction.
Now we consider . If , then denote , , and . (Observe that if then is trivial.) Since , by Lemma 2.10 we have .
If is a terminal block and , then relabelling the blocks (reversing their order) we can prove that .
Finally, if is a terminal block, and , then let be trivial, , and . Then , and so by Lemma 2.10. ∎
By we denote a graph consisting of two vertices, which are connected by three internally vertex-disjoint paths of lengths , and . Observe that has vertices. In [7, Lemma 5] we have the following statement.
Theorem 2.12**.**
Let be a -connected graph on vertices, having three vertices , and such that
[TABLE]
is maximum possible. Then and the equality is attained only if is , where all , and are even.
Observe that if is even then by Theorem 2.12. Using this statement we prove the following lemma.
Lemma 2.13**.**
Let . Let be a graph on vertices with blocks which has the maximum Wiener index. Then has exactly two terminal blocks.
Proof.
By Lemma 2.7, has at most three terminal blocks. By way of contradiction, suppose that has exactly three terminal blocks. Then its blocks-tree has one vertex of degree , three vertices of degree corresponding to terminal blocks, and all the remaining vertices have degree . The vertex of degree corresponds either to a block or to a cut-vertex. To simplify the reasoning, in the latter case we consider the cut-vertex as a trivial block.
Hence, consists of a block with three vertices , and in which there are attached connected unions of blocks , and , respectively (obviously, the vertices , and are not necessarily disjoint). We assume that . By Lemma 2.11, since for , we have , where is one endvertex of the path and is another one, and . Observe that may consist of two cycles connected by a path, but we do not need to consider the structure of . The structure of is visualized on Figure 1.
Now we construct on vertices with blocks, so that will have just two terminal blocks and . First, if , then let be a cycle on vertices in which is opposite to . If , then is a cut vertex since the case is impossible. So set and if . Let and be the two endvertices of . Then , see Figure 1. Observe that the graphs and have the same number of blocks and they have also the same number of vertices.
Since is simpler than , we calculate exactly. However, for we use just an upper bound . Below we show that . Since , this implies that also .
By Proposition 1.3, if is an endvertex of a path of length . But if is a vertex of then if is even and if is odd, see Proposition 1.2. Therefore, we distinguish two cases according to the parity of . If is odd, then exactly one of and is odd as well. Since we do not use the inequality in the proof, without loss of generality we may assume that is even and is odd in this case. If is even, then either both and are even or both are odd. However, since it suffices to find an upper bound on such that , we use the upper bounds and for and , respectively, in this case.
Now we bound using Proposition 2.2. The graph is composed of six parts , , , , and , see Figure 1. Therefore we have 6 terms in the first sum of (1), terms due to the first two products in the second sum of (1) and terms due to the third product in the second sum of (1). This yields 46 terms due to . The graph is composed of four parts , , and , see Figure 1. Therefore we have 19 terms due to in (1). Since there are too many terms, we divide them into several groups and we show that the sum of terms in each group is nonnegative.
1. First consider the terms containing . These terms occur in the first two products of the second sum of (1). In these terms are , , , and . Observe that they sum to . Since in the three terms , and containing sum again to , these terms contribute [math] to .
2. Now consider the terms containing , , , , and . Since , in these terms sum to . By Proposition 1.2, we have , . Hence, the upper bound for the contribution of considered terms to is also . Consequently, these terms contribute at least [math] to .
3. Now consider the terms containing which were not considered in the groups 1. and 2. above, together with the terms containing distances in and . We start with the case when is even.
First consider the terms containing . Their contribution to is at least (the fractions correspond to ’s, while the non-fractions correspond to the last term in (1)).
[TABLE]
Since , , , and , the expression (2) is nonnegative.
Now consider the terms containing distances in and . In these terms sum to , and . By Theorem 2.12 we have . Since and , we obtain the biggest contribution if and are maximum possible, namely . Then . Hence, the contribution of these terms to is at most
[TABLE]
while the contribution of the terms containing to is
[TABLE]
Consequently, the contribution of these terms to is at least
[TABLE]
Our aim is to show that the sum of the right-hand sides of (2) and (3) is nonnegative. We consider five cases.
Case 1: . Since the expression in brackets containing , , and in (2) is nonnegative, it suffices to show nonnegativity of the sum of (2) and (3) for . Since this sum is
[TABLE]
the contribution of selected terms is nonnegative in this case.
Case 2: . In this case the considered distances in and are [math] as well as . Hence, the contribution of selected terms is [math] in this case.
Case 3: . This case is impossible, since if then the vertex of degree in the blocks-tree is a cut-vertex.
Case 4: . In this case we have , , and also . Hence, the contribution of the terms based on distances is
[TABLE]
and the total contribution of considered terms is
[TABLE]
Case 5: . By Theorem 2.12 we have . In this case, the sum of the terms containing distances in and is non-negative. So the considered terms contribute to by at least
[TABLE]
Summing up, the contribution of considered terms to is at least [math] if is even. If is odd, the only changes consist in replacing and by and , respectively. Hence, we obtain exactly the same expressions as in the even case.
4. Now we consider the terms containing , which were not considered before. Again, we start with the case when is even. The contribution of the terms containing is at least (compare with (2))
[TABLE]
Since the expression in brackets containing , , and is nonnegative, we can replace by a value which is not larger than and we will not increase the contribution of considered terms. Since , , we get . Hence, the contribution of considered terms is at least
[TABLE]
if is even. If is odd, we obtain the very same expression.
5. Finally, we consider the remaining terms, i.e., the terms which were not considered in the groups 1.-4. above. Then we include the terms from (4) and we show that their sum is positive. Again, we start with the case when is even.
Since , the terms from the first sum of Proposition 2.2 contribute to by at least
[TABLE]
The terms from the second sum of (1) contribute to by at least
[TABLE]
And summing (4), (5) and (6) we get
[TABLE]
which is positive since all the terms are nonnegative while the last two are at least each.
Now consider the case when is odd. Then (4) is without a change, (5) is increased by and (6) is increased by . So the sum of considered terms is exactly as in (7) plus a nonnegative term .
Since all the groups of terms are nonnegative and the last one is positive, the lemma is proved. ∎
Now combining Lemmas 2.11 and 2.13 we obtain Theorem 1.1.
Acknowledgements. The third and fourth authors acknowledge partial support by Slovak research grants APVV-15-0220, APVV-17-0428, VEGA 1/0142/17 and VEGA 1/0238/19. The research was partially supported by Slovenian research agency ARRS, program no. P1-0383. The fifth author acknowledges partial support by National Scholarschip Programme of the Slovak Republic SAIA.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] S. Bessy, F. Dross, K. Hriňáková, M. Knor, R. Škrekovski, Maximal Wiener index for graphs with prescribed number of block , manuscript. 2019.
- 2[2] A. A. Dobrynin, R. Entringer and I. Gutman, Wiener index of trees: Theory and applications, Acta Appl. Math. 66 (3) (2001), 211–249.
- 3[3] R. C. Entringer, D. E. Jackson, D. A. Snyder, Distance in graphs, Czechoslovak Math. J. 26 (1976), 283–296.
- 4[4] F. Harary, Status and contrastatus, Sociometry 22 (1959), 23–43.
- 5[5] M. Knor, R. Škrekovski, Wiener index of line graphs in M. Dehmer and F. Emmert-Streib (Eds.), Quantitative Graph Theory: Mathematical Foundations and Applications , CRC Press (2014), 279–301.
- 6[6] M. Knor, R. Škrekovski, A. Tepeh, Mathematical aspects of Wiener index, Ars Math. Contemp. 11 (2016) 327–352.
- 7[7] M. Knor, R. Škrekovski, On the minimum distance in a k 𝑘 k -set in a graph, submitted .
- 8[8] J. A. Bondy and U.S.R. Murty, Graph Theory, 2nd edition, Springer Verlag London 2008.
