1. Introduction
Numerous topological and chemical indices/measures have been used for analyzing molecular graphs [
1,
2,
3,
4]. A prominent example is the Hosoya index introduced by Hosoya [
5] in 1971 as a molecular-graph based structure descriptor. Hosoya discovered that certain physico-chemical properties of alkanes (= saturated hydrocarbons)—in particular, their boiling points—are well correlated with this index. Gutman et al. further considered it in the chemical view [
6]. As is known, structural graph descriptors have been investigated extensively in chemistry, drug design and related disciplines [
1,
2,
3,
4].
The Hosoya index got much attention by many researchers in the past decades. They have been interested in identifying the maximum or minimum value of Hosoya index for various classes of graphs (with certain restrictions), such as trees [
7,
8,
9], unicyclic graphs [
10,
11,
12,
13,
14], bicyclic graphs [
15] and so on. For an exhaustive survey for this topic, we refer to [
16].
Even though there is a considerable amount of literature on the topic of maximizing or minimizing the Hosoya index, there are still many interesting open questions left. In [
16], it is mentioned that:
- -
- It seems to be difficult to obtain results of the maximum Hosoya index among trees with a given number of leaves or given diameter. However, partial results are available, so the problem might not be totally intractable, and results in this direction would definitely be interesting. 
- -
- If the aforementioned questions can be answered for trees, then it is also natural to consider the analogous questions for treelike graphs (such as unicyclic graphs). 
For two vertices 
 in a graph 
G, the distance 
 between 
u and 
v is the length of a shortest path connecting them. The diameter of 
G is 
. Confirming a conjecture proposed by Ou [
12], Liu [
8] considered the maximum Hosoya index of trees with diameter 4. Motivated by this line of research, we here consider the maximal Hosoya index of unicyclic graphs with small diameter. It seems that unicyclic graphs are only one more edge than trees, however, some of their properties change drastically such as the girth.
At the end of this section, we define some notation as well as some preliminary results that we frequently use in the sequel.
Let 
G be a simple connected graph with vertex set 
. For 
, we denote its neighborhood by 
, and denote 
. A pendent vertex is a vertex of degree 1. For two vertices 
 and 
, the distance between 
 and 
 is the number of edges in a shortest path joining 
 and 
. We use 
 to denote the graph that arises from 
G by deleting the vertex 
. For other undefined notations, we refer to [
17].
Given a molecular graph 
G, let 
 be the number of 
k matchings of 
G. It would be convenient to define 
  The Hosoya index 
 is defined as the number of subsets of 
 in which no edges are incident, in other words, the total number of the matchings of the graph 
G. Then,
For the star  of order , when , we have . Then, .
The double star 
 is a tree of order 
n obtained from 
 and 
, by identifying a pendent vertex of 
 with the center of 
, where 
. For 
, when 
, we have 
, therefore
The following two lemmas are needed in this paper, which can be found on page 337 of [
16].
Lemma 1. Let G be a graph and v be a vertex of G. Then,  Lemma 2. If  are the components of a graph G, then  For 
, the unique unicyclic graph with diameter two is obtained from the star 
 by adding an edge. For unicyclic graphs with diameter at least 5, things become more complicated, and we believe more techniques are needed. Thus, we only consider the cases for diameter 3 and 4. In 
Section 2, we determine the maximal Hosoya index of unicyclic graphs with 
n vertices and diameter 3 (see Theorem 5). In 
Section 3, we determine the maximal Hosoya index of unicyclic graphs with 
n vertices and diameter 4 (see Theorem 15).
  2. The Unicyclic Graphs with Diameter 3
In this section, we study the maximal Hosoya index of unicyclic graphs with n vertices and diameter 3.
Let  be the set of all unicyclic graphs with n vertices and diameter 3. According to the length of the unique cycle and the distribution of other vertices, we may classify all the members in . Let  be the set of unicyclic graph of the form , . It is easy to see that the graphs from , , , and , and , , and  are all unicyclic graphs with diameter 3.
Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 1), where  
, 
 and at least two of 
 are greater than 2. Let 
 be the graph of the form 
 satisfying 
 almost equal (hereafter “almost equal” means the difference of any two numbers is at most one).
Theorem 1. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  Assume 
 with 
. By Lemmas 1 and 2, we obtain
        where 
y is one of pendent vertex adjacent to 
 in 
.
If 
, then we get
As  have the same status as shown in the graph, we conclude that, when  are almost equal,  has the maximal Hosoya index. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 1), where  
, 
. Let 
 be the graph of the form 
 satisfying 
.
Theorem 2. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  Assume 
. By Lemmas 1 and 2, we obtain
        where 
y is one of pendent vertexs adjacent to 
 in 
.
If 
, then we get
If 
, then we get
Thus, we obtain the result. □
 Let 
 be the set of unicyclic graph of the form 
 (as depicted in 
Figure 1), where 
 and 
 are two vertices with 
, 
 pendent vertices satisfying 
, one of 
a and 
b is at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 3. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
 with 
, by Lemmas 1 and 2, we obtain
        where 
y is one of pendent vertex adjacent to 
 in 
.
If 
, then we get
Therefore, when a and b are almost equal,  has the maximal Hosoya index. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 1), where 
 and 
 are two vertices with 
, 
 pendent vertices, respectively, 
, 
. Let 
 be the graph of the form 
 satisfying 
.
Theorem 4. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  Assume 
 with 
. By Lemmas 1 and 2, we obtain
        where 
 is a pendent vertex adjacent to 
, 
y is a pendent vertex adjacent to 
.
If 
, then we get
This implies the result. □
 Theorem 5. The graph  has the maximum Hosoya index among all graphs in  if .
 Proof.  We only need to compare the Hosoya indices of  for .
For 
, we assume that 
. As 
 are almost equal and 
, then we have 
. Thus,
For 
, as 
 and 
, we have 
 and thus 
. Thus
The last inequality holds for a function  that is strictly increasing for .
For 
, as 
 are almost equal and 
, then we have
For 
, as 
 are almost equal and 
, then we have
By using the software “Mathematica”, we see  for ,  for  A direct computation yields to .
From above, we obtain the result. □
   3. The Unicyclic Graphs with Diameter 4
In this section, we aim to determine the maximal Hosoya index of unicyclic graphs with n vertices and diameter 4.
Let  be the set of all unicyclic graphs with n vertices and diameter 4. According to the length of the unique cycle and the distribution of other vertices, we may classify all the members in . Let  be the set of unicyclic graphs of the form , . It is easy to see that the graphs from , , , , , , , , and  and two cycles  and  are all members of the unicyclic graphs with diameter 4.
Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, and 
 are three vertices with 
, 
, and 
 pendent vertices, 
, 
. Let 
 be the graph of the form 
 satisfying 
.
Theorem 6. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2, we have
        where 
y is one pendent vertex adjacent to 
 in 
.
Case 1. If 
, then
 Case 2. If 
, then
 Cases 1 and 2 imply that, if  has maximum Hosoya index, then we infer .
Case 3. If 
, then
 Case 4. If 
, then
 Cases 3 and 4 imply that, if  has maximum Hosoya index, then we infer .
Case 5. If 
, then
 Case 6. If  
, then
 Cases 5 and 6 imply that if  has maximum Hosoya index, then we infer  are almost equal.
From the above, we get the result. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, 
, and 
 are four vertices with 
, 
, 
, and 
 pendent vertices, respectively, 
. As the diameter is 4, we infer 
 and one value of 
c and 
d is at least 2. Let 
 be the graph of the form 
 satisfying 
, 
, 
.
Theorem 7. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by  Lemmas 1 and 2, we have
        where 
y is one of pendent vertex adjacent to 
 in 
.
Case 1. If 
, then
 Case 2. If 
, we infer
 Cases 1 and 2 imply that, if  has maximum Hosoya index, then we infer .
Case 3. If 
, then
 Case 4. If 
, then
 Cases 3 and 4 imply that, if  has maximum Hosoya index, then infer .
Case 5. If 
, then
 Case 6. If 
, then
 Cases 5 and 6 imply that, if  has maximum Hosoya index, then we infer .
From the above cases, we get the result. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, 
, and 
 are four vertices with 
, 
, 
, and 
 pendent vertices, 
, 
. As the diameter is 4, 
a and 
c, or 
b and 
d, are at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 8. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2, we have
For 
, by Lemma 1, we have
        where 
y is one pendent vertex adjacent to 
 in 
.
For 
, by Lemmas 1 and 2, we have
        where 
w is one of pendent vertex adjacent to 
 in 
. Therefore,
Case 1. If 
, then
 From Case 1, we have, when a and c are almost equal,  has larger Hosoya index. Similarly, as  have the same status as shown in the graph, we conclude that, when b and d are almost equal,  has larger Hosoya index.
Case 2. If 
, then
 Therefore, from Case 2, when  has maximum Hosoya index, we infer that a and b are almost equal, and, similarly, a and d are almost equal.
From Case 1, b and d are almost equal, so a, b and d are almost equal. Similarly, a, b and c are almost equal. Hence, we get  are almost equal. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, 
, and 
 are four vertices with 
, 
, 
, and 
 pendent vertices with 
, 
. Let 
 be the graph of the form 
 satisfying 
.
Theorem 9. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by  Lemmas 1 and 2, we have
For 
, by Lemma 1, we get
        where 
y is one pendent vertex adjacent to 
 in 
. For 
, by Lemmas 1 and 2,
        where 
w is one pendent vertex adjacent to 
 in 
. Hence, it follows that
Case 1. If 
, then
 Similarly, if 
, then we have
Cases 1 implies that, if  has the maximum Hosoya index, we conclude .
Case 2. If 
, then 
 Case 3. If 
, then
 Cases 2 and 3 imply that, if  has the maximum Hosoya index, we conclude .
Case 4. If 
, then 
 Case 5. If 
, then
 Thus, we have .
Cases 4 and 5 imply that, if  has the maximum Hosoya index, we conclude .
All the above cases imply the desired result. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, 
, and 
 are four vertices with 
, 
, 
, and 
 pendent vertices, 
, and 
. Let 
 be the graph of the form 
 satisfying 
.
Theorem 10. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2,
        where 
y is one pendent vertex adjacent to 
 in 
.
For 
, By Lemma 1, we have
        where 
w is one pendent vertex adjacent to 
 in 
, 
, and 
. Therefore,
Case 1. If 
, then 
 Case 2. If 
, this yields to
 Cases 1 and 2 imply that, if  has the maximum Hosoya index, we infer .
Case 3. If 
, then
 Case 4. If 
, then
 Cases 3 and 4 imply that, if  has the maximum Hosoya index, we conclude .
Case 5. If 
, then
 Case 6. If 
, then
 Cases 5 and 6 imply that, if  has the maximum Hosoya index, we conclude .
From all above, we get the result. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, 
, 
, and 
 are five vertices with 
, 
, 
, 
, and 
 pendent vertices, 
, and 
. As the diameter is 4, from symmetry, we may assume 
a and 
c, or 
a and 
d, are at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 11. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2, we have
        where 
y is one pendent vertex adjacent to 
 in 
.
For 
, by Lemma 1, we have
        where 
 is one pendent vertex adjacent to 
 in 
, 
 is one pendent vertex adjacent to 
, 
, and
If 
, let 
 be the graph obtained from 
 by removing a pendent edge at 
 to 
. Then, we get
As 
 have the same status as depicted in 
Figure 2, we obtain that, when 
 are almost equal, 
 has the maximal Hosoya index. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, and 
 are three vertices with 
, 
, and 
 pendent vertices, 
, 
, and one of 
 is at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 12. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2, we have
        where 
 is one pendent vertex adjacent to 
 in 
.
For 
, by Lemma 1, we have
        where 
 is one pendent vertex adjacent to 
, 
 is one pendent vertex adjacent to 
 in 
, 
, and
Case 1. If 
, then
 Case 2. If 
, then we conclude
 Cases 1 and 2 imply that, if  has the maximum Hosoya index, we conclude . Similarly, by using symmetry, we may obtain .
Case 3. If 
, then
 Case 4. If 
, then get
 Cases 3 and 4 imply that, if  has the maximum Hosoya index, we conclude .
In conclusion, when  are almost equal,  has the maximal Hosoya index. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, and 
 are three vertices with 
, 
, and 
 pendent vertices, 
, 
, NS one of 
 is at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 13. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, by Lemmas 1 and 2, we have
        where 
 is one pendent vertex adjacent to 
 in 
.
For 
, by Lemma 1, we have
        where 
 is one pendent vertex adjacent to 
 in 
, 
 is one pendent vertex adjacent to 
 in 
, 
, and
Case 1. If 
, then
 Case 2. If 
, then
 Cases 1 and 2 imply that, if  has the maximum Hosoya index, we conclude . Similarly, we obtain .
Case 3. If 
, then
 Case 4. If 
, then we have
 Cases 3 and 4 imply that, if  has the maximum Hosoya index, we conclude .
In conclusion, when  are almost equal,  has the maximal Hosoya index. □
 Let 
 be the set of unicyclic graphs of the form 
 (as depicted in 
Figure 2), where 
, 
, and 
 are three vertices with 
, 
, and 
 pendent vertices, 
,  
, and one of 
 is at least 2. Let 
 be the graph of the form 
 satisfying 
 almost equal.
Theorem 14. The graph  has the maximum Hosoya index among all graphs in .
 Proof.  For 
, from Lemmas 1 and 2, we have
For 
, by Lemmas 1 and 2, we have
Here, x is a pendent vertex attached at .
Observe that 
,
        where 
y is one pendent vertex attached at 
.
If 
, then we have
Thus, we have .
This implies that, if  has the maximum Hosoya index, we conclude .
As 
 (resp. 
a, 
c) have the same status as shown in 
Figure 2, we also have 
. 
. This is the desired result. □
 Theorem 15. The graph  has the maximum Hosoya index among all graphs in  for .
 Proof.  We need only compare  for .
For 
, as 
, we have 
, and 
. Since 
,  we get 
, this leads to 
. Therefore,
The last inequality holds for a function  that is strictly increasing for .
For 
, we have 
, 
, 
. We may assume 
 without loss of generality. Then,  
, and 
. Thus, 
, and hence 
. Therefore,
The last inequality holds for a function  that is strictly increasing for .
For 
, as 
 are almost equal and 
, we have 
For 
, 
. We may assume 
 without loss of generality. Then,  
, and 
. Thus, 
, and hence 
. Therefore,
The last inequality holds for a function  that is strictly increasing for .
For 
, 
. We may assume 
 without loss of generality. Then,  
, and 
. Thus, 
, and hence 
. Therefore,
The last inequality holds for a function  that is strictly increasing for .
For 
, 
 are almost equal. Then, 
 as 
. Therefore,
For 
, 
 are almost equal. We may assume 
. Then, we have 
, and 
. Thus, 
, and hence 
. Therefore,
The last inequality holds for a function  which is strictly increasing for .
Let 
, 
 are almost equal. We may assume 
. Then, we have 
, and 
. Thus, 
, and hence 
. Therefore,
The last inequality holds for a function  is strictly increasing for .
For 
, since 
 are almost equal, We may assume 
. Then 
, 
. As 
, therefore 
. Thus, we have
The last inequality holds as  is strictly increasing for .
By using the software “Mathematica”, we obtain the following comparison.
 for .
 for .
 for .
 for .
 for .
The direct computation yields to .
From the above discussion, we get the result. □