Gorenstein and Cohen-Macaulay Matching Complexes
Abstract
Let be a simple undirected graph. The family of all matchings of forms a simplicial complex called the matching complex of . Here , we give a classification of all graphs with a Gorenstein matching complex. Also we study when the matching complex of is Cohen-Macaulay and, in certain classes of graphs, we fully characterize those graphs which have a Cohen-Macaulay matching complex. In particular, we characterize when the matching complex of a graph with girth at least 5 or a complete graph is Cohen-Macaulay.
Keywords: Cohen-Macaulay ring; Gorenstein ring; Matching complex; Line graph; Edge ideal;
Mathematics Subject Classification (2020): 13F55; 05E40; 05E45.
1 Introduction
In this paper, denotes a field and . Let be a simple graph on vertex set and edge set . Then the edge ideal of is the ideal of generated by . A graph is called Cohen-Macaulay (resp. Gorenstein) when is Cohen-Macaulay (resp. Gorenstein) for every field . Many researchers have tried to combinatorially characterize Cohen-Macaulay (CM, for short) or Gorenstein graphs in specific classes of graphs, see for example, [19, 8, 13, 15, 4, 6, 7]).
Note that the family of independent sets of is a simplicial complex which we denote by , and is called the independence complex of . Suppose that is the Stanley-Reisner ideal of a simplicial complex . Then is called CM (resp. Gorenstein) when is CM (resp. Gorenstein) for every field . Noting that , we see that is CM or Gorenstein if and only if is so.
Assume that is a simple undirected graph and is the line graph of , that is, edges of are vertices of and two vertices of are adjacent if they share a common endpoint in . Line graphs are well-known in graph theory and have many applications. In particular, there are some well-known characterizations of line graphs (see for example [17, Section 7.1]). Also a linear time algorithm is presented by Lehot in [10] that given a graph , checks whether is a line graph and if is a line graph, returns a graph such that . Note that faces of are exactly the matchings of , hence is known and studied as the matching complex of in the literature (see, for example, [16, 1, 9] and the references therein). In the survey article [16], one can find many known properties of matching complexes of complete and complete bipartite graphs. In particular, it is known that the matching complex of a complete bipartite graph with part sizes and with is CM if and only if .
Here, first in Section 2, we characterize graphs with a Gorenstein matching complex. Then in Section 3, we focus on the Cohen-Macaulay property and give classifications of graphs with a CM matching complex which are in one of the following classes: Cameron-Walker graphs, graphs with girth at least 5, complete graphs. Note that, in other words, we present characterizations of Gorenstein line graphs and CM line graphs in the aforementioned classes.
2 Gorenstein Matching Complexes
In what follows, is a simple undirected graph with at least one edge, is the line graph of and is the matching complex of . First we characterize when this complex is Gorenstein. It should be mentioned that this characterization also follows from Theorem 4.3 of the recent paper [1] and Theorem 5.1 in chapter II of [14], though, the proof presented here is quite different and does not need homological concepts. Here if , then by (or ) we mean , and we set and , where is the set of all vertices of incident to an edge in . It is routine to check that .
Theorem 2.1.
Suppose that is a graph with at least one edge, and be an arbitrary field. Then (or equivalently, the matching complex of ) is Gorenstein over if and only if each connected component of is either a 5-cycle or a path with length or the graph in Figure 1.

Proof.
Note that is Gorenstein if and only if each connected component of is so. Since each connected component of is the line graph of a connected component of , we assume that is connected. The line graph of the stated graphs are either or or the complement of cycles of length 5 or 6 and hence are Gorenstein by [13, Corollary 2.4]).
Conversely assume that is Gorenstein. If , then is a Gorenstein complete graph and thus either is a vertex and hence is or is and hence is a path of length 2. Suppose . Then by [13, Theorem 2.3], for each maximum size matching of , if for some , then is the complement of a cycle of length at least 4. In particular, as there are edges such that but . Two cases are possible; either and have a common endpoint in or and do not have a common endpoint in . In the latter case, and are adjacent in and hence is cycle of length 4 and is the disjoint union of two paths of length 2. In the former case, any other edge of is adjacent to both and in (since in the cycle , degree of each vertex is 2, and and are already adjacent to two vertices among ), therefore in any edge except must be incident to an endpoint of and also to an endpoint of . There are 4 possible such edges and hence only 16 possibilities exist for . Because is also the complement of a cycle, it follows that the only possible graphs for is the 5-cycle or the graph in Figure 1.
Note that in both cases exactly one endpoint of each of and is adjacent to a vertex of not in . It follows that if the set of all vertices of not covered by is and for , then for each , exactly one of or is adjacent to exactly one of the ’s. We can assume that are the vertices adjacent to , are adjacent to and …. Suppose . Note that is connected and there is no edge between ’s, because is a maximum matching. Thus there should be an edge with one end on some for and one end on for . But then setting and , we see that is not a cycle for . Therefore, .
Suppose that , is a maximum matching of and . Let . Then for each , is either a 5-cycle or the graph in Figure 1. It follows that, is one of the graphs in Figure 2. If is any of the first three graphs from the left in Figure 2 and is the edge specified in the figure, then is neither a 5 cycle nor the graph in Figure 1, although, is a matching with size .

Consequently, must be the rightmost graph depicted in Figure 2. Suppose that is the independence polynomial of , that is, the coefficient of is the number of independent sets of . Then one can compute that . It follows that and hence is not Gorenstein by [13, Theorem 2.3]. But according to [12, Corollary 2.4], if is Gorenstein, then is Gorenstein for every independent set of , a contradiction. From this contradiction we deduce that and as argued above, is either a 5-cycle or the graph in Figure 1. ∎
3 Cohen-Macaulay Matching Complexes
In this section we classify graphs which have a CM matching complex. We do this only when the graph is in one of the following classes of graphs: Cameron-Walker graphs and graphs with girth at least 5 (Subsection 3.1) and complete graphs (Subsection 3.2). Recall that here is a simple undirected graph with at least one edge, is the line graph of and is the matching complex of .
3.1 Cameron-Walker graphs and graphs with large girth
Recall that an induced matching of is a matching of such that for every pair of edges , there is no edge of such that is incident to an endpoint of and an endpoint of . For studying Cohen-Macaulayness of matching complexes, we first restrict ourselves to the class of graphs, such as , in which the maximum size of induced matchings (denoted by ) and the maximum size of matchings (denoted by ) are equal. A classification of such graphs was first stated in [3]. Then in [7] a minor correction to this classification was presented.
We recall the corrected classification ([7, pp. 258, 259]). A star triangle is a graph obtained by joining several triangles at a common vertex and a pendant triangle is a triangle with two degree 2 vertices and a vertex with degree more than 2. Also a leaf edge is an edge incident to a leaf. Now for a connected graph , if and only if either is a star or a star triangle or is obtained from a connected bipartite graph with vertex partitions and , by adding some and at least one leaf edge to each vertex of and adding some and maybe zero pendant triangles to each vertex of . As in [7], we call a connected graph with and which is not a star or a star triangle, a Cameron-Walker graph. By a bipartition of a Cameron-Walker graph, we mean a bipartition of the underlying bipartite graph where and satisfy the aforementioned conditions. Figure 3 shows an example of a Cameron-Walker graph.

It is well-known that a CM simplicial complex is pure and the following shows that for graphs with the matching complex is pure.
Lemma 3.1.
If is a star or a star triangle or a Cameron-Walker graph, then is pure.
Proof.
It is easy to see that each maximal matching of a star and a star triangle have size 1 and , respectively, where denotes the number of vertices of the graph. Assume that is a Cameron-Walker graph with bipartition . Let be a maximal matching of and be those edges of which are in the underlying bipartite graph and . Suppose that and are vertices in and , respectively, incident to some edge in and , . Then for each vertex there should be exactly one leaf edge in incident to and for , none of the leaf edges at are in . Also for each vertex the pendant triangles at form a star triangle. If , then a maximal matching of the star triangle at must be in and its size as mentioned before equals the number of triangles in the star triangle at . If , then as is covered by , only those edges of the star triangle can be in , that do not meet and since is maximal, all of them must be in . Therefore again the star triangle at contributes exactly edges to . Consequently, , where is the total number of pendant triangles in . Because , it follows that is independent of the choice of . ∎
As a partial converse we have:
Lemma 3.2.
If is connected, is pure and , then either is a 5-cycle or a 7-cycle or a star or a Cameron-Walker graph.
Proof.
By [5, Theorem 1], is either a 5-cycle, a 7-cycle, an edge or a bipartite graph with bipartite sets and such that each vertex in is adjacent to a leaf and each vertex in is not adjacent to any leaf. Suppose that is not a star, a 5-cycle or a 7-cycle. If is the set of leaves of , then by setting and , then is a Cameron-Walker graph with bipartition . Note that the edges between and are the leaf edges at vertices of . ∎
Recall that for a face of a simplicial complex , we define . Also for a vertex of , is the simplicial complex with faces . A vertex of a nonempty simplicial complex is called a shedding vertex, when no face of is a facet of . A nonempty simplicial complex is called vertex decomposable, when either it is a simplex or there is a shedding vertex such that both and are vertex decomposable. One should note that in some papers is called a shedding vertex when it is shedding in the sense defined here and also and are vertex decomposable. The -dimensional simplicial complex is considered a simplex and hence is vertex decomposable.
Theorem 3.3.
Assume that and . Then is vertex decomposable.
Proof.
By [7], is either a star or a star triangle or a Cameron-Walker graph. If is a star then is a complete graph and by [19, Lemma 4], is vertex decomposable.
For the case that is a star triangle or a Cameron-Walker graph, we use induction on the number of edges of . Suppose that is a star triangle in which the common vertex of the triangles is . Let be an edge incident to . Then and is just a matching. Therefore is a simplex. Also and is either a star or a Cameron-Walker graph with less edges that and hence is vertex decomposable by the induction hypothesis. Also if is a maximal matching of containing , then is a matching of , where is the edge in the same triangle as but not adjacent to . This shows that is a shedding vertex of and thus is vertex decomposable.
Now assume that is a Cameron-Walker graph with bipartition . Let be an edge of the underlying bipartite graph with an endpoint . By the definition of Cameron-Walker graphs, is incident to a leaf edge . Now every connected component of and is either a star or a star triangle or a Cameron-Walker graph with less edges than . Consequently, both and are vertex decomposable by induction hypothesis. Also if is a maximal matching of containing , then is a matching of , that is, is a shedding vertex of . Thus is vertex decomposable. ∎
A combinatorial property related to being CM is shellability. If there is an ordering of all facets of such that for all we have is a pure simplicial complex of dimension , is called shellable. It is well-known that a vertex decomposable complex is shellable and a pure shellable complex is CM.
Corollary 3.4.
Suppose that is a connected graph with , and be the matching complex of . Then the following are equivalent.
-
(i)
is pure vertex decomposable.
-
(ii)
is pure shellable.
-
(iii)
or equivalently is CM (over some field).
-
(iv)
is either a 5-cycle or a star or a Cameron-Walker graph.
Proof.
It is well-known that (i) (ii) (iii). Suppose that is CM over a field . Then is pure and hence according to (3.2), is either a 5-cycle or a 7-cycle or a star or a Cameron-Walker graph. But by [19, Theorem 10] a 7-cycle is not CM over any field, so (iv) follows. Now assume that is a star or a Cameron-Walker graph. Then by (3.1) and (3.3), is pure vertex decomposable. For the 5-cycle, the result follows from [19, Theorem 10]. ∎
3.2 Complete graphs
At the end of this paper, we consider the matching complex of the complete graph on vertices. Recall that a CM simplicial complex is strongly connected (or connected in codimension 1), that is, for each two facets of , there is a sequence of facets , such that . We call such a sequence of facets a strong path from to . First we find complete graphs with a strongly connected matching complex.
Proposition 3.5.
Suppose that and . Then is strongly connected, if and only if is odd or .
Proof.
Suppose that is even. Then each maximal matching of has size . If and are maximal matchings of and , then saturates vertices of . If and are the only unsaturated vertices, then the only maximal matching containing is , so . Consequently, if has more than one maximal matchings, which holds if , then is not strongly connected.
Now assume that is odd. We use induction to show that there is a strong path between every two maximal matchings of . Let and be maximal matchings of . If then there is a strong path between and in , by the induction hypothesis. Hence there is a strong path between and . Suppose that and is a vertex saturated by both and , say and . If is not saturated by , then by the previous part there is a strong path between and . Thus it follows that there is such a path between and . If is saturated by , say , then there is a strong path from to . Note that since is odd, there is an vertex unsaturated in . If we attach the following strong path at the start of we get a strong path from to : , , . ∎
Recall that a perfect matching of is a matching that saturates all vertices of .
Remark 3.6.
The first part of proof of (3.5), indeed shows that if is a graph with a perfect matching, then its matching complex cannot be strongly connected and hence is not CM.
To find out when is CM, we need an algebraic tool. Let be a simplicial complex and denote by the free -module whose basis is the set of all -dimensional faces of . Consider the -map defined by
where is a linear order. Then is a complex of free -modules and -homomorphisms called the augmented oriented chain complex of over . We denote the -th homology of this complex by . The Reisner theorem states that is CM over , if and only if for all faces of including the empty face and for all , one has (see [6, Theorem 8.1.6]). Equivalently, this theorem states that is CM over if and only if for all vertices of , is CM and for all .
Theorem 3.7.
Suppose that and is the matching complex of . Then is CM over a field , if and only if either
-
(i)
or ;
-
(ii)
or and .
Proof.
If , then and is CM. If is even, then by (3.5) is not strongly connected and hence not CM. If , then and is CM if and only if it is connected or equivalently strongly connected (see [2, Excercise 5.1.26]). Hence again the result follows from (3.5). Suppose that is odd. Assume that is a vertex of , that is, , for vertices and of . Then is the matching complex of . Thus if we show that for , is not CM over any field and for , is CM exactly when has characteristic , then the proof is concluded. But letting , for all vertices of , is CM. Hence is CM if and only if for all . By Table 6.1 of [16], we have and and hence by the universal coefficient theorem, is zero if and only if . Similar argument using Table 6.1 of [16] shows that if , then for every field and is not CM over any field. ∎
Acknowledgement
The author would like to thank M. Bayer and B. Goeckner for mentioning some interesting references that the author was not aware of and contained answers to some questions posed in a previous version of this paper.
References
- [1] M. Bayer, B. Goeckner and M. J. MilutinoviĆ, Manifold matching complexes, Mathematika 66 (2020), 973–1002.
- [2] W. Bruns and Jürgen Herzog, Cohen-Macaulay Rings, Cambridge University Press, Cambridge, 1993.
- [3] K. Cameron and T. Walker, The graphs with maximum induced matching and maximum matching the same size, Discrete Math. 299 (2005), 49–55.
- [4] M. Crupi, G. Rinaldo and N. Terai, Cohen-Macaulay edge ideals whose height is half of the number of vertices, Nagoya Math. J. 201 (2011), 116–130.
- [5] A. Frendrup, B. Hartnell and P. D. Vestergaard, A note on equimatchable graphs Australasian J. Combin., 46 (2010), 185–190.
- [6] J. Herzog and T. Hibi, Monomial Ideals, Springer-Verlag, London , 2011.
- [7] T. Hibi, A. Higashitani, K. Kimura and A. B. O’Keefe, Algebraic study on Cameron-Walker graphs, J. Algebra, 422 (2015), 257–269.
- [8] D. T. Hoang and T. N. Trung, A characterization of triangle-free Gorenstein graphs and Cohen-Macaulayness of second powers of edge ideals, J. Algebr. Combin. 43 (2016), 325–338.
- [9] J. Jonsson, Exact sequences for the homology of the matching complex, J. Combin. Theory, Ser. A 115 (2008), 1504–1526.
- [10] P. G. H. Lehot, An optimal algorithm to detect a line graph and output its root graph, J. ACM, 21 (1974), 569–-575.
- [11] A. Nikseresht, Chordality of clutters with vertex decomposable dual and ascent of clutters, J. Combin. Theory —Ser. A, 168 (2019), 318–337, arXiv: 1708.07372.
- [12] A. Nikseresht and M. R. Oboudi, Trung’s construction and the Charney-Davis conjecture, Bull. Malays. Math. Sci. Soc., 44 (2021), 9–16, arXiv: 1906.11482.
- [13] M. R. Oboudi and A. Nikseresht, Some combinatorial characterizations of Gorenstein graphs with independence number less that four, Iran. J. Sci. Technol. Trans. Sci., 44 (2020), 1667–1671, arXiv: 1911.11406.
- [14] R. P. Stanley, Combinatorics and Commutative Algebra, second ed., Birkhäuser, Boston, 1996.
- [15] T. N. Trung, A characterization of Gorenstein planar graphs, in T. Hibi, ed., Adv. Stud. Pure Math., Vol. 77 (2018): The 50th Anniversary of Gröbner Bases, 399–409, arXiv:1603.00326v2.
- [16] M. L. Wachs, Topology of matching, chessboard, and general bounded degree graph complexes, Algebra Univers., 49 (2003), 345–385.
- [17] D. B. West, Introduction to Graph Theory, 2nd ed., Prentice Hall, 2001.
- [18] R. Woodroofe, Chordal and sequentially Cohen-Macaulay clutters, Elec. J. Combin., 18 (2011), research paper p208.
- [19] R. Woodroofe, Vertex decomposable graphs and obstructions to shellability, Proc. Amer. Math. Soc., 137 (2009), 3235–3246.