The maximum Wiener index of maximal planar graphs

The Wiener index of a connected graph is the sum of the distances between all pairs of vertices in the graph. It was conjectured that the Wiener index of an n-vertex maximal planar graph is at most ⌊118(n3+3n2)⌋\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\lfloor \frac{1}{18}(n^3+3n^2)\rfloor $$\end{document}. We prove this conjecture and determine the unique n-vertex maximal planar graph attaining this maximum, for every n≥10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ n\ge 10$$\end{document}.


Introduction
The Wiener index is a graph invariant based on distances in the graph. For a connected graph G, the Wiener index is the sum of distances between all unordered pairs of vertices in the graph and is denoted by W (G). That means, where d G (u, v) denotes the distance from u to v i.e. the minimum length of a path from u to v in the graph G.
It was first introduced by Wiener (1947) while studying its correlations with boiling points of paraffin considering its molecular structure. Since then, it has been one of the most frequently used topological indices in chemistry, as molecular structures are usually modelled as undirected graphs. Many results on the Wiener index and closely related parameters such as the gross status (Harary 1959), the distance of graphs (Entringer et al. 1976), and the transmission (Šoltés 1991) have been studied. A great deal of knowledge on the Wiener index is accumulated in several survey papers (Dobrynin et al. 2001(Dobrynin et al. , 2002Dobrynin Mel'nikov 2012;Xu et al. 2014). Finding a sharp bound on the Wiener index for graphs under some constraints has been one of the research topics attracting many researchers.
The most basic upper bound of W (G) states that, if G is a connected graph of order n, then which is attained only by a path (Dankelmann et al. 2008a;Plesník 1984;Lovász 1979). Many sharp or asymptotically sharp bounds on W (G) in terms of other graph parameters are known, for instance, minimum degree (Beezer et al. 2001;Dankelmann and Entringer 2000;Kouider and Winkler 1997), connectivity (Dankelmann et al. 2009;Favaron et al. 1989), edge-connectivity (Dankelmann et al. 2008b, a) and maximum degree (Fischermann et al. 2002). For finding more details in mathematical aspect of Wiener index, see also results (Das and Nadjafi-Arani 2017;Gutman et al. 2014;Klavžar and Nadjafi-Arani 2014;Knor et al. , 2016Li et al. 2018;Mukwembi and Vetrík 2014;Wagner et al. 2009;Wagner 2006;Wang and Yu 2006). One can study the Wiener index of the family of connected planar graphs. Since the bound given in Eq. 1 is attained by a path, it is natural to ask the same question for some particular family of planar graphs. For instance, the Wiener index of a maximal planar graph with n vertices, n ≥ 3 has a sharp lower bound (n − 2) 2 + 2. This bound is attained by any maximal planar graph such that the distance between any pair of vertices is at most 2 (for instance a planar graph containing the n-vertex star). Che andCollins (2018), andindependentlyĆzabarka et al. (2019), gave a sharp upper bound of a particular class of maximal planar graphs known as Apollonian networks. An Apollonian network may be formed, starting from a single triangle embedded on the plane, by repeatedly selecting a triangular face of the embedding, adding a new vertex inside the face, and connecting the new vertex to each of the three vertices of the face. They showed that It has been shown explicitly in Che and Collins (2018) that the bound is attained for the maximal planar graphs T n , we will give the construction of T n in the next section, see Definition 2.1. The authors in Che and Collins (2018) also conjectured that this bound also holds for every maximal planar graph. It has been shown that the conjectured bound holds asymptotically (Ćzabarka et al. 2019). In particular, they showed the following result.
In this paper, we confirm the conjecture.
Theorem 1.3 Let G be an n ≥ 6 vertex maximal planar graph. Then Equality holds if and only if G is isomorphic to T n for all n ≥ 9.

Notations and preliminaries
Let G be a graph. We denote vertex set and edge set of G by V (G) and E(G) respectively. A path in a graph is an alternating sequence of distinct vertices and edges, starting from a vertex and ending at a vertex. Such that every edge is incident to neighbouring vertices in the sequence. The length of the path is the number of edges in the given path. With a slight abuse of notion, a cycle in a graph G is a non-zero length path from a vertex v to itself v. We use standard function d G (v, u) to denote the length of shortest path from the vertex v to the vertex u. Even more, we may define a function that denotes the distance from a vertex to the set of vertices. Let v be a vertex of G For a vertex set S ⊂ V (G), the status of S is defined as the sum of all distances from the vertices of the graph to the set S. It is denoted by σ G (S), thus For simplicity, we may omit subscript G in the given functions if the underlined graph is obvious. With a slight abuse of notation, we use σ G (v) := σ G ({v}).
We have, Apollonian networks maximizing Wiener index of maximal planar graphs, Che and Collins (2018) Here we use definition from Che and Collins (2018), for an Apollonian network T n on n vertices. We will prove later that it is the unique maximal planar graph that maximizes the Wiener index of the maximal planar graphs. (2018)) The Apollonian network T n is the maximal planar graph on n ≥ 3 vertices, with the following structure, see Fig. 1.

Definition 2.1 (Che and Collins
If n is a multiple of 3, then the vertex set of T n can be partitioned in three sets of same size, A = {a 1 , a 2 , · · · , a k }, B = {b 1 , b 2 , . . . , b k } and C = {c 1 , c 2 , · · · , c k }. The edge set of T n is the union of following three sets If 3|(n − 1), then T n is the Apollonian network which may be obtained from T n−1 by adding a degree three vertex in the face a 1 , b 1 , c 1 or a n−1 If 3|(n − 2), then T n is the Apollonian network which may be obtained from T n−2 by adding a degree three vertex in each of the faces a 1 , b 1 , c 1 and a n−1 The following lemmas will be used in the proof of Theorem 1.3. At first, we would like to recall some standard definitions. A connected graph G is said to be svertex connected or simply s-connected if it has more than s vertices and remains connected whenever fewer than s vertices are removed. An induced subgraph of a graph G is another graph, formed from a subset of the vertices of G and all of the edges connecting pairs of vertices in that subset. Formally let G be a graph and S be a subset of vertices of G, S ⊆ V (G). Then induced subgraph G[S] of G is a graph on the vertex set S and and if there is a cycle that includes every vertex of G, and the cycle is called Hamiltonian cycle.

Lemma 2.2 Let G be an s-connected, maximal planar graph and S be a cut set of size s of G. Then G[S] is Hamiltonian.
Proof Let us denote vertices of S, S = {v 1 , v 2 , . . . , v s }. Let u and w be two distinct vertices, {u, w} ∈ V (G)\S such that any path from u to w contains at least one vertex Since G is s-connected, by Menger's Theorem, there are s pairwise internally vertex disjoint paths from u to w. Each of the paths intersects S in disjoint nonempty sets, therefore each of the paths contains exactly one vertex from S. We may assume, that in a particular planar embedding of G, those paths are ordered in such a way that one of the two regions determined by the cycle obtained from two paths from u to w containing v i x and v i x+1 has no vertex from S (where indices are taken modulo s), see Fig. 2. From the maximality of the planar graph, there is a path from the vertex u to the vertex w that does not contain a vertex from S, a contradiction. Thus we must have the edges {v i x , v i x+1 }. Therefore we have a cycle of length s on the vertex set S, The following definition is particularly helpful for the proof of Theorem 1.3. Given a set S ⊆ V , we define the Breadth First Search partition of V with root S, P G S or simply P S when the underline graph is clear, by P S = {S 0 , S 1 , . . . }, where S 0 = S, and for i ≥ 1, S i is the set of vertices at distance exactly i from S, We refer to those sets as levels of P s . In particular S 1 is the first level. For the largest integer integer k, for which S k = ∅, we refer to S k as the last level. We refer to S 0 and the last level as terminal level. Note that by definition every level besides the terminal level is a cut set of G. We denote by P v the Breadth First Search partition from {v}, that is the partition P {v} .
The following three lemmas play a critical role to prove Theorem 1.3.

Lemma 2.3 Let G be an n + s vertex graph and S, S ⊂ V (G), be a set of vertices of size s. Such that each non-terminal level of P S has size at least 3. Then we have
Lemma 2.4 Let G be an n + s vertex graph and S, S ⊂ V (G), be a set of vertices of size s. Such that each non-terminal level of P S has size at least 4. Then we have Lemma 2.5 Let G be an n + s vertex graph and S, S ⊂ V (G), be a set of vertices of size s. Such that each non-terminal level of P S has size at least 5. Then we have if n ≡ 0 (mod 5); 1 10 (n 2 + 5n + 4), if n ≡ 1, 4 (mod 5); 1 10 (n 2 + 5n + 6), if n ≡ 2, 3 (mod 5).

Proof of Theorem 1.3
Proof From Che and Collins (2018), we know that the desired lower bound is attained for T n . For the upper bound, we are going to prove Theorem 1.3 by induction on the number of vertices. In Che and Collins (2018), they prove it for n ≤ 10 without computer aid, but inĆzabarka et al. (2019), it is shown that the upper bound of Theorem 1.3 holds, for 6 ≤ n ≤ 18 with using computer program. It is also shown by means of computer program that the upper bound is sharp for 6 ≤ n ≤ 18 and the extremal graph is unique T n for 9 ≤ n ≤ 18. For our proof, we use the computer-aided result of Czabarka et al. (2019) only for Case 2.1 and for the uniqueness of the extremal graph.
For the rest, the result in Che and Collins (2018) is enough. Unfortunately, we do not know any proof of the cases n ≤ 18 without the use of computers. So, we assume n ≥ 19 from now on.
Let G be a maximal planar graph of n ≥ 19 vertices. The proof contains three cases depending on the connectivity of the graph G. Since G is a maximal planar graph, it is either 3, 4 or 5-connected. Notice that the result inĆzabarka et al. (2019) is much stronger asymptotically than ours if G is 4 or 5-connected, but we are to prove the upper bound for every n ≥ 19. In Case 2, it makes the proof somewhat technical. Case 1 Let G be a 5-connected graph. For every fixed vertex v ∈ V (G), consider P v . Since G is 5-connected, and each of the non-terminal levels of P v is a cut set, we have that each non-terminal level has size at least 5. Therefore from Lemma 2.5, we have, for all n ≥ 4. Therefore we are done if G is 5-connected. Case 2 Let G be 4-connected and not 5-connected. Then G contains a cut set of size 4, which induces a cycle of length four, by Lemma 2.2. Let us denote the vertices of this cut set as v 1 , v 2 , v 3 and v 4 , forming the cycle in this given order. The cut-set divides the plane into two regions. We call them the inner and the outer region respectively. Let us denote the number of vertices in the inner region by x and assume, without loss of generality, that x is minimal possible, but greater than one. Obviously x ≤ n−4 2 or x = n − 5. From here on, we deal with several sub-cases depending on the value of x.
Case 2.1 If x ≥ 4 and x = n − 5. Let us consider the sub-graph of G, say G , obtained by deleting all vertices from the outer region of the cycle v 1 , v 2 , v 3 , v 4 in G. The graph G is not maximal since the outer face is a 4-cycle. The graph G is 4-connected, therefore it does not contain neither {v 1 , v 3 } nor {v 2 , v 4 }, consequently we may add any of them to G , to obtain a maximal planar graph. Adding an edge decreases the Wiener index of G . In the following paragraph, we prove that one of the edges decreases the Wiener index of G by at most x 2 16 .
Let A be the subset of vertices of G not contained in any of the A i 's. So A, A 1 , A 2 , A 3 , A 4 is a partition of vertices of G . It is simple to observe that, if adding an edge {v i , v i+2 }, for i ∈ {1, 2}, decreases the distance between a pair of vertices, then these vertices are from A i and A i+2 . If there is a vertex u which has at least three neighbours from the cut set, without loss of generality say v 1 , v 2 , v 3 , then A 2 = ∅, since G is 4-connected. Therefore we are done if there exists such vertex. Otherwise, for each pair {v 1 , v 2 }, {v 2 , v 3 }, {v 3 , v 4 }, {v 4 , v 1 }, there is a distinct vertex which is adjacent to both vertices of the pair. Hence the size of A is at least 4. The size of the vertex set ∪ 4 i=1 A i , is at most x. By the AM-GM inequality, we have that one of |A 1 | · |A 3 | or |A 2 | · |A 4 | is at most x 2 16 . Therefore we can choose one of the edges {v 1 , v 3 } or {v 2 , v 4 }, such that after adding that edge to the graph G , the Wiener index of the graph decreases by at most x 2 16 . Let us denote the maximal planar graph obtained by adding this edge to G by G x+4 .
Similarly, we denote the maximal planar graph obtained from G, by deleting all vertices in the inner region and adding the diagonal by G n−x . This decreases the Wiener index by at most (n−x−4) 2 16 . Consider the graph G n−x and a sub-set of it's vertices S = {v 1 , v 2 , v 3 , v 4 }. Since the graph G is 4-connected, each non-terminal level of P G n−x S has at least 4 vertices.
Therefore we get that σ G n−x (S) ≤ σ 4 (n − x − 4) = (n−x−2) 2 8 , from Lemma 2.4. Recall that G is the graph obtained from G by deleting the vertices from the outer region. For each i ∈ {1, 2, 3, 4}, consider the BFS partition P G v i . Note that, x ≥ 4, G is 4-connected, and by minimality of x, we have that every non-terminal level of P G v i has at least 5 vertices, except two cases. The first level may contain only four vertices and the penultimate level may also contain four vertices with the last level having exactly one vertex. Status of the v i is maximised, if the number of vertices in the first and the penultimate level is four, with the last level containing only one vertex and every other level contains exactly five vertices.
To simplify calculations of the status of the vertex v i , we may hang a new temporary vertex on the root, and we may bring a vertex from the last level to the previous level. These modifications do not change the status of the vertex, but it increases the number of vertices. Now we may apply Lemma 2.5 for this BFS partition, considering that number of vertices in all levels is exactly 5. Therefore we have σ Observe that this status contains distances, from v i to other vertices from the cut set, which equals to four. Note that this is a uniform upper bound for the status of each of the vertices from the cut set.
Finally we may upper bound the Wiener index of G in the following way, In the first line, we upper bound all distances between pairs of vertices on the cut set and outer region, and between pairs of vertices on the cut set and inner region. We subtract 8 since distances between the pairs from the cut set were double-counted. In the second line, we upper bound all distances from the outer region to the inner region. These distances are split in two, distances from the outer region to the cut set and from a fixed vertex of the cycle, without loss of generality say v 1 , to the inner region.
We are going to prove that W (G) ≤ 1 18 (n 3 + 3n 2 ) − 1, therefore we will be done in this sub-case. We need to prove the following inequality After we simplify, we get We know that 4 ≤ x ≤ n−4 2 and if we set x = 4, we get 2176 + 528n − 75n 2 ≤ 0 which holds for all ≥ 10. Therefore, if the derivative of the right hand side of the inequality is negative for all {x | 4 ≤ x ≤ n−4 2 }, then the inequality holds for all these values of x. Differentiating the LHS of the Inequality (2), with respect to x, we get δ δx (3) If we set x = 4 in Eq. 3, we get 1 120 (96 + 57n − 5n 2 ), which is negative for all ≥ 13. If we set x = n−4 2 in Eq. 3, we get 1 160 (−n 2 + 8n + 128), which is negative for all ≥ 17. Therefore Eq. 3 is negative in the whole interval. Since n ≥ 19, we have W (G) ≤ 1 18 (n 3 + 3n 2 ) − 1, and this sub-case is settled. Case 2.2 If 2 ≤ x ≤ 3. From the minimality of x and maximality of G, we have x = 2. Let us consider the maximal planar graph, denoted by G n−2 , obtained from G by deleting these two vertices from the inner region and adding an edge which decreases the Wiener index by at most (n−6) 2 16 , such edge exists as in the previous case. Since G is 4-connected, for each vertex v, v ∈ V (G), each level of P G v contains at least 4 vertices, but possibly the last one. Therefore status of both vertices inside can be bounded by σ 5 (n) = 1 8 ((n − 1) 2 + 4(n − 1) + 4). This bound comes from Lemma 2.4. Finally, we have (4) The last inequality holds for all n ≥ 9, so this sub-case is done too.
Case 2.3 If x = n − 5. Therefore we have one vertex outside of the cut set. Let us consider the maximal planar graph, denoted by G n−1 , obtained from G by deleting the vertex from the outer region and adding an edge which decreases the Wiener index by at most (n−5) 2 16 . By the choice of x, we have that for the vertex outside the cut set v. Each level of P G v contains at least 5 vertices, except the first one which contains only 4 and the penultimate level may contain 4 vertices too followed by one vertex in the last level.
The status of the vertex v is maximized if the last level contains exactly one vertex, the penultimate and the first level contain four vertices while every other level contains five vertices. Therefore status of v can be bounded by 1 10 (n 2 + 5n). This bound comes from Lemma 2.5. Finally, we have The last inequality holds for all n ≥ 9, so this sub-case is done too. Case 3. Let G be 3-connected and not 4-connected. Since G is not 4-connected and it is a maximal planar graph, it must have a cut set of size 3, say {v 1 , v 2 , v 3 }. This induces a triangle from the Lemma 2.2. Without loss of generality, let us assume that number of vertices in the inner smaller region of the cut set is minimal possible, say x.
In this case, the equality holds if and only if the graph obtained after deleting the vertex v is T n−1 . We can observe that, if we add the vertex v to the graph T n−1 , the choice that maximizes the status of v , σ G (v) = 1 6 (n 2 + n) − 1 3 1 3|(n−1) , is only when we add v in one ot the two faces which gets us the graph T n . Hence we have the desired upper bound of the Wiener index and equality holds if and only if G = T n .
Case 3.2 If x = 3. Let us denote vertices in the inner region as x 1 , x 2 and x 3 . From the minimality of x and maximality of G, the structure of G in the inner region is well defined, see Fig. 3a. If we remove these three inner vertices, the graph we get is denoted by G n−3 and is still maximal. Hence we may use the induction hypothesis for the graph G n−3 . Consider the graph G n−3 and a vertex set S = {v 1 , v 2 , v 3 }. Each level of P G n−3 S has at least three vertices except the terminal one. Therefore we may apply Lemma 2.3, then We first estimate distances from the outer region to the cut set and from the fixed vertex on the cut set to all x i . The distances from the vertices in the outer region to The sum of distances from v i to the vertices {x 1 , x 2 , x 3 } is 4. Note that, if we take a vertex in the outer region which has at least two neighbours on the cut set, then for this vertex we need to count 3 for the distances from the cut set to the vertices {x 1 , x 2 , x 3 }. Since we have at least two such vertices, all cross distances can be bounded by 3σ G n−3 ({v 1 , v 2 , v 3 }) + 4(n − 5) + 6. Then we have, Therefore, this case is also settled. Case 3.3 If x = 4. From the minimality of x and the maximality of the planar graph G, there is only one configuration of the inner region (Fig. 3b). Consider a maximal planar graph on the n −4 vertices, say G n−4 , that is obtained from G by deleting the four inner vertices. We will apply the induction hypothesis for this graph, to upper bound the sum of distances between all pairs of vertices from V (G n−4 ) in G. By applying Lemma 2.3 for G n−4 . The sum of the distances between the four inner vertices is 7. The sum of the distances from each v i to all of the vertices inside is at most six. By a similar argument as in the previous case we have, W (G) ≤ 1 18 ((n − 4) 3 + 3(n − 4) 2 ) + 7 + 4 6 ((n − 7) 2 + (n − 7) + 2) + 6(n − 4) < 1 18 (n 3 + 3n 2 ) .
Therefore, this case is also settled. Case 3.4 If x = 5. From the minimality of x and the maximality of the planar graph G, there are three configurations of the inner region, see Fig. 4. Consider a maximal planar graph on the n−5 vertices, say G n−5 , which is obtained from G by deleting 5 vertices from the inner region. We will apply the induction hypothesis for this graph G n−5 , to bound the sum of the distances between the vertices of V (G n−5 ) in the graph G. By applying Lemma 2.3 for G n−5 and S = {v 1 , v 2 , v 3 }, we get σ G n−5 ({v 1 , v 2 , v 3 }) ≤ 1 6 ((n −8) 2 +(n −8)+2). The sum of the distances between five inner vertices is at most 13. The sum of the distances from v i to all of the vertices inside is at most 8. Finally, we have W (G) ≤ 1 18 ((n − 5) 3 + 3(n − 5) 2 ) + 13 + 5 6 ((n − 8) 2 + (n − 8) + 2) + 8(n − 5) < 1 18 (n 3 + 3n 2 ) .
Therefore this case is also settled. Case 3.5 If x ≥ 6. First we settle for x ≥ 7 and then for x = 6. Consider the maximal planar graph on n − x vertices, say G n−x , which is obtained from G by deleting those x vertices from the inner region of the cut set {v 1 , v 2 , v 3 }. Consider the maximal planar graph on x + 3 vertices, say G x+3 , which is obtained from G, by deleting all n − x − 3 vertices from the outer region of the cut set {v 1 , v 2 , v 3 }. We know by induction that W (G x+3 ) ≤ 1 18 ((x + 3) 3 + 3(x + 3) 2 ). There are at least two vertices from the cut set {v 1 , v 2 , v 3 }, such that each of them has at least two neighbours in the outer region of the cut set. Without loss of generality, we may assume they are v 1 and v 2 . Hence if we consider P G n−x v 1 and P G n−x v 2 , we will have 4 vertices in the first level of and at least three in the following levels until the last one. Therefore we have σ G n−x (v 1 ) ≤ σ 3 (n − x − 2) + 1 ≤ 1 6 ((n − x − 2) 2 + 3(n − x − 2) + 8) from Lemma 2.3 and same for v 2 . Now let us consider P G x+3 {v 1 ,v 2 } , from minimality of x, each non-terminal level of the P G x+3 {v 1 ,v 2 } contains at least 4 vertices. Therefore by applying Lemma 2.4, we get σ G x+3 ({v 1 , v 2 }) ≤ 1 8 (x 2 + 6x + 9). We have, The first term of the sum is an upper bound for the sum of all distances which does not cross the cut set. The second and the third terms upper-bounds all cross distances in the following way-we may split this sum into two parts for each crossing pair sum from inside to the set {v 1 , v 2 } and from v i , i ∈ {1, 2} to the vertex outside, those are the second and the third terms of the sum accordingly. Therefore applying estimates, we get (11) After simplification we have − x 3 + x 2 (n + 3) + x(21 − 6n) − (15 + 3n) ≥ 0.
The derivative is positive when x ∈ [7, n 2 ]. Hence since the inequality (12) holds for x = 7, it also holds for all x, x ∈ [7, n 2 ]. Therefore, if x ≥ 7 we are done. Finally if x = 6, then distances from v 1 and v 2 to all vertices inside is 9 instead of 73 8 as it was used the in Inequality 11. Thus we get an improvement of Inequality (11), which shows that W (G) < 1 18 (n 3 + 3n 2 ) even for x = 6. Therefore we have settled 3-connected case too.

Concluding remarks
There is the unique maximal planar graph T n , maximizing the Wiener index, Theorem 1.3. Clearly T n is not 4-connected. One may ask for the maximum Wiener index for the family of 4-connected and 5-connected maximal planar graphs. InĆzabarka et al. (2019), asymptotic results were proved for both cases. Moreover, based on their constructions, they conjecture sharp bounds for both 4-connected and 5-connected maximal planar graphs. Their conjectures are the following.