On the relationship between variable Wiener index and variable Szeged index

We resolve two conjectures of Hri\v{n}\'{a}kov\'{a}, Knor and \v{S}krekovski (2019) concerning the relationship between the variable Wiener index and variable Szeged index for a connected, non-complete graph, one of which would imply the other. The strong conjecture is that for any such graph there is a critical exponent in $(0,1]$, below which the variable Wiener index is larger and above which the variable Szeged index is larger. The weak conjecture is that the variable Szeged index is always larger for any exponent exceeding $1$. They proved the weak conjecture for bipartite graphs, and the strong conjecture for trees. In this note we disprove the strong conjecture, although we show that it is true for almost all graphs, and for bipartite and block graphs. We also show that the weak conjecture holds for all graphs by proving a majorization relationship.


Introduction
Topological indices of graphs originate from chemical graph theory, and are descriptors of organic molecules that depend only on the graph of atoms and bonds and not on their physical arrangement. The oldest and most important of these is the Wiener index, or total distance, which was introduced by Wiener in 1947 and shown to accurately predict alkane boiling points [21]. Here, as is usual, the index is applied to the unweighted graph of carbon-carbon bonds, neglecting hydrogen atoms. Wiener subsequently established correlations between the Wiener index and other physical quantities (see e.g. [22]). The Wiener index was rediscovered by Rouvaray [19] in the 1970s, and applied to more general chemical graphs. It was independently introduced to the mathematics literature for trees by Zelinka [23], and subsequently extended to general graphs by Entringer, Jackson and Snyder [4]. Since the late 1970s, it has seen an explosion of interest in both fields; see e.g. the survey article [2] from the mathematical side, and the collection [6] from the chemical side. Its importance has led to the study of many other topological indices, such as the Randić index [18], first and second Zagreb indices [8,7], and the Hosoya index [9].
Among topological indices, the Wiener index has a particularly simple and natural definition: it is the sum, over all unordered pairs of vertices, of the graph distance between those vertices (hence the alternative name of "total distance"; it is linearly related to the average distance when the order is fixed). We define the Wiener index only when the graph is connected, so all distances are finite; this is certainly the case for molecular graphs.
As a special case of the alternative method to compute W (G) by use of a canonical metric representation of a graph, as defined in [12], it is well known that for a tree T one can compute the total distance as a sum of a certain quantity over the edges instead of the sum of distances over all pairs of vertices. For each edge e = uv, write n u (v) for the number of vertices strictly closer to u than to v (including u itself), and n v (u) for the number strictly closer to v than to u. Then This fact, which follows from a simple double-counting, was observed by Wiener in his original paper [21], where only trees were considered. However, (1) fails to hold for most other graphs, owing to the fact that shortest paths are typically not unique. For a general graph G, the right-hand side of (1) denotes a different topological index, introduced by Gutman [5] and subsequently called the Szeged index: In general it is not necessarily true that Sz(G) = W (G), but the inequality Sz(G) ≥ W (G) holds for all connected graphs [13]. The graphs where equality occurs were classified by Dobrynin and Gutman [3]; these are precisely the block graphs (also known as clique trees), that is, graphs where every maximal biconnected subgraph is complete. The difference between the Szeged and Wiener indices can take any non-negative integer value other than 1 or 3 [16].
The study of topological indices encompasses variable forms, which depend not only on the graph G but on a parameter often denoted α; the terms which make up the index in question are raised to the power α before summing. This allows the sensitivity of the topological index to extreme values to be altered. For example, the variable form of the Randić index was introduced in [1], and the variable Zagreb indices in [15].
Hriňáková, Knor andŠkrekovski [10] generalized the Wiener and Szeged indices to analogous variable forms, and studied the relation between the variable Wiener index and variable Szeged index. For a parameter α, these two graph parameters are defined as respectively They gave the following two conjectures (in these conjectures, and the rest of this paper, graphs are tacitly assumed to be connected).  Note that Conjecture 1.1, since it requires α G ≤ 1, implies Conjecture 1.2. Complete graphs are excluded from the conjectures since if G is complete we have Sz α (G) = |G| 2 = W α (G) for every α.
If we consider (d(u, v)) u,v∈V (G) and (n u (v) · n v (u)) uv∈E(G) as two sequences (of positive integers) (x i ) i and (y i ) i derived from a graph, then we are comparing the sums f (x i ) and f (y i ) where f (x) = x α . A famous inequality related to such sums is Karamata's inequality [11], which is a generalization of the better known inequality of Jensen. Hriňáková et al. [10] used Karamata's inequality to derive inequalities between Sz α (G) and W α (G) for trees and bipartite graphs (when α > 1), proving that the strong conjecture holds for trees and the weak conjecture for bipartite graphs.
In Section 2, we prove that the weak conjecture is indeed true by a small adaptation of Karamata's inequality combined with a majorization result. In Section 4 we describe a family of counterexamples to the strong conjecture. However, we are able to prove the strong conjecture for some special families of graphs in Section 3. In particular we show that it is true for bipartite graphs, block graphs, and all graphs in a moderately sparse regime. We show that it is true for almost all graphs in a very strong sense: we prove that it is true with high probability for the random graph G(n, m) (that is, a uniformly random choice from the set of all connected graphs with n vertices and m = m(n) edges), even if m is chosen adversarially.
Since this work was submitted, a different and independent proof of the weak conjecture by Vukićević and Bulatović has appeared [20].
2 Proof of the weak conjecture

An adaptation of Karamata's inequality
Karamata's inequality generalises Jensen's inequality for convex functions to majorizing sequences. In this article, we will find it convenient to define the notion of majorizing sequences in a slightly more general way, in the sense that the sequences do not need to have the same length or sum. Throughout the whole article, a sequence will always be ordered (from largest to smallest). Definition 2.1 (majorizing sequences). Let (x i ) 1≤i≤n and (y i ) 1≤i≤m be two sequences. Then the sequence (x i ) i majorizes (y i ) i if for every positive integer k it is true that 1≤i≤k x i ≥ 1≤i≤k y i . In this summation x i and y j are taken to be zero if i > n or j > m.
With this definition in place, Karamata's inequality is as follows.
Furthermore, provided f is strictly convex, we have equality only if the two sequences are identical.
The inequality under condition (i) is Karamata's original formulation [11]; the sufficiency of the alternative condition (ii) is well known and may be proved in the same way (see, for example, [17,Theorem 12.7]).
As a corollary, we obtain the following modified version for integer sequences.
Corollary 2.3. Let x = (x i ) 1≤i≤n and y = (y i ) 1≤i≤m be two sequences of nonnegative integers such that the former majorizes the latter and let t = i x i − i y i . Let f be a function satisfying If the two sequences are not equal (which is certainly the case when t > 0) and f is strictly convex, the inequality is strict as well.
Proof. We can extend the sequence y i with t values equal to 1 in the right spot (i.e. such that the sequence is still ordered) and add zeros to one of the two sequences to produce sequences x ′ , y ′ of the same length. Suppose that y k is the last positive term of y, so that the t extra terms become y ′ k+1 , . . . , y ′ k+t . Note that

A majorization relationship
As the reader may expect, the crucial fact we will need is the following majorization between the two sequences derived from the graph. We will write m = |E(G)| and N = |G| 2 for the natural lengths of the two sequences; we will frequently find it convenient to extend (n e ) e∈E(G) to a sequence of length N by adding zero terms.
Proof. For every edge uv, let n uv = n u (v) · n v (u). Let (n i ) 1≤i≤m (where m = |E(G)|) be the ordered sequence (from largest to smallest) of (n e ) e and let (d i ) i be the ordered sequence of the distances (d(u, v)) u,v∈V . The following claim essentially gives the intuition behind the majorization of the sequences, the property that the n i are larger than d i in some structured way. Proof. Note that there are d(x, y) + 1 vertices on a shortest path from x and y, all of them belonging to N u (v) or N v (u). Hence d(x, y) + 1 ≤ n u (e) + n v (e), from which d(x, y) ≤ n u (v) · n v (u) = n e follows. ♦ This implies that d(x, y) = e∈P λ e n e , where P is a shortest path (containing d(x, y) edges by definition) between x and y and λ e = 1 ne ≤ 1 d(x,y) (by Claim 2.5), so e∈P λ e ≤ 1. As a consequence, we have where P i is the chosen shortest path corresponding to the distance d i . Here every Λ e equals the number of shortest paths P i through e (so at most n e ) times λ e , which is bounded by 1. Also we know e∈E Λ e = k i=1 e∈P i λ e ≤ k. This implies e∈E Λ e n e ≤ k i=1 n i .
As a consequence, we note that Conjecture 1.1 is true in a slightly stronger form.
Theorem 2.6. For every α > 1 and graph G which is not a complete graph, one has x α satisfies f (0) = 0 and f (1) = 1 and is a positive, strictly convex increasing function for x ≥ 0 and α > 1, by applying Corollary 2.3 we have Sz α (G) > W α (G) + t.

Graphs which satisfy the strong conjecture
In Section 2, we noted that Conjecture 1.2 was essentially an inequality for majorizing sequences instead of an inequality on graphs, once one observes Proposition 2.4 is true. This cannot be the case for Conjecture 1.1. One can take the sequences x = {625, 81, 81, 16} and compare with y = {256, 256, 256, 1}, the first one majorizing the second, but x α i = y α i being true for 0, 1 4 and a number close to 0.88. Fix a connected, non-complete graph G with n vertices and let h(α) = Sz α (G) − W α (G). Since h(α) is a continuous function with h(0) < 0 and h(1) ≥ 0, by the intermediate value theorem there is at least one value of α for which h(α) = 0 (and at least one such value lies in (0, 1]); the strong conjecture is therefore equivalent to α being unique. We therefore give a sufficient condition, in terms of majorization, for this to be the case.
where we extend the former sum with zero terms to give sequences of equal length. For c > 1 the function f (x) = x c is strictly convex, while for c < 1 it is strictly concave. By Theorem 2.2 (i), in both cases (2) would not be true, so this implies c = 1 and hence α = β.
Together with Proposition 2.4, this immediately gives the following.

Corollary 3.2.
If G is a non-complete block graph then G satisfies Conjecture 1.1 with α G = 1.
As further examples for the the applicability, let us note that either of the following conditions on G is sufficient (but not necessary) to conclude that (n α To see that II is sufficient, note that it implies that (log n i ) 1≤i≤m majorizes (log d i ) 1≤i≤m , and hence (since f (x) = exp(αx) is increasing and convex) that (n α i ) 1≤i≤m majorizes (d α i ) 1≤i≤m . Since we also have for each k > m, we have the required majorization property.
For graphs satisfying I, much more is true.

Theorem 3.3. If G satisfies condition I above, then for every value of
This implies the strong conjecture holds for G, since there is some smallest positive value α G ≤ 1 for which h(α G ) = 0 > h(0), and thereafter the function is strictly increasing so strictly positive. Note that Theorem 3.3 is best possible, in the sense that we may have h ′ (0) < 0 (and hence h ′ (ǫ) < 0 with h(ǫ) arbitrarily close to h(0)). For example, this is the case for stars with at least 8 vertices.
Proof. Setñ i to be 1 if n i = 0 and n i otherwise. Since d i ≥ 1 for each index i, condition I still applies with n i replaced byñ i , and ensures that i≤k (ñ α i − d α i ), considered as a function of k for any fixed α > 0, is increasing for k ≤ j and decreasing thereafter.
where f (x) = x log x for x ≥ 1. Since this is a strictly convex, increasing function, and the two sequences are distinct (the fact that iñ i > i d i implies there is some i withñ i > d i ), In particular this implies the strong conjecture holds for several classes of graphs.
Proof. If G is bipartite then for each edge uv, each vertex is strictly closer to either u or v, since equality would create an odd cycle. Thus n u (v) · n v (u) ≥ |G| − 1 ≥ d(x, y), and I holds with j = m.
If G is edge-transitive then every edge is on a diameter, meaning If diam(G) = 2 then d i ∈ {1, 2} for each i. Take j maximal such that n i ≥ 2. Then n i ≥ d i for i ≤ j, and n i ≤ d i for all i > j, as required. Finally, if diam(G) = 3 and m ≤ N/2 then we have d i ∈ {2, 3} for each i ≤ m, and taking j maximal such that n i ≥ 3 gives the required property.
Another corollary of Theorem 3.1 is the case when the n i are "on average" at least equal to the diameter, which can be stated more precisely as follows with the use of the notion µ α for the power mean with exponent α, i.e. using N = n 2 we have Corollary 3.5. Let α be a value such that Sz α (G) = W α (G) for a non-complete graph G. If then this value α is unique.
Proof. By Theorem 3.1 it is sufficient to prove that (n α i ) i majorizes (d α i ) i , which is the case if for each k ≤ m the first k terms of the first sequence are on average at least equal to the largest term of the second, namely, diam(G) α . As the sequence is ordered, it is sufficient to prove this for k = m, i.e.
Corollary 3.5 is sufficient to prove Conjecture 1.1 for all graphs lying in some sparse regime. Intuitively if N ≫ m, the n i are on average much larger than the d i and so the majorization property will hold.  Proof. Let e j = uv with u = e j ∩ e j−1 and v = e j ∩ e j+1 . Then N u (e j ) contains at least the j vertices on the path from x to u, and similarly n v (e j ) ≥ diam(G) Taking into account that α ≤ 1 and µ α ≥ 1, this implies This is the desired contradiction, so in the sparse regime Corollary 3.5 does apply.
As a consequence, Conjecture 1.1 is a.a.s. true for any random graph of the form G n,p or G n,m (conditional on the graph being connected).
Corollary 3.8. For any value of m or p, Conjecture 1.1 is a.a.s. true for any random graph of the form G n,p or G n,m (conditional on the graph being connected).
Proof. By Theorem 3.6 the result is true in the sparse case, so we only have to consider the dense case where m > 1 4 (n 4/3 − n 1/3 ). By a result of Klee and Larman [14], the diameter is a.a.s. at most 3, and when m ≥ N 3 it is a.a.s. equal to 2. Therefore Corollary 3.4 applies in this regime. Finally, the result for G(n, p) follows by conditioning on the number of edges.

Counterexamples to the strong conjecture
Let G k,ℓ be a graph constructed as follows. Start with a clique K k and remove a k-cycle v 1 v 2 v 3 . . . v k (a Hamiltonian path) from the clique. Next connect all its vertices with one endvertex u 1 of a path u 1 u 2 . . . u ℓ+1 of length ℓ (i.e. of order ℓ + 1). See Figure 1 for a small example. Figure 1: The graph G k,ℓ for k = 8 and ℓ = 5. Now we compute W α (G k,ℓ ) and Sz α (G k,ℓ ) (assuming k ≥ 6).
4.1 Computation of W α (G k,ℓ ) and Sz α (G k,ℓ ) The number of edges of the graph equals k 2 + ℓ. There are k pairs of vertices which are at distance 2 in the clique. For each i ≤ ℓ + 1, there are k pairs with one vertex from the clique together with u i which are at distance i from each other. There are also ℓ+1−i pairs of vertices, both belonging to the path, which are at distance i from each other; these are (u j , u j+i ) for This implies that Next, we compute Sz α (G k,ℓ ). For every pair of vertices in the clique of the form There are k 2 − 2k edges of this form. For every edge u 1 v i , we have N v i (u 1 )) = {v i } and N u 1 (v i ) contains all vertices from the path P ℓ , as well as v i−1 and v i+1 . So we have k edges here for which n v i u 1 = ℓ + 3.
For every edge of the form u i u i+1 we have n u i u i+1 = (k + i)(ℓ + 1 − i).
Taking everything into account, we get
It is not hard to see that the same analysis gives the same conclusion when a matching instead of a cycle (for k even) was removed from the K k , or any r-regular graph for fixed r (and k sufficiently large).

Conclusion
We have resolved both conjectures of [10]. We proved the weaker Conjecture 1.2 by showing majorization of the sequence (n i ) i with respect to (d i ) i . The stronger Conjecture 1.1 is not true in general, as there are (infinitely many) sporadic counterexamples such as G 520,82 , as explained in Section 4.
Nevertheless, it is true in many important cases as proven in this note. The conjecture is true for example for the following families: • block graphs; • graphs with diameter 2; • any n-vertex graph with at most 1 2n 2/3 n 2 edges; • bipartite graphs; • edge-transitive graphs; and • the random graphs G(n, p) and G(n, m) a.a.s. (for the entire range of p or m).