1 Introduction

Throughout this paper, let G be a simple (i.e., finite, undirected, loopless and without multiple edges) graph. Let K be a field, and let \(R = K[x_1,\ldots ,x_n]\) be a standard graded polynomial ring over K. The algebraic object of our work is the Castelnuovo–Mumford regularity of graded modules and ideals over R. This invariant can be defined via the minimal free resolution (see the chapter Free Resolutions and Fitting Invariants in [2]). Let M be a nonzero finitely generated graded R-module and let

$$\begin{aligned} 0 \rightarrow \bigoplus _{j\in {{\,\mathrm{\mathbb {Z}}\,}}} R(-j)^{\beta _{p,j}(M)} \rightarrow \cdots \rightarrow \bigoplus _{j\in {{\,\mathrm{\mathbb {Z}}\,}}}R(-j)^{\beta _{0,j}(M)}\rightarrow 0 \end{aligned}$$

be the minimal free resolution of M. The Castelnuovo–Mumford regularity (or, regularity for short) of M, denoted by \({{\,\mathrm{reg}\,}}(M)\), is defined by

$$\begin{aligned} {{\,\mathrm{reg}\,}}(M) = \max \{j-i\mid \beta _{i,j}(M)\ne 0\}. \end{aligned}$$

Let \(G=(V,E)\) be a graph on the vertex set \(V=\{1,\ldots ,n\}\). The algebra-combinatorics framework used in this paper is described via the edge ideal construction. The edge ideal of G is defined by

$$\begin{aligned} I(G) = (x_ix_j \mid \{i,j\} \in E) \subset R. \end{aligned}$$

For simplicity, from now on, we write \({{\,\mathrm{reg}\,}}(G)\) to mean: \({{\,\mathrm{reg}\,}}(R/I(G))\) if G has at least one edge; 0 if G is totally disconnected. Note that \({{\,\mathrm{reg}\,}}(G)\) depends not only on the graph G but also on the characteristic of the field k (see e.g., [11, Exercise 5.3.31]).

Finding bounds for \({{\,\mathrm{reg}\,}}(G)\) in terms of combinatorial data of G is an active research program in combinatorial commutative algebra in recent years (see e.g., [4] for survey). For example, using the matching number \(\nu (G)\) and the induced matching number \(\nu _0(G)\) of G, one can bound \({{\,\mathrm{reg}\,}}(G)\) by:

$$\begin{aligned} \nu _0(G) \leqslant {{\,\mathrm{reg}\,}}(G) \leqslant \nu (G), \end{aligned}$$

where the first inequality proved by Katzman [7], and the second one proved by Hà and Van Tuyl [5]. The class of graphs G for which \({{\,\mathrm{reg}\,}}(G) = \nu (G)\) is classified in [10]. By contrast to the upper bound, we cannot classify the class of graphs G such that \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)\) since it depends on the characteristic of the base field K (see [10]). However, there are many classes of graphs known for which the inequality occurs (see e.g., [4]).

For \(k\geqslant 3\), let \(c_k(G)\) be the number of induced cycles of length k of G. A graph G is chordal if it has no induced cycles of length \(\geqslant 4\), i.e., \(c_k(G) = 0\) for \(k\geqslant 4\).

Hà and Van Tuyl [5] proved that \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)\) for all chordal graphs G. The first main result of the paper generalizes it as follows.

Theorem

(Theorem 3.2). Let G be a graph. Then, \({{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G)+\sum _{k\geqslant 4} c_k(G)\).

If G is a vertex-decomposable graph without cycles of length 5, Khosh–Ahang and Moradi [8] also proved that \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)\). Let \(n_5(G)\) be the number of cycles of length 5. The second main result of the paper generalizes it as follows.

Theorem

(Theorem 3.3). Let G be a vertex-decomposable graph. Then, \({{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G)+n_5(G)\).

2 Preliminaries

Let \(\Delta \) be a simplicial complex on the vertex set \(V= \{1,\ldots ,n\}\) and k a given field. We define the Stanley–Reisner ideal of the simplicial complex \(\Delta \) to be the squarefree monomial ideal

$$\begin{aligned} I_{\Delta } = (x_{j_1} \cdots x_{j_i} \mid j_1<\cdots < j_i \ \text { and } \{j_1,\ldots ,j_i\} \notin \Delta ) \ \text { in } R = k[x_1,\ldots ,x_n] \end{aligned}$$

and the Stanley–Reisner ring of \(\Delta \) to be the quotient ring \(k[\Delta ] = R/I_{\Delta }\).

Let G be a graph with vertex set V(G) and edge set E(G). An edge \(e \in E(G)\) connecting two vertices x and y will be written as xy (or yx); in this case, x is adjacent to y. An independent set in G is a set of vertices no two of which are adjacent to each other. The set of all independent sets of G is called the independence complex of G and denoted by \(\Delta (G)\).

Assume that \(V(G) = \{1,2,\ldots ,n\}\). The edge ideal of G is defined by

$$\begin{aligned} I(G) = (x_ix_j \mid \{i,j\} \in E(G)) \subset R. \end{aligned}$$

It is well-known that \(I(G) = I_{\Delta (G)}\).

For a subset S of V(G), we denote by G[S] the induced subgraph of G on the vertex set S and denote \(G\setminus S\) by \(G[V(G)\setminus S]\). An induced cycle in the graph G is a cycle that is an induced subgraph of G.

Let v be a vertex of G. The neighborhood of v in G is the set

$$\begin{aligned} N(v) = \{x\in V(G)\mid xv\in E(G)\}, \end{aligned}$$

the closed neighborhood of v is \(N[v] = \{v\} \cup N(v)\), and the localization of G with respect to v is \(G_v =G\setminus N[v]\).

The number \(\deg (v)=|N(v)|\) is called the degree of v in G. A vertex in G of degree zero is called an isolated vertex of G, and a vertex of degree 1 is called a leaf of G.

A graph is called totally disconnected if it is either a null graph or containing no edge.

In the paper, the following lemmas enable us to do induction on the order of graphs.

Lemma 2.1

Let \(G_1,\ldots , G_s\) be connected components of a graph G. Then,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G) = \sum _{i=1}^s {{\,\mathrm{reg}\,}}(G_i). \end{aligned}$$

Proof

Follows from [6, Lemma 3.2]. \(\square \)

Lemma 2.2

[4, Lemma 3.1] Let H be an induced subgraph of G. Then,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(H) \leqslant {{\,\mathrm{reg}\,}}(G). \end{aligned}$$

Lemma 2.3

[1, Lemma 2.10] Let v be a vertex of a graph G. Then,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G) \in \{{{\,\mathrm{reg}\,}}(G\setminus v), {{\,\mathrm{reg}\,}}(G_v)+1\}. \end{aligned}$$

A matching in G is a subgraph consisting of pairwise disjoint edges. If this subgraph is an induced subgraph, then the matching is called an induced matching. A matching of G is maximal if it is maximal with respect to inclusion. The matching number of G, denoted \(\nu (G)\), is the maximum size of a matching, and the induced matching number of G, denoted by \(\nu _0(G)\), is the maximum size of an induced matching in G.

Lemma 2.4

[7, Lemma 2.2] \({{\,\mathrm{reg}\,}}(G) \geqslant \nu _0(G)\).

A graph G is called chordal if it has no induced cycles of length \(\geqslant 4\).

Lemma 2.5

[5, Theorem 6.8] Let G be a chordal graph. Then, \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)\).

A vertex v of the graph G is called a shedding vertex of G if no independent set in \(G_v\) is a maximal independent set in \(G\setminus v\).

The class of vertex-decomposable graphs is recursively defined by a graph G is vertex-decomposable if it is either a totally disconnected graph or else has some shedding vertex v so that both \(G\setminus v\) and \(G_v\) are vertex-decomposable.

Lemma 2.6

[12, Theorem 1] If G is a graph with no induced cycles of length other than 3 or 5, then G is vertex-decomposable.

3 Regularity

In this section, we will prove the main results of the paper. All graphs are considered in this section are not empty.

Lemma 3.1

Let v be a shedding vertex of a graph G. If v is not in a cycle of length 5, then there is a vertex u of N(v) such that \(N[u]\subseteq N[v]\).

Proof

Let \(N(v) = \{u_1,\ldots ,u_s\}\). Suppose that \(N[u_i] \not \subseteq N[v]\) for \(i=1,\ldots ,s\). For each \(i = 1,\ldots ,s\), let \(w_i\) be a vertex in \(N(u_i)\setminus N(v)\). Now, if \(w_i\) is adjacent to \(w_j\) for some \(1 \leqslant i, j \leqslant s\) with \(i \ne j\), then \(v - u_i - w_i - w_j - u_j -v\) is a cycle of length 5 of G, a contradiction. Hence, \(\{w_1,\ldots ,w_s\}\) is an independent set in \(G_v\). Now, if F is a maximal independent set in \(G_v\) containing \(\{w_1,\ldots ,w_s\}\), it is also a maximal independent set in \(G\setminus v\). This contradicts the fact that v is a shedding vertex and the lemma follows. \(\square \)

We now are in position to prove the first main result of the paper.

Theorem 3.2

Let G be a graph. Then, \({{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G)+\sum _{k\geqslant 4} c_k(G)\).

Proof

We will prove by induction on |V(G)|. If \(|V(G)| = 1\), i.e., G is just one vertex, the theorem is trivial, and so we assume that \(|V(G)|\geqslant 2\).

If \(c_k(G) = 0\) for all \(k\geqslant 4\), then G is chordal by definition. Hence, \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)\) by Lemma 2.5, and hence the theorem holds in this case.

Assume that \(c_r(G) \geqslant 1\) for some \(r\geqslant 4\). Let v be a vertex of an induced cycle of length r. By Lemma 2.3, we have two possible cases:

Case 1 \({{\,\mathrm{reg}\,}}(G) = {{\,\mathrm{reg}\,}}(G\setminus v)\). By the induction hypothesis, we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G\setminus v) \leqslant \nu _0(G\setminus v) +\sum _{k\geqslant 4} c_k(G\setminus v). \end{aligned}$$

Since \(\nu _0(G\setminus v) \leqslant \nu _0(G)\) and \(c_k(G\setminus v) \leqslant c_k(G)\) for \(k\geqslant 4\), we obtain

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G) +\sum _{k\geqslant 4} c_k(G). \end{aligned}$$

Case 2 \({{\,\mathrm{reg}\,}}(G) = {{\,\mathrm{reg}\,}}(G_v)+1\). By the induction hypothesis, we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G_v) \leqslant \nu _0(G_v) +\sum _{k\geqslant 4} c_k(G_v). \end{aligned}$$

Note that \(\nu _0(G_v) \leqslant \nu _0(G)\) and \(c_k(G_v) \leqslant c_k(G)\) for \(k\geqslant 4\). Since v is in a cycle of length r, we have \(c_r(G_v) \leqslant c_r(G)-1\), so

$$\begin{aligned} \sum _{k\geqslant 4} c_k(G_v) \leqslant \sum _{k\geqslant 4} c_k(G) -1. \end{aligned}$$

It implies that

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G)&= {{\,\mathrm{reg}\,}}(G_v)+1 \leqslant \nu _0(G_v) +\sum _{k\geqslant 4} c_k(G_v)+1\\&\leqslant \left( \nu _0(G) +\sum _{k\geqslant 4} c_k(G)-1\right) +1\\&= \nu _0(G) +\sum _{k\geqslant 4} c_k(G), \end{aligned}$$

and the theorem follows. \(\square \)

The following theorem is the second main result of the paper.

Theorem 3.3

Let G be a vertex-decomposable graph. Then, \({{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G) + n_5(G)\).

Proof

We will prove by induction on |V(G)|. If \(|V(G)| = 1\), i.e., G is just one vertex, the theorem is trivial, and so we assume that \(|V(G)|\geqslant 2\).

If G is totally disconnected, then the lemma is obvious, and so we assume that G is not totally disconnected. Let v be a shedding vertex of G. By Lemma 2.3, we have two possible cases:

Case 1 \({{\,\mathrm{reg}\,}}(G) = {{\,\mathrm{reg}\,}}(G\setminus v)\). By the induction hypothesis, we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G\setminus v) \leqslant \nu _0(G\setminus v) +n_5(G\setminus v). \end{aligned}$$

Clearly, \(\nu _0(G\setminus v) \leqslant \nu _0(G)\) and \(n_5(G\setminus v) \leqslant n_5(G)\). Together with the inequality above, we obtain

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G)= {{\,\mathrm{reg}\,}}(G\setminus v) \leqslant \nu _0(G) +n_5(G). \end{aligned}$$

Case 2 \({{\,\mathrm{reg}\,}}(G) = {{\,\mathrm{reg}\,}}(G_v)+1\). Now, we consider two subcases:

Subcase 1 v is in a cycle of length 5. In this case, \(n_5(G_v) \leqslant n_5(G)-1\). Since \(\nu _0(G_v) \leqslant \nu _0(G)\), we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G)&= {{\,\mathrm{reg}\,}}(G_v)+1 \leqslant \nu _0(G_v) + n_5(G_v)+1 \\&\leqslant \nu _0(G) +(n_5(G)-1)+1= \nu _0(G) + n_5(G). \end{aligned}$$

Subcase 2 v is not in any cycle of length 5. By Lemma 3.1, there is \(u\in N(v)\) such that \(N(u)\subseteq N(v)\). It follows that if M is an induced matching of \(G_v\), then \(M\cup \{uv\}\) is an induced matching of G, and then \(\nu _0(G_v) \leqslant \nu _0(G)-1\). Therefore,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G)&= {{\,\mathrm{reg}\,}}(G_v)+1 \leqslant \nu _0(G_v) + n_5(G_v)+1 \\&\leqslant (\nu _0(G)-1) +n_5(G)+1 = \nu _0(G) + n_5(G), \end{aligned}$$

and the theorem follows. \(\square \)

The bounds in Theorems 3.2 and 3.3 are exact values for chordal graphs and vertex-decomposable graphs without cycles of length 5, respectively. The following example shows that those bounds are sharp for graphs with many cycles.

Example 3.4

Let \(C_1,\ldots ,C_k\) be vertex disjoint cycles. Assume that each \(C_i\) is of length \(n_i\) with \(n_i \equiv 2 \pmod 3\) for each i. Let \(P = uvw\) be a path of length 2. Let G be the graph obtained by joining P with every \(C_i\) by joining u with only one vertex, say \(z_i\), of \(C_i\) (see Fig. 1). Then,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G) = \nu _0(G) + k = \nu _0(G) + \sum _{i\geqslant 4} c_i(G). \end{aligned}$$

Moreover, if every \(C_i\) is a cycle of length 5, then G is vertex-decomposable and \({{\,\mathrm{reg}\,}}(G) = \nu _0(G) + n_5(G)\).

Fig. 1
figure 1

Joining P with two cycles \(C_5\) and \(C_8\)

Proof

We start by noting that for any path Q with s vertices one has

$$\begin{aligned} \nu _0(Q) = \left\lfloor \dfrac{s+1}{3}\right\rfloor , \text { and } {{\,\mathrm{reg}\,}}(Q) = \nu _0(Q), \end{aligned}$$
(1)

where the second equality follows from the fact that Q is chordal.

For any cycle C of length s, one has

$$\begin{aligned} \nu _0(C) = \left\lfloor \dfrac{s}{3}\right\rfloor , \text { and } {{\,\mathrm{reg}\,}}(C) = \nu _0(C)+1 \text { if } s \equiv 2 \pmod 3, \end{aligned}$$
(2)

where the second equality follows from [9, Theorem 7.6.28].

Now, we claim that

$$\begin{aligned} \nu _0(G) = \sum _{i=1}^k \nu _0(C_i)+1. \end{aligned}$$
(3)

Indeed, let M be any maximal induced matching of G. If u is not incident to any edge in M, then we must have \(vw\in M\), and \(M\setminus \{uv\}\) is an induced matching of \(G\setminus \{u,v,w\}\). Thus, \(|M| \leqslant 1 + \sum _{i=1}^s \nu _0(C_i)\).

If u is incident to an edge in M, say e, then \(M\setminus e\) is an induced matching of \(G_u\). Let \(P_i\) be the path obtained by deleting the vertex \(z_i\) from \(C_i\) for each i. Then, the connected components of \(G_u\) are \(P_1,\ldots ,P_k\) and the isolated vertex w. Therefore,

$$\begin{aligned} |M| \leqslant 1 + \nu _0(G_u) = 1 + \sum _{i=1}^k \nu _0(P_i). \end{aligned}$$

Together with Formulas (1) and (2), it yields

$$\begin{aligned} |M| \leqslant 1 + \sum _{i=1}^k \nu _0(P_i) = 1 + \sum _{i=1}^k \nu _0(C_i). \end{aligned}$$

Hence, we always have \(|M| \leqslant 1 + \sum _{i=1}^k \nu _0(C_i)\), so \(\nu _0(G) \leqslant 1 + \sum _{i=1}^k \nu _0(C_i)\).

On the other hand, since the connected components of \(G\setminus u\) are just \(C_1,\ldots ,C_k\) and the edge vw, we have

$$\begin{aligned} \nu _0(G) \geqslant \nu _0(G\setminus u) = \sum _{i=1}^s \nu _0(C_i)+1, \end{aligned}$$

and the claim follows.

Now, since the connected components of \(G\setminus u\) are \(C_1,\ldots ,C_k\) and an edge, by Lemma 2.1 and Formulas (1), (2) and (3), we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G\setminus u)&= \sum _{i=1}^k {{\,\mathrm{reg}\,}}(C_k) + 1 = \sum _{i=1}^k (\nu _0(C_i)+1)+1= \sum _{i=1}^k \nu _0(C_i) + k + 1\\&= \nu _0(G) + k. \end{aligned}$$

Recall that each \(P_i\) is the path obtained by deleting one vertex from \(C_i\). By Formulas (1) and (2), we have \({{\,\mathrm{reg}\,}}(P_i) = \nu _0(P_i) = \nu _0(C_i)\).

Since the connected components of \(G_u\) are \(P_1,\ldots ,P_k\) and an isolated vertex, we have

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G_u) = \sum _{i=1}^k {{\,\mathrm{reg}\,}}(P_i) = \sum _{i=1}^k \nu _0(P_i) = \sum _{i=1}^k \nu _0(C_i) = \nu _0(G)-1. \end{aligned}$$

In particular, \({{\,\mathrm{reg}\,}}(G\setminus u) > {{\,\mathrm{reg}\,}}(G_u) + 1\). Together with Lemmas 2.2 and 2.3, we deduce that \({{\,\mathrm{reg}\,}}(G) = {{\,\mathrm{reg}\,}}(G\setminus u)\). Thus,

$$\begin{aligned} {{\,\mathrm{reg}\,}}(G) = \nu _0(G) + k = \nu _0(G) + \sum _{i\geqslant 4}c_i(G). \end{aligned}$$

Further, assume that all \(C_i\) are cycles of length 5. We will prove by induction on k that G is vertex-decomposable. Indeed, if \(k=1\), let z be the vertex of \(C_1\) joining with u. Then, every maximal independent set of \(G\setminus z\) must contain at least one vertex a or b, where a and b are the neighbors of z in \(C_1\) (see Fig. 2). But a and b are not vertices of \(G_z\), so there is no any maximal independent set of \(G_z\) such that it is also a maximal independent set of \(G\setminus z\). Thus, z is a shedding vertex of G.

Since, \(G\setminus z\) and \(G_{z}\) are forests, so that they are vertex-decomposable. Thus, G is vertex-decomposable.

Fig. 2
figure 2

A cycle of length 5 joining with P.

Assume that \(k \geqslant 2\). Let z be the vertex of \(C_1\) joining with u. Then, z is a shedding vertex of G by the same argument above. Note that \(G\setminus z\) has two connected components: the path \(C_1\setminus z\) and \(G\setminus V(C_1)\). Since the graph \(G\setminus V(C_1)\) is vertex-decomposable by the induction hypothesis, we deduce that \(G\setminus z\) is vertex-decomposable. Next, the connected components of \(G_z\) consist of two edges and \(k-1\) cycles of length 5. Because a cycle of length 5 is vertex-decomposable (see e.g., [3, Theorem 10]), we have \(G_z\) is vertex-decomposable. Thus, G is vertex-decomposable.

Finally, in the case all cycles \(C_i\) are of length 5 one has \(n_5(G) =k\) so that \({{\,\mathrm{reg}\,}}(G) = \nu _0(G)+n_5(G)\), and the proof is complete. \(\square \)

By virtue of Theorems 3.2 and 3.3, it is nature to ask whether \({{\,\mathrm{reg}\,}}(G) \leqslant \nu _0(G)+c_5(G)\) for any vertex-decomposable graph G. However, this does not hold true by the following example.

Example 3.5

Let G be a graph as in Fig. 3.

Fig. 3
figure 3

Vertex-decomposable graph without induced cycles of lenght 5

Then, G is vertex-decomposable. Moreover, we have \(\nu _0(G) = 1\) and \(c_5(G) = 0\), but \({{\,\mathrm{reg}\,}}(G) = 2\).