Abstract

A graph is called unicyclic if the graph contains exactly one cycle. Unicyclic graphs with the fourth extremal Wiener indices are characterized. It is shown that, among all unicyclic graphs with vertices, and attain the fourth minimum Wiener index, whereas attains the fourth maximum Wiener index.

1. Introduction

Let be a connected (molecular) graph with vertex set and edge set . For any two vertices , the distance between them is defined as the number of edges in a shortest path connecting them. The distance of a vertex , denoted by , is the sum of distances between u and all other vertices of , i.e., The famous Wiener index of , denoted by , is defined as

The Wiener index of a graph is a well-known topological index, and it seems that Wiener [1] was the first who considered it. Wiener himself used the name path number and conceived only for acyclic molecules. The definition of the Wiener index in terms of distances between vertices of a graph, such as in equation (1), was first given by Hosoya [2]. Since the middle of the 1970s, the Wiener index has been extensively studied. For research development on the Wiener index, the readers are referred to [3–7] and two special issues of MATCH [8] and Discrete Appl. Math. [9]. Analogous to the Wiener index, some other topological indices are introduced and studied (for example, see [10–13]).

As summarized in [14–16], studies on the Wiener index mainly focus on trees and hexagonal systems. Recently, Wiener indices of unicyclic graphs (i.e., connected graphs containing exactly one cycle) have attracted much attention. Studies along this line include relations between Wiener and Szeged indices of unicyclic graphs [17], minimum Wiener indices of unicyclic graphs of given order, cycle length and number of penden vertices [18], minimum Wiener indices of unicyclic graphs of given matching number [19], Wiener indices of unicyclic graphs with given girth [20], minimum Wiener indices of unicyclic graphs of order n with girth and the matching number [21], minimum Wiener indices of unicyclic graphs of order n and girth with k pendent vertices [22], minimum Wiener index of unicyclic graphs with given bipartition [23], and so on. In [24], Tang and Deng considered unicyclic graphs with the first three smallest and largest Wiener indices. However, their characterization turned out to be incomplete and two extremal graphs were missed. Later, Nasiri et al. [25] filled the gap and presented a complete characterization to these extremal graphs. On the basis of the previous work, in this paper, we characterize unicyclic graphs with the fourth smallest and largest Wiener indices.

2. Notations and Lemmas

Throughout the paper, the path, star, and cycle graphs on n vertices are denoted by , , and , respectively. Let be a unicyclic graph of order n with its unique cycle of length m. Suppose that are all the nontrivial components (they are all nontrivial trees) of , and is the common vertex of and , . Such a unicyclic graph is denoted by . Specially, for . And if , we write for . Let , . Then, . Denote by the set of all trees of order n.

In the following, we summarize some known results concerning Wiener indices of unicyclic graphs which will be used in the later.

Lemma 1 (see [24]). Let be a unicyclic graph. Then,where , , and .

Lemma 2 (see [24]). Let and , where are the centers of , respectively, in and are the pendent vertices of , respectively, in . Then,for any graph and , with the equality on the left (or on the right) if and only if (or ).

Lemma 3 (see [24]). Let and , . If , thenwith the equality if and only if , where .

Lemma 4 (see [24]). Let and , . If , thenwith the equality if and only if , where .

Lemma 5 (see [25]). If and , then .
Besides, we also need the following result.

Lemma 6 (see [22]). Let H, X, and Y be three connected pairwise vertex-set disjoint graphs. Suppose that u and are the two vertices of H, is a vertex of X, and is a vertex of Y. Let be the graph obtained from by identifying with and u with , respectively. Let be the graph obtained from by identifying vertices , and let be the graph obtained from by identifying vertices . Then,

3. Results

3.1. Unicyclic Graphs with the Fourth Minimum Wiener Index

Let be the unicyclic graph as shown in Figure 1(a). Then, unicyclic graphs with the first smallest Wiener indices are completely characterized in the following result.

Theorem 1 (see [25]). Suppose is a unicyclic graph of order n, with . If , thenwith equality if and only ifAs illustrated in the following theorem, we show that and have the fourth smallest Wiener indices.

Theorem 2. Suppose is a unicyclic graph of order n, with . If , thenwith equality if and only if or .

Proof. By Lemma 1,On the other hand, by Lemma 1, it is easily computed thatHence, for , . So, it suffices to show that if is a n-vertex unicyclic graph (), such that , then , with equality if and only if or To this end, for convenience, we distinguish three cases that or .

Case 1 (). If , then . It is well known thatHence, if n is even, thenand if n is odd, thenas desired.
Now assume that . Then, by Lemmas 2, 3, and 5,with equality if and only if .

Case 2 (). In this case, we consider four subcases that , or 4.

Subcase 1 (). In this case, . Since , it has been shown in [25] thatHence, , as desired.

Subcase 2 (). In this case, . It has been shown in [24] thatwhere if and are adjacent in ; otherwise, . Noticing that , we have

Subcase 3 (). In this case, . Let be the graph obtained from by first removing from and then identifying the root of with , and let be the graph obtained from by first removing from and then identifying the root of with . Then, by Lemma 6, or . Suppose that . Then, according to the proof of Subcase 2, we know that . Hence, we have , as desired.

Subcase 4 (). The same argument as Subcase 3 shows that

Case 3 (). For convenience, we distinguish the following three cases.

Subcase 5 (). In this case, . Let be the graph shown in Figure 1(b) . Then, it is well known that , , and has the minimum, second minimum, and third minimum of Wiener index in . Since , we know . By Lemma 1,Noticing that and , we readily have

Subcase 6 (). In this case, . Without loss of generality, we assume that . Now, we consider the following two cases:(1). In this case, . By Lemma 1, Since , we have . So and . It thus follows that Again By Lemma 1, simple computation shows that . Hence, we have .(2). In this case, it is obvious that . By Lemma 2,It has been computed in [24] thatBearing in mind that and , we readily havewith equality if and only if and . Hence,with equality if and only if .

Subcase 7 (). In this case, . It has been shown in [24] thatSince , we haveIf , then and thus ; otherwise, , then and thus . Hence, in both cases, we have and consequently,

3.2. Unicyclic Graphs with the Fourth Maximum Wiener Index

Unicyclic graphs with the first three largest Wiener indices were first characterized by Tang and Deng [24], but one extremal graph was missed. Then, Nasiri et al. [25] gave a complete characterization.

Theorem 3 (see [25]). Suppose is a unicyclic graph of order n, with . If , thenwith equality if and only if . Here, is a unicyclic graph depicted in Figure 2(a).
Now, we characterize unicyclic graphs with the fourth largest Wiener indices.

Theorem 4. Suppose that is a unicyclic graph of order n, with . If , thenwith equality if and only if .

Proof. By Lemma 1, it is easily computed that for ,Hence, according to Theorem 4, we only need to show that for , if , then , with equality if and only if . To prove our result, we distinguish the following three cases according to m.

Case 4 (). In this case, we consider two subcases that and .

Subcase 8 (). In this case . If n is even, thenIf n is odd, thenHence, as desired.

Subcase 9 (). By Lemmas 2 and 4,We now prove that . We first assume that m is even. Then, and by Lemma 1,Thus,Now assume that m is odd. Then, and by Lemma 1Thus,Therefore, we could conclude that .

Case 5 (). We consider subcases that , or 4.

Subcase 10 (). In this case, with being a tree of order . By assumption, and so . By Lemma 1,Noticing that has the second maximum Wiener index in and , we haveThus, we haveas desired.

Subcase 11 (). By Lemma 2, we haveIn addition, it has been shown in [24] thatwhere if and are adjacent and 2, otherwise. Bearing in mind that , andSo we have as desired.

Subcase 12 ( or ). In this case, it has been shown in [24] thatAs shown in Subcase 10, . Thus, it is done.

Case 6 (). We distinguish three cases according to , or 3.

Subcase 13 (). In this case, . By assumption, and so . By Lemma 1,Since has the third maximum Wiener index in and , we readily have It is easily verified thatas desired.

Subcase 14 (). In this case, . Without loss of generality, we suppose that . For convenience, we distinguish the following two cases:(1); that is, . Since , . It is easy to compute that Since has the second maximum Wiener index in and , we have Noticing that , we complete the proof.(2). In this case, we haveBy Lemma 1, simple calculation shows thatOn the other hand,with equality if and only if (and thus, ), that is, if and only if . Hence, , with equality if and only if .

Subcase 15 (). By Lemma 2, we haveIt has been shown in [25] thatHence,Since it has been shown in the proof of Theorem 2 that , it immediately follows thatand the proof is complete.

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare no conflicts of interest.

Authors’ Contributions

All authors contributed equally to this paper.

Acknowledgments

This research was funded by the National Natural Science Foundation of China (through grant nos. 116711347 and 11861032) and the project ZR2019YQ02 by the Shandong Provincial Natural Science Foundation.