Introduction

Let \(G=(V(G), E(G))\) be a simple graph with vertex set V(G) and edge set E(G). By order and size of G, we mean the number of vertices and the number of edges of G, respectively, and we denote it by |V(G)| and |E(G)|, respectively. The maximum degree of G is \(\Delta (G)\) (or \(\Delta \) if G is clear from the context). We denote the complete graph of order n by \(K_n\) and the star graph of order \(n+1\) by \(K_{1, n}\). For any vertex u of G, we use \({\mathrm{deg}}(u)\) to denote the degree of u. By N(u) we mean the neighborhood set of u. Let H be an induced subgraph of G. Then \(N_{H}(u)=N(u)\cap V(H)\), is the set of neighbors of u in H. An r-matching in G is a set of r pairwise non-incident edges. The number of r-matchings in G is denoted by p(Gr). It is consistent to define \(p(G, 0)=1\). The matching polynomial of G is given by

$$\begin{aligned} \mu (G, x)=\sum _{r=0}^{\lfloor {\frac{n}{2}}\rfloor }(-1)^{r}p(G, r)x^{n-2r}, \end{aligned}$$

where \(n=|V(G)|\). By way of example, the matching polynomial of a path on four vertices is \(x^4-3x^2+1\). The roots of \(\mu (G, x)\) are called the matching roots (or matching zeros) of G. The notation mult\((\theta ,G)\) is used for the multiplicity of \(\theta \) as a zero of \(\mu (G, x)\). We also denote the multiset of the roots of the matching polynomial of G by R(G). We use exponent symbol to show the multiplicities of the elements of R(G).

The matching polynomial is related to the characteristic polynomial of G, which is defined to be the characteristic polynomial of the adjacency matrix of G. In particular these two coincide if and only if G is a forest [7]. Also the matching polynomial of any connected graph is a factor of the characteristic polynomial of some tree [6]. The theory of matching polynomial is well elaborated in [3, 4, 6,7,8,9].

A graph is said to be integral if eigenvalues of its adjacency matrix consist entirely of integers. The notion of integral graphs dates back to Harary and Schwenk [10]. Furthermore, several explicit constructions of integral graphs of special types appear in the literature, see [2] and references therein.

The idea of studying graphs with integer matching polynomial zeros was first appeared in [1], where Akbari, Csikvari, etc., introduced the concept of matching integral graphs. A graph is called matching integral if all zeros of its matching polynomial are integers. They characterized all traceable graphs which are matching integral. They studied matching integral regular graphs and showed that for \(k\ge 2\) there is only one connected matching integral k-regular graph, namely \(K_7{\setminus } \left( E(C_3)\cup E(C_4)\right) \). Furthermore, it has been proved that there is no matching integral claw-free graph and \(K_2\) is the only connected matching integral graph with a perfect matching.

Motivated by the previous work, we are interested to characterize matching integral graphs of small order. To this end, matching integral graphs on at most seven vertices have been studied by the author. It has been shown that there are exactly eight connected matching integral graphs up to seven vertices. In this paper, we determine all connected matching integral graphs on eight vertices. We show that there are only two connected graphs with eight vertices whose all matching roots are integers. Our work has been organized into two sections. The next section contains necessary background information and various preliminary-type results including matching polynomial of a graph. The following section is devoted to studying matching integral graphs on eight vertices.

Preliminaries

In order to establish our results, we need the following theorems and lemmas:

Remark 2.1

A graph with odd order has 0 as a matching root and if \(\theta \) is a matching zero of a graph, then so is \(-\theta \).

Theorem 2.2

[11] For any graphG, the zeros of\(\mu (G, x)\)are all real. If \(\Delta >1\), then the zeros lie in the interval\((-2\sqrt{\Delta -1}, ~ 2\sqrt{\Delta -1})\).

Theorem 2.3

[5] IfGis a connected graph, then the largest zero of\(\mu (G, x)\)has multiplicity 1. In other words, it is a simple zero.

Theorem 2.4

[6] If \(\theta =0\), then mult\((\theta , G)\)is the number of vertices inGmissed by a maximum matching.

Theorem 2.5

[11] LetGbe a graph andube a vertex of it. Then the zeros of\(\mu (G{\setminus } u, x)\)interlace those of\(\mu (G, x)\), i.e., if\(\theta _1\ge \theta _2\ge \cdots \ge \theta _n\)and\(\eta _1\ge \eta _2\ge \cdots \ge \eta _{n-1}\)are matching zeros ofGand\(G{\setminus } u\), respectively, then

$$\begin{aligned} \theta _1\ge \eta _1\ge \theta _2\ge \eta _2\ge \cdots \ge \eta _{n-1}\ge \theta _n. \end{aligned}$$

Theorem 2.6

[12] For a connected graphG, if\({\mathrm {mult}}(\theta , \textit{G})\ge 2\), then there is a vertexuofGsuch that\({\mathrm {mult}}(\theta , \textit{G}{\setminus } u)= {\mathrm {mult}}(\theta , \textit{G})+1\).

Theorem 2.7

[1] If a graphGhas a perfect matching, then its matching polynomial has a zero in the interval (0, 1]. If it has no zero in the interval (0, 1), then it is the disjoint union of some\(K_2\).

It follows from Theorem 2.7 that the only connected matching integral graph which has a perfect matching is \(K_2\).

Theorem 2.8

[1] LetGbe a graph with at least one edge. Assume that mult\((0, G)=t\). Then the interval\((0,\sqrt{f(t)}]\)contains a zero of the matching polynomial ofG, wheref(t) is defined as:

$$\begin{aligned} f(t)=\left\{ \begin{array}{ll} t+1 &{} \text{ if }\ t\ne 1, \\ 3 &{} \text{ if }\ t=1. \end{array} \right. \end{aligned}$$

Lemma 2.9

[5] LetGbe a graph andube a vertex of it. Then for each positive integerr, we have\(p(G, r)=p(G{\setminus } u, r)+\sum _{v\in N(u)} p(G{\setminus } uv, r-1)\).

By following Ghorbani’s definition [4], \({\fancyscript{G}} (r, k, t; p, q)\) is the set of graphs obtained by adding a new vertex u to the graph \(rK_{1, k}\cup tK_1\) and joining it to the other vertices by \(p+q\) edges such that the resulting graph is connected and u is adjacent with q centers of the stars. Clearly, \(r+t\le p\le r(k+1)+t\) and \(0\le q\le r\).

The notations K(ktl) and \(K'(k, t;\,l)\) are used for the graphs \({\fancyscript{G}}(1, k, t;\,l+t, 0)\) and \({\fancyscript{G}}(1, k, t; l+t+1, 1)\), respectively. Their matching polynomials are

$$\begin{aligned}&\mu (K(k, t;\,l), x)=x^{k+t-2}(x^4-(k+t+l)x^2+(l+t)(k-1)+t), \end{aligned}$$
(1)
$$\begin{aligned}&\mu (K'(k, t;\,l), x)=x^{k+t-2}(x^4-(k+t+l+1)x^2+(l+t)(k-1)+t). \end{aligned}$$
(2)

The graph \({\fancyscript{G}}(r, 1, 0;\,s, q)\), where \(q=s-r\) and \(r\le s\le 2r\) is denoted by S(rs). Its matching polynomial is

$$\begin{aligned} \mu (S(r, s), x)=x(x^2-s-1)(x^2-1)^{r-1}. \end{aligned}$$
(3)

The graph \({\fancyscript{G}}(r, k, 0;\,r, r)\) is denoted by T(rk) and its matching polynomial is

$$\begin{aligned} \mu (T(r, k), x)=x^{r(k-1)+1}(x^2-r-k)(x^2-k)^{r-1}, \end{aligned}$$
(4)

For any \(G\in {\fancyscript{G}} (r, 3, t;\,p, q)\) the set of graphs obtained by adding s copies of \(K_3\) to G and joining them by l edges to the vertex u of G to make a connected graph is denoted by \({\fancyscript{H}}(r, s, t;\,p, q, l)\). The notation L(tl) is used for the graph \({\fancyscript{H}}(0, 1, t;\,t, 0, l)\), for \(l=1, 2, 3\) and its matching polynomial is

$$\begin{aligned} \mu (L(t, l), x)=x^{t}(x^4-(t+l+3)x^{2}+3t+l). \end{aligned}$$
(5)

Theorem 2.10

[4] LetGbe a connected graph andz(G) be the number of its distinct matching zeros.

  1. 1.

    If\(z(G)=2\), then\(G=K_2\).

  2. 2.

    If\(z(G)=3\), thenGis either a star or\(K_3\).

  3. 3.

    If\(z(G)=4\), thenGis a non-star graph with 4 vertices.

  4. 4.

    If\(z(G)=5\), thenGis one of the graphs\(K (k, t;\,l), K'(k, t;\,l), L(t, l), T(r, k), S(r, s) \), forsome integersktlrsor a connected non-star graph with five vertices.

Lemma 2.11

[4] LetGbe a connected graph. Then the following hold:

  1. 1.

    If\(R(G)=\{0, (\pm \alpha )^r, (\pm \beta )\}\), \(0<\alpha <\beta \), \(r\ge 2\), then\(G=S(r+1, \beta ^{2}-1)\).

  2. 2.

    If\(R(G)=\{0^t, (\pm \alpha ), (\pm \beta )\}\), \(0<\alpha <\beta \), \(t\ge 2\), thenGis one of the graphs\(K(k, t';\,l )\), \(K'(k, t';\,l)\) or L(tl) for some integers\(k, t', l, t\).

  3. 3.

    If\(R(G)=\{0^t, (\pm \alpha )^r, (\pm \beta )\}\), \(0<\alpha <\beta \), \(t\ge 2\), \(r\ge 2\), then \(G=T(r', k)\)for some integers\(r'>2\) and k.

Note that Lemma 2.11 is derived from the proof of Theorem 2.10.

Remark 2.12

[4] The graphs K(ktl) and \(K(l+t, k-l;\,l)\) are isomorphic. The same is true for the graphs \(K'\).

Matching Integral Graphs on Eight Vertices

In this section, we study connected graphs on eight vertices, whose all matching roots are integers. The two lemmas which follow provide information about the root system of G. Theorem 3.3 characterizes matching integral graphs on eight vertices.

Lemma 3.1

Let G be a connected graph on eight vertices. If G is matching integral, then G has a three-matching.

Proof

Let n and m be the order and the size of G, respectively. Since \(\Delta \le 7\), Theorem 2.2 implies that the zeros of \(\mu (G, x)\) lie in the interval \([-4, 4]\). Assume to the contrary that G does not have a matching of size 3. Note that by Theorem 2.7 we know that G does not have a perfect matching. Consequently, mult\((0, G)\not =0, 2\). Furthermore, since n is even, multiplicity of 0 as a root of \(\mu (G, x)\) is even. Now, it follows from Theorem 2.3 that the root system of G is either \(R(G)=\{0^4, \pm \theta _1, \pm \theta _2\}\), \(0<\theta _1<\theta _2\le 4\) or \(R(G)=\{0^6, \pm \theta \}\), \(0<\theta \le 4\).

Case 1 If \(R(G)=\{0^4, \pm \theta _1, \pm \theta _2\}\), then using Lemma 2.11, we find that G is one of the graphs K(ktl), \(K'(k, t;\,l)\) or L(tl), for some integers ktl. Furthermore, as G is connected, \(m\ge 7\).

If G is a K(ktl), then from (1) we have \(k+t=6\), \(m=l+6\) and \(p(G, 2)=(l+t)(k-1)+t\). Since the squares of the roots of matching polynomial of a graph sum to its number of edges, we have \(m=\theta _1^{2}+\theta _2^{2}\). As the product of squares of the nonzero roots of matching polynomial of a graph is equal to its number of maximum matchings, \(p(G, 2)=\theta _1^{2}\theta _2^{2}\). Therefore \(l+6=\theta _1^{2}+\theta _2^{2}\). Now, since in a K(ktl), \(l\le k\) we have \(l\le 6\). This implies that \(\theta _1=1\) and \(\theta _2=3\). Hence \(m=10\), \(p(G, 2)=9\) and \(l=4\). Thus \((l+t)(k-1)+t=9\) and so \(k(4+t)=13\), a contradiction.

If G is a \(K'(k, t;\,l)\), then from (2) we see that \(k+t=6\),

\(m=l+7\) and \(p(G, 2)=(l+t)(k-1)+t\). Note that in a \(K'(k, t;\,l)\), \(l\le k\). Now, a similar argument as above shows that

either \(\theta _1=1, \theta _2=3\) or \(\theta _1=2, \theta _2=3\). In the first case, we have \(p(G, 2)=9\) and \(l=3\). Hence \((l+t)(k-1)+t=9\) and so \(k(3+t)=12\), a contradiction. In the second case, we have \(p(G, 2)=36\) and \(l=6\). This gives that \(k=6\) and \(t=0\), contradicting the condition \((l+t)(k-1)+t=36\).

If G is an L(tl), then by (5) we have \(t=4\), \(m=l+7\) and \(p(G, 2)=l+12\). Now, since \(l\le 3\) and \(m=\theta _1^2+\theta _2^2\), we deduce that \(\theta _1=1\) and \(\theta _2=3\). Hence \(l=3\) and \(p(G, 2)=15\). However \(p(G, 2)=\theta _1^2\theta _2^2=9\), a contradiction.

Case 2 If \(R(G)=\{0^6, \pm \theta \}\), then by Theorem 2.10 we conclude that \(G=K_{1, 7}\) which is not matching integral. This completes the proof. □

Lemma 3.2

Let G be a connected graph on eight vertices which is matching integral. Then\(R(G)=\{0^2,\pm 1, \pm 2, \pm 3 \}\).

Proof

Let m be the size of G. By Theorem 2.2 we know that the zeros of \(\mu (G, x)\) lie in the interval \([-4, 4]\). Now, Theorem 2.7 and the previous lemma imply that the maximum size of a matching in G is 3, so mult\((0, G)=2\). Furthermore, from Theorem 2.8 we derive that 1 is a matching root G. Consequently, the root system of G can be expressed as one of the following forms:

Case 1\(R(G)=\{0^2, (\pm 1)^2, \pm \theta \}\), \(1<\theta \le 4\). Now, Lemma 2.11 implies that \(G=T(r, k)\), for some integers rk, \(r>2\). Moreover, it follows from (4) that \(r(k-1)=1\), a contradiction.

Case 2\(R(G)=\{0^2,\pm 1, \pm \theta _1, \pm \theta _2 \}\), \(2\le \theta _1<\theta _2\le 4\). First, assume that \(\theta _2=4\). Hence we may write \(R(G)=\{0^2,\pm 1, \pm \theta , \pm 4\}\), \(\theta \in \{2, 3\}\). This gives that \(m=\theta ^2+17\ge 21\). Now, by Theorem 2.6 there is a vertex u of G such that mult\((0, G{\setminus } u)=3\). It follows that \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\), \(0<\eta _1<\eta _2<4\) or \(R(G{\setminus } u)=\{0^3, (\pm \eta )^2\}\), \(0<\eta <4\). Furthermore, as \({\mathrm{deg}}(u)\le 7\), \(|E(G{\setminus } u)|\ge 14\).

If \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\), then \(G{\setminus } u \) can be a connected graph or a disconnected graph. First, suppose that \(G{\setminus } u\) is connected. Using Lemma 2.11, we see that \(G{\setminus } u\) is one of the graphs K(ktl), \(K'(k, t;\,l)\) or L(tl), for some integers ktl. If \(G{\setminus } u\) is a \(K'(k, t;\,l)\), then from (2) it is clear that \(k+t=5\) and \(|E(G{\setminus } u)|=l+6\). As \(l\le k\), we have \(|E(G{\setminus } u)|\le 11\), a contradiction. If \(G{\setminus } u\) is a K(ktl), then since K(ktl) is a subgraph of \(K'(k, t; l)\), we conclude that \(|E(G{\setminus } u)|\le 11\), a contradiction. If \(G{\setminus } u\) is an L(tl), then it follows from (5) that \(t=3\) and \(|E(G{\setminus } u)|=l+6\). Since \(l\le 3\) we have \(|E(G{\setminus } u)|\le 9\), a contradiction. Next, assume that \(G{\setminus } u\) is not connected. Since \(|E(G{\setminus } u)|\ge 14\), we deduce that \(G{\setminus } u\) must be the union of \(K_1\) and a connected graph with six vertices, say \(G_1\). On the other hand, \(R(G_1)=\{0^2, \pm \eta _1, \pm \eta _2 \}\). Therefore \(G_1\) is of the graphs \(K(k', t';\,l')\), \(K'(k', t';\,l')\) or \(L(t'\!, l')\) for some integers \(k', t' , l'\). In each case, a similar argument as above can be applied to the graph \(G_1\) to conclude that \(|E(G_1)|<14\), a contradiction.

If \(R(G{\setminus } u)=\{0^3, (\pm \eta )^2\}\), then by Theorem 2.3, \(G{\setminus } u\) is not connected. Now, just as in the previous case, we see that \(G{\setminus } u\) has a component with six vertices. However, it is not possible according to the root system of the \(G{\setminus } u\). This proves that 4 is not the largest matching zero of G and so \(R(G)=\{0^2, \pm 1, \pm 2, \pm 3\}\). □

Armed with the above results, we are now ready to prove the main theorem.

Theorem 3.3

Let G be a connected matching integral graph on eight vertices. Then G is one of the following graphs:

figure a

Proof

The proof of the theorem is quite long, and so we summarize here the plan of the proof. The main idea is to gain information about the structure of G by describing the structure of \(G{\setminus } u\), for some vertex u of G and then finding the possible neighbors of u in \(G{\setminus } u\). To this end, first using the root system of G, we obtain the size of G, the number of two matchings and three matchings in G. Then we delete a vertex u of G such that the multiplicity of zero increases by one in \(G{\setminus } u\). The number of two matchings in G gives us the sum of squares of the vertex degrees of G, which later and in case \(G{\setminus } u\) is connected, will be used to determine the neighbors of u in \(G{\setminus } u\). This way we can construct graphs whose number of two matchings coincides with the number of two matchings in G. In fact we shrink the set of possible graphs. So we only need to check the number of three matchings in the resulting graphs to determine G.

By Lemma 3.2 we have \(R(G)=\{0^2, \pm 1, \pm 2, \pm 3\}\). So \(\mu (G, x)= x^8-14x^6+49x^4-36x^2\). This already gives that \(m=14\), \(p(G, 2)=49\) and \(p(G, 3)=36\). Now, by Theorem 2.6 we know that there exists a vertex u of G such that \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\), \(0<\eta _1<\eta _2<3\) or \(R(G{\setminus } u)=\{0^3, (\pm \eta )^2\}\), \(0<\eta <3\). Let \(V(G)=\{u, v_1, \ldots , v_7\}\), \(d_1, \ldots , d_8\) be the degree sequence of G, where \(d_8={\mathrm{deg}}(u)\) and \(d'_1, \ldots , d'_7\) be the degree sequence of \(G{\setminus } u\). Since \(p(G, 2)=\begin{pmatrix} 14 \\ 2 \end{pmatrix}-\sum _{i=1}^{8} \begin{pmatrix} d_i \\ 2 \end{pmatrix},\) we deduce that \(\sum _{i=1}^{8}{d_i}^2=112\). On the other hand, it is easy to see that

$$\begin{aligned} \sum _{i=1}^{8} d_{i}^2=({\mathrm{deg}}(u))^2+\sum _{i=1}^{7}(d'_{i}+\theta _i)^2, \end{aligned}$$

where \(\theta _i=1\), if \(v_i\in N(u)\) and \(\theta _i=0\), otherwise. Since \(\sum _{i=1}^{7}\theta _{i}={\mathrm{deg}}(u)\), we have

$$\begin{aligned} ({\mathrm{deg}}(u))^2+{\mathrm{deg}}(u)+\sum _{i=1}^{7}d'^2_{i}++2\sum _{i=1}^{7}d'_{i}\theta _i=112,\ \ \ \theta _i=0, 1. \end{aligned}$$
(6)

Let \(m'=|E(G{\setminus } u)|\). We know that \(p(G{\setminus } u, 2)=\begin{pmatrix} m' \\ 2 \end{pmatrix}-\sum _{i=1}^{7} \begin{pmatrix} d'_i \\ 2 \end{pmatrix}\). From this we conclude that

$$\begin{aligned} \sum _{i=1}^{7}d'^2_{i}=2\left[ \begin{pmatrix} m' \\ 2 \end{pmatrix}+m'-p(G{\setminus } u, 2)\right] . \end{aligned}$$
(7)

Later in this section we will use Eqs. (6) and (7) to find the degree sum of vertices of \(G{\setminus } u\) which are adjacent to u in G. In the following, we distinguish three cases:

Case 1 \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\) and \(G{\setminus } u\) is connected:


Since \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\) and \(G{\setminus } u\) is connected, by Lemma 2.11 we know that \(G{\setminus } u\) is one of the graphs K(ktl), \(K'(k, t;\,l)\), or L(tl) for some integers ktl.

Subcase 1.1 If \(G{\setminus } u\) is a K(ktl), then by (1) we have \(k+t=5\), \(m'=l+5\) and \(p(G{\setminus } u, 2)=(l+t)(k-1)+t\). Furthermore, \(m=m'+{\mathrm{deg}}(u)=14\), so \({\mathrm{deg}}(u)=9-l\). Now, substituting these values back into (7) and then (6) yields the following identity:

$$\begin{aligned} \sum _{i=1}^{7}d'_{i}\theta _i=8l+5t-(l^2+t^2+lt+4),\quad \theta _{i}\in \{0, 1\}. \end{aligned}$$
(8)

Since \(\theta _i=1\), if \(v_i\in N(u)\) and \(\theta _i=0\), otherwise, we deduce that \(\sum _{i=1}^{7}d'_{i}\theta _i\) is the degree sum of vertices of \(G{\setminus } u\) which are connected to u in G. We know that in a K(ktl), \(l\le k\). This gives that \({\mathrm{deg}}(u)\ge 4\). In the following table, first using \({\mathrm{deg}}(u)\) and l the subgraph \(G{\setminus } u\) is described. Then by (8), the possible degrees of neighbors of u in \(G{\setminus } u\) are determined. This helps to construct the graph G. Note that in case of \({\mathrm{deg}}(u)=7\), since \(N(u)=V(G{\setminus } u)\), \(\theta _i=1\) for \(i=1,\ldots , 7\), so \(\sum _{i=1}^{7}d'_{i}\theta _i=\sum _{i=1}^{7}d'_{i}=14\). However, Table 1 shows that it is not possible that \({\mathrm{deg}}(u)=7\).

Table 1 Data of possible matching integral graphs G with eight vertices when \(G{\setminus } u\) is a K(ktl) graph
Fig. 1
figure 1

Graphs K(5, 0; 5), \(H_1\), K(4, 1; 4), \(H_2\), \(H_3\), K(3, 2; 3), \(H_4\), K(4, 1; 3) and \(H_5\)

It is easy to see that the graphs \(H_1\) and \(H_4\) are isomorphic. In the graph \(H_1\) we have \(p(H_1{\setminus } u, 3)=0\). Furthermore, \(H_1{\setminus } uv_i= K(4, 0;\, 4)\) for \(i=1, 2, 3\), so \(p(H_1{\setminus } uv_i, 2)=12\). Also \(H_1{\setminus } uv_6=K_{1, 5}\). Hence \(p(H_1{\setminus } uv_6 , 2)=0\). Now, Lemma 2.9 implies that \(p(H_1, 3)=36\). Thus \(G=H_1\) and we are done.

We also observe that the graphs \(H_2\) and \(H_5\) are isomorphic. In addition K(4, 1; 3) has two vertices of degree four, no matter which one is joined to u, the resulting graphs are isomorphic. Now, a similar argument as above shows that \(p(H_2, 3)=39\), a contradiction. On the other hand \(p(H_3, 3)=36\), so \(G=H_3\). We are done again.

Subcase 1.2 If \(G{\setminus } u\) is a \(K'(k, t;\,l)\), then from (2) we see that \(k+t=5\), \(m'=l+6\) and \(p(G{\setminus } u, 2)=(l+t)(k-1)+t\). By a similar argument as in the previous case, we obtain \({\mathrm{deg}}(u)=8-l\) and

$$\begin{aligned} \sum _{i=1}^{7}d'_{i}\theta _i=6l+5t-(l^2+t^2+lt+1), \quad \theta _{i}\in \{0, 1\}. \end{aligned}$$
(9)

Since in a \(K'(k, t;\,l)\), \(l\le k\), we have \({\mathrm{deg}}(u)\ge 3\). Table 2 shows that we should only consider the possibility of \({\mathrm{deg}}(u)=4, 5\). Note that again we exclude the case \({\mathrm{deg}}(u)=7\), since \(\sum _{i=1}^{7}d'_{i}\theta _i\not =14\).

Table 2 Data of possible matching integral graphs G with eight vertices when \(G{\setminus } u\) is a \(K'(k, t;\,l)\) graph
Fig. 2
figure 2

Graphs \(K'(4,1;\, 4)\), \(H_6\), \(K'(3, 2;\, 3)\) and \(H_7\)

Note that the graphs \(H_6\) and \(H_2\) are isomorphic. The graph \(H_7\) is isomorphic to the matching integral graph \(H_1\).

Subcase 1.3 If \(G{\setminus } u\) is an L(tl), then it follows from (5) that \(t=3\), \(m'=l+6\) and \(p(G{\setminus } u,, 2)=l+9\). Similarly, we obtain \({\mathrm{deg}}(u)=8-l\) and

$$\begin{aligned} \sum _{i=1}^{7}d'_{i}\theta _i=8+3l-l^2, \quad \theta _i\in \{0, 1\}. \end{aligned}$$
(10)

Since \(l\in \{1, 2, 3\}\), \({\mathrm{deg}}(u)\ge 5\). However, Table 3 shows that it is not possible that \(G{\setminus } u=L(t, l)\) for some integers l, t.

Table 3 Data of possible matching integral graphs G with eight vertices when \(G{\setminus } u\) is an L(tl) graph

Case 2 \(R(G{\setminus } u)=\{0^3, \pm \eta _1, \pm \eta _2\}\) and \(G{\setminus } u\) is not connected:

Since \(m=14\) and \({\mathrm{deg}}(u)\le 7\), \(|E(G{\setminus } u)|\ge 7\). This implies that \(G{\setminus } u\) must have a component with at least four vertices, say \(G_1\). Let \(m'=|E(G_1)|\).

Subcase 2.1 If \(G{\setminus } u\) has a component with four vertices, then using Theorem 2.10 we see that \(G{\setminus } u\) can be the graphs \( K_3\cup K_{1, 3}\), \(K_{1, 2}\cup K_{1, 3}\), \(K_1\cup K_2\cup K_{1, 3}\) or \(3K_1\cup G_1\), where \(G_1\) is a connected graph on four vertices. In each case, we have \(|E(G{\setminus } u)|\le 6\), a contradiction.

Subcase 2.2 If \(G{\setminus } u\) has a component with five vertices, then again by Theorem 2.10 we deduce that \(G{\setminus } u\) is one of the graphs \(K_2\cup K_{1, 4}\) or \(2K_1\cup G_1\), where \(G_1\) is a connected non-star graph on five vertices. Now, if \(G{\setminus } u=K_2\cup K_{1, 4}\), then \(|E(G{\setminus } u)|=5\), a contradiction. Hence we assume that \(G{\setminus } u=2K_1\cup G_1\). We need to investigate all connected graphs with five vertices and at least seven edges. See Fig. 3. These graphs with their matching polynomials are also listed in Appendix [4].

Fig. 3
figure 3

Graphs with five vertices and at least seven edges

We recall that, we try to construct graphs with \(\sum _{i=1}^{8}d_{i}^{2}=112\). Let \(v_1, v_2\in N(u){\setminus } V(G_1)\). Obviously, \({\mathrm{deg}}(v_1)=deg(v_2)=1\). Consequently \(\sum _{i=3}^{8}d_{i}^{2}=110\), where \(d_8=deg(u)\) and \(d_3,\ldots , d_7\) are degrees of vertices in \( N_{G_1}(u)\). In addition, since \(m'\le |E(K_5)|=10\), \({\mathrm{deg}}(u)\ge 4\). In Table 4, the graph \(G_1\) which corresponds to the given degree of u is described. This helps us to obtain the sum \(\sum _{i=3}^{8}d_{i}^{2}\) in the resulting graphs. However, the table shows that G cannot have a component with five vertices. We also observe that when \({\mathrm{deg}}(u)=5, 6\) no matter which vertices of \(G_1\) are adjacent to u, \(\sum _{i=3}^{8}d_{i}^{2}\not =112\).

Table 4 Data of possible matching integral graphs G on eight vertices when \(G{\setminus } u\) has a component with five vertices

Subcase 2.3 If \(G{\setminus } u\) has a component with six vertices, then it follows from Lemma 2.11 that \(G{\setminus } u=K_1\cup G_1\), where \(G_1\) is one of the graphs K(ktl), \(K'(k, t;\,l)\) or L(tl) for some integers ktl. Note that \(R(G_1)=\{0^2, \pm \eta _1, \pm \eta _2\}\). Now, let \(v_1\in N(u){\setminus } V(G_1)\), so \({\mathrm{deg}}(v_1)=1\).

(1) If \(G_1\) is a K(ktl), then by (1) we have \(k+t=4\) and \(m'=l+4\). Since \(m'\ge 7\), \(l\in \{3, 4\}\). Furthermore, \(m'+{\mathrm{deg}}(u)=14\), so \(l+{\mathrm{deg}}(u)=10\). This gives that \({\mathrm{deg}}(u)\ge 6\). But, Table 5 shows that \(G_1\) could not be a K(ktl) graph.

Table 5 Data of possible matching integral graphs G on eight vertices when a K(ktl) graph of order 6 is a component of \(G{\setminus } u\)
Fig. 4
figure 4

Graphs K(4, 0;\, 4), \(H_8\) and \(H_9\)

(2) If \(G_1\) is a \(K'(k, t;\,l)\), then from (2) we have \(k+t=4\) and \(m'=l+5\). Now, it is easy to see that \(l+{\mathrm{deg}}(u)=9\) and \(l\ge 2\). Hence \({\mathrm{deg}}(u)\ge 5\). However, Table 6 shows that we can exclude the possibility of \({\mathrm{deg}}(u)=6, 7\).

Table 6 Data of possible matching integral graphs G on eight vertices when a \(K'(k, t; l)\) graph of order 6 is a component of \(G{\setminus } u\)
Fig. 5
figure 5

Graphs \(K'(4, 0;\,4)\) and \(H_{10}\)

We note that in case of \({\mathrm{deg}}(u)=5\), if there is a vertex \(v\in N_{G_1}(u)\) such that \({\mathrm{deg}}_{G_1}(v)=5\), then \(\sum _{i=1}^{8}d_{i}^2\ge 118\), a contradiction. Now, it is easy to see that the graph \(H_{10}\) is isomorphic to the matching integral graph \(H_3\). If \({\mathrm{deg}}(u)=6\), then no matter how u is joined to five vertices of \(K'(3, 1;\,3)\), in the resulting graph we have \(\sum _{i=1}^{8} d_{i}^{2}\ge 118\), a contradiction.

(3) If \(G_1\) is an L(tl), then from (5) we see that \(t=2\) and \(m'=l+5\). This gives that \(l+{\mathrm{deg}}(u)=9\), so \(l\ge 2\) and \({\mathrm{deg}}(u)\ge 6\). However, Table 7 shows that \(G_1\) could not be an L(tl) graph.

Table 7 Data of possible matching integral graphs G on eight vertices when an L(tl) graph of order 6 is a component of \(G{\setminus } u\)

Case 3\(R(G{\setminus } u)=\{0^3, (\pm \eta )^2\}\):

We know that if \(R(G{\setminus } u)=\{0^3, (\pm \eta )^2\}\), then \(G{\setminus } u\) is not connected. Now, by a similar argument as in Case 2, we obtain that \(G{\setminus } u\) has a component with at least four vertices. Now, according to the root system of \(G{\setminus } u\) and with the aid of Theorem 2.10 we see that \(G{\setminus } u\) could be the graph \(K_{1, 2}\cup K_{1, 3}\), \(K_3\cup K_{1, 3}\), \(K_1\cup K_2\cup K_{1, 3}\) or \(K_2\cup K_{1, 4}\). In each case we have \(|E(G{\setminus } u)|< 7\), a contradiction.

Therefore we showed that the graphs \(H_1\) and \(H_3\) are the only matching integral graphs on eight vertices. The proof is now complete.

Fig. 6
figure 6

\({\mathrm{Graphs}}~\textit{K}'(5, 0; 5),~~\textit{K}'(4, 1; 3),~~\textit{K}'(3, 2; 2),~~\textit{K}'(3, 1; 3),~~\textit{K}'(2, 3; 2) ,~~\textit{K}'(2,2;\, 2),~~ \textit{K}'(3, 1;\, 2),\)  K(3, 1; 3),  \(\textit{L}(3, 2),~~\textit{L}(3, 3),~~ \textit{L}(2, 2)\)  and  L(2; 3)

\(\square \)