1 Introduction

Throughout this paper, we consider simple graph \(G=(V,\,E)\) with vertex set V(G) \((|V(G)|=n)\) and edge set E(G). The Laplacian matrix of graph G is \(L(G)=D(G)-A(G)\), where D(G) is the diagonal matrix of vertex degrees and A(G) is the adjacency matrix of G. Let \(\mu _1\ge \mu _2\ge \cdots \ge \mu _{n-1}\ge \mu _n=0\) be the eigenvalues of L(G). The number of spanning trees of G, denoted by \(\kappa (G)\), is the total number of distinct spanning subgraphs of G that are trees. It is well known that

$$\begin{aligned} \kappa (G)=\frac{1}{n}\,\prod ^{n-1}_{i=1}\,\mu _i. \end{aligned}$$

We consider the problem of determining the extremal graphs with the maximum number of spanning trees from some special classes of graphs. The application of this problem is (i) in the area of experimental design [2] and (ii) in the network theory [15]. For calculating \(\kappa (G)\) of a graph G, we do not have any clear formula in the literature except for some special cases. However, in the design of reliable probabilistic networks, the value (or the bound) on the number of spanning trees is very important (see, [22]).

As usual, we denote by \(K_n\) and \(K_{1,n-1}\), the complete graph and the star of order n, respectively. We now recall some definitions in graph theory. Two distinct edges in a graph G are independent if they do not have a common end vertex. A matching in G is a set of pairwise independent edges. A maximum matching in G is a matching of maximum cardinality. The matching number of the graph G, denoted by \(\beta (G)\), is the number of edges in a maximum matching. Obviously, \(\beta (G)=0\) if and only if G is an empty graph. For a connected graph G with \(n\ge 2\) vertices, \(\beta (G)=1\) if and only if \(G\cong K_{1,n-1}\) or \(G\cong K_3\). Thus, we consider graphs with matching number at least 2. The vertex disjoint union of the graphs G and H is denoted by \(G\cup H\). The joint of two graphs G and H is \(G\vee H=\overline{{\overline{G}}\cup {\overline{H}}},\) where \({\overline{G}}\) is the complement of graph G.

Problem 1.1

Given a set \(\mathcal{{G}}\) of graphs, find an upper bound for the number of spanning trees in this set and characterize the graphs at which the maximal number of spanning trees is attained.

This problem attracts much attention in the literature. Li et al. [16] completely resolved this problem for given connectivity or chromatic number of graphs. For bicyclic and tricyclic graphs, this problem has been resolved in [21, 22]. In [1], the authors obtained several sharp upper bounds for \(\kappa (G)\) based on the so-called normalized Laplacian eigenvalues (for details on this subject, see [3, 4]). Ma and Yao [18] studied the number of spanning trees of a class of self-similar fractal models and obtained an approximate numerical value of its spanning tree entropy. For some other excellent results on this topic including lower and upper bounds, please refer to [5, 6, 8,9,10,11,12,13,14,15, 17, 19, 20].

Let \(\mathcal{{G}}_{n,\beta }\) be the set of graphs on n vertices with matching number \(\beta \), and denote by \({\overline{G}}\) the complement graph of G. Feng et al. presented the following result in the proof of Theorem 1.1 [7].

Proposition 1.2

[7] Let \(G\in {\mathcal {G}}_{n,\beta }\) and \(2\le \beta \le \lfloor \frac{n}{2}\rfloor \). Then

$$\begin{aligned} \kappa (G)\le \max \Big \{\,n^{k}(k+1)^{n-2\beta +k} (2\beta -k)^{2\beta -2k-2}:\,\,0\le k\le \beta -1\Big \}, \end{aligned}$$

where equality holds if and only if \(G\cong K_{k+1}\vee \big (K_{2\beta -2k-1}\cup \overline{K_{n+k-2\beta }}\,\big )\).

Hereafter, let

$$\begin{aligned} f(x)&=n^x\,(x+1)^{n-2\beta +x}(2\beta -x)^{2\beta -2x-2}, \,\,\text { and}\\ \varphi (x)&=\ln \,f(x)=x\ln \,n+(n-2\beta +x)\ln \,(x+1)+(2\beta -2x-2)\ln \,(2\beta -x). \end{aligned}$$

Then,

$$\begin{aligned} \varphi '(x)=\ln \,n + \ln \,(x + 1) - 2\ln \,(2\beta - x) + \frac{n - 2\beta -1}{x+1}+\frac{x+ 2}{2\beta -x} \end{aligned}$$

and

$$\begin{aligned} \varphi '(0)= & {} n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) ,\,~\varphi '(\beta -1)\nonumber \\= & {} \frac{n-\beta -1}{\beta }+\ln \left( \frac{n\beta }{(\beta +1)^{2}}\right) >0. \end{aligned}$$
(1.1)

In [7], Feng et al. obtained a sharp upper bound on the number of spanning trees of graph G with given matching number \(\beta \) and the statement is as follows:

Theorem 1.3

[7] Let \(G\in {\mathcal {G}}_{n,\beta }\) and \(2\le \beta \le \lfloor \frac{n}{2}\rfloor \). The following statements hold:

  • (1) For \(\beta = \lfloor \frac{n}{2}\rfloor \), \(\kappa (G) \le n^{n-2}\) with equality if and only if \(G\cong K_{n}\);

  • (2) For \(2\le \beta \le \frac{n}{3}\), \(\kappa (G) \le n^{\beta -1}\beta ^{ n-\beta -1}\) with equality if and only if \(G\cong K_{\beta }\vee \overline{K_{n-\beta }}\).

For the case of \(n=2\beta +2\) and \(\beta \ge 9\), Feng et al. pointed out that (See Remark 1 of [7]), in the class of \({\mathcal {G}}_{n,\beta }\), \(K_1\vee \big (K_{2\beta -1}\bigcup \overline{K_{n-2\beta }}\big )\) is the maximal graph of \(\kappa (G)\). They also raised the problem to solve the case of \(\frac{n}{3}<\beta <\lfloor \frac{n}{2}\rfloor -1\). In this paper, we give a solution to this problem completely (as they have solved the situation of \(\beta =\lfloor \frac{n}{2}\rfloor \) and \(n=2\beta +2\), we only consider the case of \(n\ge 2\beta +3\) in the following).

For \(n\ge 2.3\,\beta \) and \(\beta \ge 9\), in this paper, we give an upper bound on the number of spanning trees of graph G in terms of n and \(\beta \), and the statement is as follows.

Theorem 1.4

Let \(G\in {\mathcal {G}}_{n,\beta }\) with \(n\ge 2.3\,\beta \) and \(\beta \ge 9\). Then

$$\begin{aligned} \kappa (G) \le n^{\beta -1}\beta ^{ n-\beta -1}, \end{aligned}$$

with equality if and only if \(G\cong K_{\beta }\vee \overline{K_{n-\beta }}\).

For \(2\beta +3\le n<2.3\beta \), in this paper, we present an upper bound on the number of spanning trees of graph G in terms of n and \(\beta \), and the statement is as follows.

Theorem 1.5

Let \(G\in {\mathcal {G}}_{n,\beta }\) with \(2\beta +3\le n<2.3\beta \).

  • (1) If \(n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) <0\), then

    $$\begin{aligned} \kappa (G) \le \max \Big \{(2\beta )^{2\beta -2},\,n^{\beta -1}\,\beta ^{n-\beta -1}\Big \}. \end{aligned}$$
  • (2) If \(n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) >0\), then \(\varphi '(x)\) contains exactly two roots in the interval \((0,\beta -1)\). Let \(\alpha \) be the smallest root of \(\varphi '(x)\) in the interval \((0,\beta -1)\). Then,

    $$\begin{aligned} \kappa (G) \le \max \Big \{f(\beta -1),\,f( \lceil \alpha \rceil ),\,f(\lfloor \alpha \rfloor )\Big \}. \end{aligned}$$

As \(K_n\) is a special case, by comparing the results of Theorem 1.3 (2) and Theorems 1.41.5, it is natural to ask the following problem:

Problem 1.6

Let \(G\in {\mathcal {G}}_{n,\beta }\) with \(2\beta +3\le n< 2.3\beta \). Whether \(\kappa (G) \le n^{\beta -1}\beta ^{n-\beta -1}\) is true or not, that is, whether \(n^{\beta -1}\beta ^{n-\beta -1}\) also uniquely maximizes \(\kappa (G)\) in Theorem 1.5?

However, the answer to Problem 1.6 is negative, as we have the following example.

Example 1.7

Let \(G\in {\mathcal {G}}_{n,\beta }\), where \(2\beta +3\le n<2.3\beta \).

  • (i) Let \(\beta =10000\) and \(n=20004\). Then, \(\varphi '(0)<4+\ln \left( \frac{5001}{10000^2}\right) <-5.9\), and thus, the condition of Theorem 1.5 (1) is satisfied. Using MATLAB, we have

    $$\begin{aligned}&2(\beta -1)\ln \,2\beta -(\beta -1)\ln \,n-(n-\beta -1)\ln \,\beta \\&\quad =2\times 9999\times \ln (2\times 10000)-9999\times \ln \,20004-10003\times \ln \,10000>6891, \end{aligned}$$

    and thus,

    $$\begin{aligned} 2(\beta -1)\ln \,2\beta >(\beta -1)\ln \,n+(n-\beta -1)\,\ln \,\beta , \end{aligned}$$

    which implies that \((2\beta )^{2\beta -2}>n^{\beta -1}\,\beta ^{n-\beta -1}\).

  • (ii) Let \(\beta =10000\) and \(n=21000\). Then, using Matlab it follows that

    $$\begin{aligned}&\varphi '(0)>999+\ln \left( \frac{5250}{10000^2}\right)>989,~\varphi '(226)>0.005, ~\varphi '(227)<-0.009,\\&\varphi '(5598)<-3.6\times 10^{-4}~ \text{ and } ~\varphi '(5599)>1.79\times 10^{-5}, \end{aligned}$$

    and thus, Theorem 1.5 (2) implies that the smallest root of \(\varphi '(x)\) is in (226, 227). Using Matlab, one can easily see that

    $$\begin{aligned} f(226)=\max \Big \{f(226),\,f(227),\,f(9999)\Big \}. \end{aligned}$$

2 Proofs of Theorems 1.4 and 1.5

This section is dedicated to the proofs of Theorems 1.4 and 1.5 . We firstly give the proof to Theorem 1.4.

Proof of Theorem 1.4

Let \(g(x)=2.3\beta ^{2.3}-(2\beta -x)^{2}(x+1)^{0.3}\), where \(0\le x\le \beta -1.\) Then,

$$\begin{aligned} g'(x)=0.1(x + 1)^{-0.7}(23x+20-6\beta )(2\beta - x). \end{aligned}$$
(2.1)

Since \(2\beta - x>0\) always holds for \(0\le x\le \beta -1\) and \(\beta \ge 9\), by (2.1) we have

$$\begin{aligned} g(x)&\ge g\left( \frac{6\beta -20}{23}\right) \nonumber \\&=2.3\beta ^{2.3}-\frac{400}{12167}\times 3^{0.3}\times 23^{0.7}(2\beta + 1)^{2.3} \nonumber \\&=\frac{1}{121670}\,\beta ^{2.3}\left( 279841-4000\times 3^{0.3}\times 23^{0.7}\left( 2+ \frac{1}{\beta }\right) ^{2.3}\right) \nonumber \\&\ge \frac{1}{121670}\beta ^{2.3}\left( 279841-4000\times 3^{0.3}\times 23^{0.7}\left( 2+ \frac{1}{9}\right) ^{2.3}\right) >0. \end{aligned}$$
(2.2)

When \(n\ge 2.3\,\beta \) and \(0\le k\le \beta -2\), by (2.2), we obtain

$$\begin{aligned}&\left( \frac{n(k+1)}{(2\beta -k)^2}\right) ^{\beta -k-1}\left( \frac{\beta }{k+1}\right) ^{n-\beta -1}\\&\quad =\left( \frac{n\beta ^{1.3}(k+1)}{(2\beta -k)^2(k+1)^{1.3}}\right) ^{\beta -k-1}\left( \frac{\beta }{k+1}\right) ^{n-2.3\beta +1.3k+0.3}\\&\quad \ge \left( \frac{n\beta ^{1.3}}{(2\beta -k)^2(k+1)^{0.3}}\right) ^{\beta -k-1}\\&\quad \ge \left( \frac{2.3\beta ^{2.3}}{(2\beta -k)^2(k+1)^{0.3}}\right) ^{\beta -k-1}>1. \end{aligned}$$

Thus, for \(0\le k\le \beta -2\) and \(\beta \ge 9\),

$$\begin{aligned} n^{k}(k+1)^{n-2\beta +k}(2\beta -k)^{2\beta -2k-2}<n^{\beta -1}\beta ^{n-\beta -1}, \end{aligned}$$

and hence, the result follows from Proposition 1.2. \(\square \)

To present the proof of Theorem 1.5, we need more lemmas as follows:

Lemma 2.1

If \(2\beta +3\le n<2.3\beta \), then there exists some real number p with \(0< p<\beta -1\) such that \(\varphi '(x)\) is a strictly decreasing function for \(0\le x \le p\), and \(\varphi '(x)\) is a strictly increasing function for \(p\le x\le \beta -1\).

Proof

For \(0\le x\le \beta -1\), we define \(\psi (x)\) as follows:

$$\begin{aligned} \psi (x)&=(x+1)^2\,(2\beta -x)^2\,\varphi ''(x)\\&=-x^3+(4\beta -n)x^2+2\left( 2n\beta \right. \\&\left. \quad -2\beta ^2+2\beta +1\right) x+8\beta ^3+8\beta ^2+6\beta +2-4n\beta ^2. \end{aligned}$$

Claim 1

\(\psi (x)\) is a strictly increasing function on \([0,\,\beta -1]\).

Proof of Claim 1

Note that \(\psi ''(x)=2\,(4\beta -n -3x)\). Then \(\psi ''(x)<0\) for \( x>\frac{1}{3}\,(4\beta -n)\) and \(\psi ''(x)>0\) for \(x<\frac{1}{3}\,(4\beta -n)\), that is, \(\psi '(x)\) is a strictly increasing function on \(0\le x\le \frac{1}{3}\,(4\beta -n)\) and a strictly decreasing function on \(\frac{1}{3}\,(4\beta -n)\le x\le \beta -1\). Thus,

$$\begin{aligned} \psi '(x)\ge \min \Big \{\psi '(0),\,\psi '(\beta -1)\Big \}. \end{aligned}$$

Recall that \(0\le x\le \beta -1\) and \(n\ge 2\beta \). Thus, \(\psi '(\beta -1)=\beta ^2+2(\beta +1)(n+1)-3>0\) and \(\psi '(0)=4n\beta - 4\beta ^2 + 4\beta + 2\ge 4\beta ^2 + 4\beta + 2>0\). Therefore, \(\psi '(x)>0\), and hence, \(\psi (x)\) is a strictly increasing function on \([0,\,\beta -1]\). This completes the proof of Claim 1.

Since \(0\le x\le \beta -1\) and by Claim 1, we have \(\psi (0)\le \psi (x)\le \psi (\beta -1)\). Again since \(\beta \ge 11\) by \(2\beta +3\le n<2.3\beta \), we obtain

$$\begin{aligned} \psi (0)&=-4\beta ^2\,n + 8\beta ^3 + 8\beta ^2 + 6\beta + 2\\&\le -4\beta ^2(2\beta +3) + 8\beta ^3 + 8\beta ^2 + 6\beta + 2=-2(2\beta ^2 - 3\beta - 1)<0, \end{aligned}$$

and

$$\begin{aligned} \psi (\beta -1)&=(\beta + 1)(4\beta - n(\beta +1) + 7\,\beta ^2 + 1)\\&>(\beta + 1)\,\Big (4\,\beta -2.3\,\beta \,(\beta +1) + 7\,\beta ^2 + 1\Big )\\&=(\beta + 1)(1.7\,\beta +4.7\,\beta ^2 + 1)>0. \end{aligned}$$

Combining with Claim 1 and \(\psi (0)<0<\psi (\beta -1)\), we can conclude that there is some real number p with \(0< p<\beta -1\) such that \(\psi (p)=0\). Once again, Claim 1 implies that \(\psi (x)<0\) for \(0\le x<p\), \(\psi (x)>0\) for \(p<x\le \beta -1\) and \(\psi (p)=0\). Recall that \(\psi (x)=(x+1)^2(2\beta -x)^2\varphi ''(x)\) and \(0\le x\le \beta -1\). Thus, \(\varphi ''(x)<0\) for \(0\le x<p\), \(\varphi ''(x)>0\) for \(p<x\le \beta -1\) and \(\varphi ''(p)=0\). This completes the proof of this result. \(\square \)

Lemma 2.2

If \(n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) > 0\) and \(2\beta +3\le n<2.3\beta \), then \(\varphi '(0.2\beta )<0\) and \(\varphi '(x)\) contains exactly two roots in the interval \((0,\beta -1)\).

Proof

By (1.1), we have \(\varphi '(0)>0\) and \(\varphi '(\beta -1)>0\). Combining this with Lemma 2.1, to complete the proof, it suffices to show that \(\varphi '(0.2\beta )<0.\)

Since \(2\beta +3\le n<2.3\beta \), we have

$$\begin{aligned} \varphi '(0.2\beta )&=\ln \,(0.2\beta +1) - 2\ln \,(1.8\beta ) + \ln \,n + \frac{n - 2\beta -1}{0.2\beta +1} +\frac{0.2\beta + 2}{1.8\beta }\nonumber \\&<\ln \,(0.2\beta +1) - 2\ln \,(1.8\beta ) + \ln \,(2.3\beta ) + \frac{0.3\beta -1}{0.2\beta +1} +\frac{0.2\beta + 2}{1.8\beta }\nonumber \\&= \ln \,\left( \frac{2.3\beta \,(0.2\beta +1)}{(1.8\beta )^2}\right) + \frac{29\beta ^2 - 60\beta + 100}{18\beta (\beta + 5)}. \end{aligned}$$
(2.3)

Denote by

$$\begin{aligned} {h(t)=\ln \,\left( \frac{2.3t\,(0.2t+1)}{(1.8t)^2}\right) + \frac{29t^2 - 60t + 100}{18t(t + 5)}.} \end{aligned}$$

Then, \(h'(t)=\displaystyle {\frac{5(23t^2 - 130t - 100)}{18t^2(t+5)^2}}\), which implies that \(h'(t)>0\) for \(t>\displaystyle {\frac{65+15\sqrt{29}}{23}}\) and \(h'(t)<0\) for \(11\le t<\displaystyle {\frac{65+15\sqrt{29}}{23}}\). Furthermore, since \(h(11)<-0.64\) and \(h(+\infty )=\ln \left( \frac{23}{162}\right) +\frac{29}{18}<-0.34\), we can conclude that \(h(t)<0\) for \(t\ge 11\). Combining this with \(\beta \ge 11\) by \(2\beta +3\le n<2.3\beta \), we have \(\varphi '(0.2\beta )<0\) by (2.3), as desired. \(\square \)

We are now ready to prove Theorem 1.5.

Proof of Theorem 1.5

  • (1) \(n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) <0\). Then \(\varphi '(0)<0\) and \(\varphi '(\beta -1)>0\), by (1.1). Combining this with \(\varphi '(x)\) being a strictly decreasing function on [0, p] and a strictly increasing function on \([p,\beta -1]\) by Lemma 2.1, we can conclude the existence of some real number q with \(0<q<\beta -1\) such that \(\varphi '(x)<0\) holds for \(0\le x<q\), \(\varphi '(x)>0\) holds for \(q<x\le \beta -1\) and \(\varphi '(q)=0\). Thus, \(\varphi (x)\) is a strictly decreasing function on \([0,\,q]\) and a strictly increasing function on \([q,\,\beta -1]\). Since \(\varphi (x)=\ln \,f(x)\) with Proposition 1.2, we obtain

    $$\begin{aligned} \kappa (G)\le & {} \max \Big \{n^{k}(k+1)^{n-2\beta +k}(2\beta -k)^{2\beta -2k-2}:\,0\le k\le \beta -1\Big \}\\= & {} \max \Big \{(2\beta )^{2\beta -2},\,n^{\beta -1}\,\beta ^{n-\beta -1}\Big \}. \end{aligned}$$
  • (2) \(n-2\beta -1+\frac{1}{\beta }+\ln \left( \frac{n}{4\beta ^{2}}\right) >0\). By Lemma 2.2, \(\varphi '(0.2\beta )<0\) and \(\varphi '(x)\) contains exactly two roots in the interval \((0,\beta -1)\). Let \(\alpha \) be the smallest root of \(\varphi '(x)\) in the interval \((0,\beta -1)\). Then \(\varphi '(x)>0\) holds for \(0<x<\alpha \), as \(\varphi '(0)>0\).

Recall that \(\varphi '(x)\) is strictly decreasing on [0, p] and strictly increasing on \([p,\beta -1]\) by Lemma 2.1. Combining this with \(\varphi '(x)>0=\varphi '(\alpha )\) holds for \(0\le x<\alpha \), \(\varphi '(\beta -1)>0\) and \(\varphi '(0.2\beta )<0\) by Lemma 2.2, we can conclude that \(\alpha<p<\beta -1\).

In this case, \(\varphi '(p)<\varphi '(\alpha )=0.\) Since \(\varphi '(x)\) is strictly increasing on \([p,\beta -1]\) by Lemma 2.1 and since \(\varphi '(\beta -1)>0\), there exists \(\gamma \in (p,\beta -1)\) such that \(\varphi '(\gamma )=0\). Once again, Lemma 2.2 implies that \(\varphi '(x)<0\) for \(x\in (\alpha ,\gamma )\) and \(\varphi '(x)>0\) for \(x\in (0,\alpha )\bigcup (\gamma ,\beta -1).\) Thus, \(\varphi (x)\) is strictly increasing for \(x\in [0,\alpha ]\), \(\varphi (x)\) is strictly decreasing for \(x\in [\alpha ,\gamma ]\) and \(\varphi (x)\) is strictly increasing for \(x\in [\gamma ,\beta -1].\) This completes the proof of (2). \(\square \)