1 Introduction

Assigning graphs to various algebraic structures is widely present in the literature. In particular, many useful properties of the Cayley graphs of groups (see for instance [7]) have motivated the study of the Cayley graphs of semigroups in general, and of some particular classes of semigroups (see [25, 27, 28, 31, 32] and references therein). Also, the power graphs of groups and semigroups have drawn a lot of attention, as it can be seen from [1]. For the more recent results on the Cayley graphs and the power graphs of semigroups, the reader is referred, for example, to the papers [11, 21, 22, 29, 30, 34, 45] and their references. There have also been various graphs assigned to a ring, and in particular, to a matrix ring, like for instance, the zero divisor graph, the annihilator graph, the ideal intersection graph, the ideal inclusion graph, the co-maximal graph, or generalized Cayley graphs, see for instance [3,4,5,6, 9, 12, 14, 40, 41, 43, 44] and references therein, as well as [36] for the Cayley graphs of \({\mathbb {Z}}\)-graded rings. For graphs associated to lattices, see [39].

Throughout the article, by a graph we mean a simple undirected graph \(G=(V,E)\) with the vertex set \(V=V(G)\) and the edge set \(E=E(G).\) If \(V'\subseteq V,\) then by \(G\setminus V'\) we denote a subgraph of G obtained from G by removing all of the vertices from \(V'\) along with all of the edges incident to those vertices. For the standard notions of the graph theory, we refer the reader to for instance [43].

Let R be a commutative ring with unity. In [41], a graph, denoted by \(\Gamma (R),\) is assigned to R,  with the vertex set R and distinct vertices x and y being adjacent if and only if \(xR+yR=R.\) Many properties of the graph \(\Gamma (R)\) have been investigated, like the chromatic number [41], the connectedness and the diameter of \(\Gamma _2(R)\setminus J(R)\) [35], where \(\Gamma _2(R)\) is a subgraph of \(\Gamma (R)\) induced by non-unit elements of R,  and J(R) is the Jacobson radical of R. In [42], characterizations of the rings R for which \(\Gamma _2(R)\) is a forest and for which \(\Gamma _2(R)\setminus J(R)\) is Eulerian, are obtained. If R is a ring with unity, not necessarily commutative, then the co-maximal graph of R,  also denoted by \(\Gamma (R),\) is defined in [43] as a graph whose vertex set consists of non-unit elements of R and distinct vertices x and y are adjacent if and only if \(xR+yR=R.\)

The aim of this article is to study a similar graph, which we call the homogeneous co-maximal graph, assigned to a ring with unity, not necessarily commutative, and graded in the following sense.

Let R be a ring, and S a partial groupoid, that is, a set with a partial binary operation. Also, let \(\{R_s\}_{s\in S}\) be a family of additive subgroups of R,  called components. We say that \(R=\bigoplus _{s\in S}R_s\) is S-graded and R induces S (or R is an S-graded ring inducing S) [23, 24, 26] if the following two conditions hold:

  1. (i)

    \(R_s R_t\subseteq R_{st}\) whenever st is defined;

  2. (ii)

    \(R_s R_t\ne 0\) implies that the product st is defined.

The set \(H_R=\bigcup _{s\in S}R_s\) is called the homogeneous part of R. Elements of \(H_R\) are called homogeneous elements of R. The support \(\mathrm {supp}(R)\) of R is defined as the set \(\{s\in S\ |\ R_s\ne 0\}.\)

After preliminaries on graded rings, in Sect. 3 we introduce the homogeneous co-maximal graph of an S-graded ring R inducing S,  with unity, denoted by \(\Gamma ^h(R).\) Theorem 3.2 in [43] asserts that the graph \(\Gamma (A)\setminus \{0\}\) of a semisimple right Artinian ring A with unity, and with more than one maximal right ideal, is connected. Here, under the assumption that S is cancellative, we find a necessary condition for the edge set of \(\Gamma ^h(R)\) to be nonempty: S cannot have more than one idempotent element, unless S is with zero, in which case it contains two idempotent elements. It turns out that this condition characterizes the connectedness of \(\Gamma ^h(R)\setminus \{0\}\) for a class of graded rings R with unity, which are graded semisimple, graded right Artinian, and which contain more than one maximal graded modular right ideal.

Inspired by the results obtained for the co-maximal graphs of matrix rings in [43], in Sect. 4, we turn our attention to matrix rings, graded in accordance with the findings from Sect. 3. Let \({\mathbb {F}}_q\) be a finite field with q elements, and \(M_n({\mathbb {F}}_q)\) the ring of \(n\times n\) matrices over \({\mathbb {F}}_q\) with respect to the usual matrix addition and multiplication, where \(n\ge 2.\) Then \(M_n({\mathbb {F}}_q)\) can naturally be regarded as an S-graded ring inducing S,  where S is a groupoid with a single nonzero idempotent element, and distinct from a group with zero. With respect to this grading, we obtain various parameters of \(\Gamma ^h(M_n({\mathbb {F}}_q))\setminus \{0_{M_n({\mathbb {F}}_q)}\},\) where \(0_{M_n({\mathbb {F}}_q)}\) denotes the zero matrix. If A is a ring with unity, it is known from [43] that \(\Gamma (A)\cong \Gamma (M_n({\mathbb {F}}_q))\) implies that \(A\cong M_n({\mathbb {F}}_q).\) Here we obtain that, if R is with unity, and graded by the same groupoid S as \(M_n({\mathbb {F}}_q)\) is, such that \(\mathrm {supp}(R)=S\setminus \{0\},\) and if \(\Gamma ^h(R)\cong \Gamma ^h(M_n({\mathbb {F}}_q)),\) then R and \(M_n({\mathbb {F}}_q)\) are graded isomorphic as S-graded rings.

2 Preliminaries

2.1 Graded Rings

Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S. The degree \(\deg (x)\) of a nonzero homogeneous element x of R is defined to be a unique \(s\in S\) such that \(x\in R_s.\) Let us define \(0=\deg (0).\) Since the zero element of R can be regarded as a component of R,  without loss of generality, we may assume that \(0\in S.\) We may moreover assume that \(S\setminus \{0\}=\mathrm {supp}(R).\) Throughout the article, and without further notice, we make S a groupoid by putting \(st=0\) for those pairs \((s,t)\in S\times S\) for which the product st is not originally defined (in which case \(R_sR_t=0\)) and \(s0=0s=0\) for every \(s\in S.\) We also write \(S^*=S\setminus \{0\}.\) Hence \(R_0=0,\) the zero subring of R,  and \(R=\bigoplus _{s\in S}R_s=\bigoplus _{s\in S^*}R_s.\) If \(x\in R,\) then x can be written uniquely as \(\sum _{s\in S}x_s,\) where \(x_s\in R_s\) is called the s-component of x. We also denote \(x_s\) by \((x)_s.\)

Note that for st\(u\in S^*,\) if \(R_sR_tR_u\ne 0,\) then \((st)u=s(tu).\) In that case, as usual, we write this element as stu.

Throughout the article, a groupoid S with zero 0 is said to be cancellative if for st\(u\in S,\) each of the equalities \(0\ne su=tu\in S\) or \(0\ne us=ut\in S\) implies that \(s=t.\) Also, the set of all idempotent elements of S is denoted by E(S). By \(E(S)^*\) we denote the set \(E(S)\setminus \{0\}.\)

We note that the notions of an S-graded ring inducing S and of a graded ring studied in [15,16,17, 33] are equivalent.

Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S. A right (left, two-sided) ideal I of R is said to be homogeneous if \(I=\bigoplus _{s\in S}R_s\cap I.\) Also recall that if I is a homogeneous ideal (two-sided) of R and \(I_s=R_s\cap I,\) then \(R/I=\bigoplus _{s\in S}R_s/I_s\) is an S-graded ring inducing S [17, 24, 33].

An S-graded ring inducing S is said to be graded right Artinian [15,16,17, 33] if it satisfies the descending chain condition on its homogeneous right ideals. If R is graded right Artinian, and if S is cancellative, it is easy to see that \(R_e\) is right Artinian for every \(e\in E(S)\) [17].

An S-graded ring inducing S is said to be a graded division ring [33] if its homogeneous part without the zero element forms a group with respect to the ring multiplication.

Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S,  and let \((M,+)=(\bigoplus _{d\in D}M_d,+)\) be a commutative group, where \(\{M_d\}_{d\in D}\) is a family of subgroups of M. Then M is said to be a graded right R-module [17, 33] if for every \(d\in D\) and every \(s\in S\) there exists \(d'\in D\) such that \(M_dR_s\subseteq M_{d'}.\) If \(0\ne x\in \bigcup _{d\in D}M_d,\) then \(\deg (x)\) is a unique d for which \(x\in M_d.\) Of course, every S-graded ring inducing S is a graded right module over itself.

Let R be an S-graded ring inducing S and let \(M=\bigoplus _{d\in D}M_d\) and \(M'=\bigoplus _{d'\in D'}M'_{d'}\) be graded right R-modules. Then an R-homomorphism \(f:M\rightarrow M'\) is said to be homogeneous [15, 17, 33] if \(f(\bigcup _{d\in D}M_d)\subseteq \bigcup _{d'\in D'}M'_{d'}\) and if for x\(y\in \bigcup _{d\in D}M_d\) such that f(x),  \(f(y)\ne 0,\) we have that \(\deg (f(x))=\deg (f(y))\) implies that \(\deg (x)=\deg (y).\) If, moreover, f is bijective, then M and \(M'\) are said to be graded isomorphic.

2.2 The Graded Jacobson Radical

Throughout the article, the classical Jacobson radical of a ring A is denoted as usual by J(A).

Let R be an S-graded ring inducing S and let us assume that S is cancellative. A homogeneous right ideal I of R is said to be a graded modular right ideal [15, 17] if there exists a homogeneous element \(u\in R\) such that \(ux-x\in I\) for every homogeneous element \(x\in R.\) The cancellativity of S gives that \(\deg (u)\) is an idempotent element of S,  and that all such elements u are of the same degree, which is referred to as the degree of I.

The graded Jacobson radical \(J^g(R)\)of R [15, 17] is the intersection of all maximal graded modular right ideals of R. If \(J^g(R)=0,\) we say that R is graded semisimple. For the study of other graded radicals of S-graded rings inducing S,  we refer the reader to [18,19,20, 23, 26] and references therein.

Let e be an idempotent element in \(S^*.\) There exists a one-to-one correspondence between the set of all maximal graded modular right ideals of R of degree e and the set of all maximal modular right ideals of the ring \(R_e,\) given by \(I\mapsto I\cap R_e,\) see [15, 17]. As a corollary, one obtains the following results.

Theorem 1

( [15, 17]) Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S,  where S is cancellative. Then:

  1. (a)

    \(J^g(R)=\bigoplus _{s\in S}I_s,\) where \(I_s=\{x\in R_s\ |\ (\forall e\in E(S))\ xH_R\cap R_e\subseteq J(R_e)\}.\) In particular, \(J^g(R)\cap R_e=J(R_e)\) for all \(e\in E(S);\)

  2. (b)

    \(J^g(R)=0,\) that is, R is graded semisimple, if and only if the following two conditions are satisfied:

  3. (i)

    \(J(R_e)=0\) for every \(e\in E(S),\) that is, each ring component of R is semisimple;

  4. (ii)

    For every nonzero homogeneous element \(x\in R\) there exists a homogeneous element \(y\in R\) such that xy is a nonzero homogeneous element of an idempotent degree.

Throughout the article, by \(\max _{rm}^e(R)\) we denote the set of all maximal graded modular right ideals of R of degree e,  and by \(\max _r^h(R)\) we denote the set of all maximal homogeneous right ideals of R. Of course, if R is with a homogeneous unity, say of degree \(e\in E(S)^*,\) then every maximal homogeneous right ideal of R is a maximal graded modular right ideal of R of degree e,  in which case \(\max _{rm}^e(R)=\max _r^h(R).\)

2.3 Graded Matrix Rings

Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S,  and let \(n\ge 2\) be an integer. For each \(s\in S,\) let \(M_n(R_s)\) be the set of \(n\times n\) matrices over the component \(R_s.\) Then the full matrix ring \(M_n(R)\) is S-graded with the components \((M_n(R))_s=M_n(R_s)\) \((s\in S).\) If R is trivially graded, then \(M_n(R)\) can be graded by a Brandt semigroup, a rectangular band and by a group. One particular case of grading obtained from a Brandt semigroup grading will be discussed in Sect. 4. We refer the reader to [24] and references therein for more details on the other possible gradings.

If R is an S-graded ring inducing S,  then R is a direct product of graded rings if there exists a family of homogeneous ideals \(\{I_\lambda \}_{\lambda \in \Lambda }\) of R such that \(R=\prod _{\lambda \in \Lambda }I_\lambda .\) The following graded version of the Wedderburn–Artin Theorem holds true.

Theorem 2

( [16, 17]) Let R be an S-graded ring inducing S with a cancellative S. If R is graded semisimple and graded right Artinian, then there exist positive integers p and \(n_1,\) \(\dots ,\) \(n_p\) such that R is graded isomorphic to a direct product \(M_{n_1}(F_1)\times \dots \times M_{n_p}(F_p),\) where each \(M_{n_i}(F_i)\) is a graded matrix ring over a graded division ring \(F_i.\)

3 Homogeneous Co-maximal Graphs of Groupoid-Graded Rings

Throughout this section, unless stated otherwise, \(R=\bigoplus _{s\in S}R_s\) is an S-graded ring inducing S with unity 1,  and with S assumed to be cancellative. Then, as we know from [17], the set of all idempotent elements E(S) of S is finite, and the ring R is pseudo-unitary, that is:

  1. (i)

    For every \(e\in E(S),\) the ring \(R_e\) is a ring with unity \(1_e;\)

  2. (ii)

    For every \(x\in H_R\) there exist e\(f\in E(S)\) such that \(1_ex=x=x1_f.\)

Moreover, \(1=\sum _{e\in E(S)}1_e.\)

For a similar concept, in case ring is graded by an l.i.-semigroup and in case it is graded by a small category all of whose morphisms are invertible, we refer the reader to [2] and [10], respectively.

Definition 1

Let x be a nonzero homogeneous element of R of degree s. We say that x is locally right invertible if there exist \(e\in E(S)^*\) and \(x^r\in R\) such that \(xx^r=1_e.\) Element \(x^r\) is called a right inverse of x. Analogously, we say that x is locally left invertible if there exist \(f\in E(S)^*\) and \(x^l\in R\) such that \(x^lx=1_f.\) Element \(x^l\) is called a left inverse of x. We say that x is locally invertible or locally two-sided invertible if it is both locally right and locally left invertible. The set of all locally right, locally left and locally two-sided invertible elements of R is denoted by \(U_l(R).\)

Of course, if \(|E(S)^*|=1,\) then a locally right invertible (locally left invertible, locally invertible) element is a right invertible (left invertible, invertible) homogeneous element in the classical sense and vice-versa.

By the following proposition, the inverses of elements from \(U_l(R)\) may be assumed to be homogeneous.

Proposition 1

Let x be a nonzero homogeneous element of R of degree s. Then x is a locally right (locally left) invertible element if and only if there exist \(e\in E(S)^*\) \((f\in E(S)^*)\) and a homogeneous element \(x^r\) \((x^l)\) of R of degree \(s^{-1}\in S\) such that \(xx^r=1_e\) \((x^lx=1_f).\) Moreover, \(s^{-1}\) is a unique element of S such that \(ss^{-1}=e,\) \(es=s,\) and \(s^{-1}e=s^{-1}\) \((s^{-1}s=f,\) \(sf=s,\) and \(fs^{-1}=s^{-1})\). If x is locally invertible, then \(\deg (x^r)=\deg (x^l).\)

Proof

If there exist \(e\in E(S)^*\) and a homogeneous element \(x^r\in R\) such that \(xx^r=1_e,\) then x is locally right invertible by the very definition. So, let x be a locally right invertible element. By the definition of a locally right invertible element, there exist \(e\in E(S)^*\) and \(x^r\in R\) such that \(xx^r=1_e.\) Let \(x^r=\sum _{t\in S}(x^r)_t\) be a unique homogeneous decomposition of \(x^r.\) Then, since S is cancellative, there exists a unique \(t\in S\) such that \(x(x^r)_t=1_e.\) Let \(s^{-1}=t.\) Then, \(ss^{-1}=e.\) Since R is pseudo-unitary, there exist \(e', e''\in E(S)^*\) such that \(1_{e'}x=x\) and \((x^r)_t1_{e''}=(x^r)_t.\) Moreover, for all distinct g\(h\in E(S),\) we have that \(1_{g}1_{h}=0.\) Since \(1_ex(x^r)_t=x(x^r)_t1_e=x(x^r)_t=1_e\ne 0,\) it follows that \(e'=e=e''.\) Therefore, \(es=s,\) and \(s^{-1}e=s^{-1}.\)

The statement regarding a locally left invertible element can be proved analogously.

Now, let x be a locally invertible element. According to what we have just proved, there exist e\(f\in E(S)^*\) and \(x^r,\) \(x^l\in H_R,\) such that \(xx^r=1_e\) and \(x^lx=1_f.\) Then, \(s\deg (x^r)=e,\) \(\deg (x^l)s=f,\) \(es=sf=s,\) \(f\deg (x^l)=\deg (x^l),\) and \(\deg (x^r)e=\deg (x^r).\) Since \(es=s=sf,\) we have that \(1_ex=x=x1_f.\) Hence, we obtain that \(xx^rx=1_ex=x\ne 0\) and \(xx^lx=x1_f=x\ne 0.\) It follows that \(s\deg (x^r)s=s\) and \(s\deg (x^l)s=s.\) Therefore, since S is cancellative, \(\deg (x^r)=\deg (x^l).\) \(\square \)

The following lemma represents a graded version of Remark 1 from [4], and it holds for rings which are not necessarily with unity. By a graded domain, we mean a graded ring without nontrivial homogeneous zero divisors (left, right or two-sided).

Lemma 1

Let \(R=\bigoplus _{s\in S}R_s\) be an S-graded ring inducing S,  not necessarily with unity, and let S be cancellative. If the set of all homogeneous zero divisors \(D^h(R)\) of R is finite, then \(H_R\) is either finite or R is a graded domain.

Proof

Let us assume that R is not a graded domain. Then \(D^h(R)^*=D^h(R)\setminus \{0\}\) is nonempty, and by assumption, \(|D^h(R)|<\infty .\) Let \(x\in D^h(R)^*\) be a right zero divisor. Since S is cancellative, \((0:x)_r=\{a\in R\ |\ xa=0\}\) is a homogeneous right ideal of R. Clearly, \(H_{(0:x)_r}=\bigcup _{s\in S}(0:x)_r\cap R_s\subseteq D^h(R),\) and so, \(H_{(0:x)_r}\) is finite. Now, xR is a homogeneous right ideal of R and \(H_{xR}=\bigcup _{s\in S}xR\cap R_s\subseteq D^h(R).\) Therefore, \(H_{xR}\) is also finite. Since \((0:x)_r\) is a homogeneous right ideal, \(R/(0:x)_r\) is an S-graded right R-module. It is known from [17], and easy to verify, that the mapping \(f:R\rightarrow xR\) defined by \(f(a)=xa\) \((a\in R)\) is a surjective homogeneous R-homomorphism, and therefore, \(R/(0:x)_r\) and xR are graded isomorphic as graded right R-modules (see also for instance [18]). It is also easy to verify that the relation \(\sim \) on \(H_R,\) defined by \(a\sim b\) if and only if either both a and b belong to \(H_{(0:x)_r}\) or \(\deg (a)=\deg (b)\) and \(a-b\in H_{(0:x)_r},\) is an equivalence relation on \(H_R\) (see for instance [33]). However, this implies that \(|H_R|=|H_{(0:x)_r}||H_{xR}|\le |D^h(R)|^2,\) which completes the proof. \(\square \)

Definition 2

The homogeneous co-maximal graph of R,  denoted by \(\Gamma ^h(R),\) is a graph whose vertex set is \(H_R\setminus U_l(R)\) and vertices x and y are adjacent if and only if \(xR+yR=R.\)

Remark 1

It is clear that 0 is an isolated vertex in \(\Gamma ^h(R).\) Hence, \(\Gamma ^h(R)\) is a disconnected graph. It is also easy to see that the notion of \(\Gamma ^h(R)\) cannot be extended to graphs which contain loops. Namely, if \(x\ne 0\) is adjacent to x,  then \(xR=R.\) Since R is pseudo-unitary, there exists \(e\in E(S)^*\) such that \(1_ex=x.\) Now, \(xR=R\) implies that there exists \(y\in R\) such that \(xy=1_e.\) Hence, x is locally right invertible, a contradiction.

Lemma 2

Let s\(t\in S^*\) be such that \(st=e\in E(S)^*.\) If \(u\in S^*\) and \(f\in E(S)^*\) are such that \(su=f,\) then \(u=t\) and \(f=e.\)

Proof

Since \(st=e\in E(S)^*,\) there exist \(x\in R_s\) and \(y\in R_t\) such that \(xy\ne 0\) and \(xy\in R_e.\) Now, \(xy=1_exy\ne 0.\) Therefore, \(st=(es)t.\) Since S is cancellative, this implies that \(es=s.\) Similarly, we obtain that \(fs=s.\) Since \(es=s\) and \(fs=s,\) the cancellativity of S implies that \(f=e.\) Now, since \(st=e\) and \(su=f=e,\) it follows that \(u=t.\) \(\square \)

Lemma 3

If the edge set of \(\Gamma ^h(R)\) is nonempty, then \(|E(S)^*|=1.\)

Proof

Let x and y be adjacent vertices of \(\Gamma ^h(R),\) and let \(\deg (x)=s\) and \(\deg (y)=t.\) Then \(xR+yR=R.\) Therefore, there exist a\(b\in R\) such that \(xa+yb=1.\) Moreover, we know that \(1=\sum _{e\in E(S)}1_e.\) We have the following cases.

Case 1 \(\deg (x)=\deg (y)=s.\)

Subcase 1a. \(s\notin E(S).\) Since S is cancellative and \(\deg (x)=\deg (y),\) by Lemma 2 we obtain that there exists a unique \(e\in E(S)^*\) such that \(1=(xa)_e+(yb)_e.\) Note that both \((xa)_e\) and \((yb)_e\) are nonzero. Namely, suppose for instance that \((yb)_e=0.\) Then \((xa)_e=1,\) which implies that \(E(S)^*=\{e\}\) and x is a locally right invertible element, a contradiction. Therefore, \(1=u+v,\) where \(u=(xa)_e,\) \(v=(yb)_e,\) and u\(v\ne 0.\) It follows that \(1=1_e,\) and so, \(|E(S)^*|=1.\)

Subcase 1b. \(s\in E(S)^*.\) Since R is pseudo-unitary, \(st=e\in E(S)^*\) implies that \(t=e.\) However, in a pseudo-unitary ring, \(ef=0\) for all distinct e\(f\in E(S).\) Hence, we obtain that \(1=(xa)_s+(yb)_s.\) Like in the previous subcase, we conclude that \(1=1_s.\) Therefore, again \(|E(S)^*|=1.\)

Case 2 \(\deg (x)\ne \deg (y).\)

Subcase 2a. s\(t\notin E(S).\) By Lemma 2, there exist idempotent elements e\(f\in S^*\) such that \(1=(xa)_e+(yb)_f.\) Since x\(y\notin U_l(R),\) we have that \((xa)_e,\) \((yb)_f\ne 0.\) If \(e\ne f,\) this implies that \((xa)_e=1_e\) and \((yb)_f=1_f.\) Therefore, x and y are locally right invertible elements, a contradiction. Hence, \(e=f,\) and so, \(1=1_e.\) Thus, \(|E(S)^*|=1.\)

Subcase 2b. Either s or t belongs to \(E(S)^*.\) Assume for instance that \(s\in E(S)^*\) and \(t\notin E(S).\) By reasoning like in the Subcase 1b, we conclude that the only possible nonzero component of xa of an idempotent degree is \((xa)_s.\) Moreover, by Lemma 2, there exists a unique \(e\in E(S)^*\) such that \(1=(xa)_s+(yb)_e.\) Like in the previous subcase, we must have that \((xa)_s,\) \((yb)_e\ne 0\) and that \(s=e.\) Hence, \(1=1_e,\) and so, \(|E(S)^*|=1.\)

Subcase 2c. s\(t\in E(S)^*.\) This case cannot occur. Namely, proceeding as in the previous cases, we obtain that \(1=(xa)_s+(yb)_t\) and \((xa)_s,\) \((yb)_t\ne 0.\) Since \(s\ne t,\) it follows that \((xa)_s=1_s\) and \((yb)_t=1_t.\) However, this is impossible, since x and y are not locally right invertible elements of R. \(\square \)

We finish this section with a result that characterizes the connectedness of the graph \(\Gamma ^h(R)\setminus J^g(R).\) We remove the vertices that come from \(J^g(R),\) since every vertex of \(\Gamma ^h(R)\) that belongs to \(J^g(R)\) is isolated. Indeed, let \(x\in J^g(R).\) Since 0 is an isolated vertex in \(\Gamma ^h(R),\) let us assume that \(x\ne 0.\) If y is a homogeneous element of R adjacent to x,  then, by Lemma 3, there exists a single nonzero idempotent element \(e\in S.\) Since \(xR+yR=R,\) there exist homogeneous elements a\(b\in R\) such that xa\(yb\in R_e,\) and \(xa+yb=1_e.\) However, \(x\in J^g(R).\) Therefore, we obtain that \(xa\in J^g(R)\cap R_e,\) and so, \(xa\in J(R_e)\) by Theorem 1a). Hence, \(yb=1_e-xa\) is a unit in \(R_e,\) a contradiction. Therefore, x is an isolated vertex in \(\Gamma ^h(R).\) Also, if R contains a unique maximal graded modular right ideal M,  it coincides with \(J^g(R),\) and \(\Gamma ^h(R)\) is totally disconnected. Hence, taking into account Lemma 3, if \(\Gamma ^h(R)\setminus J^g(R)\) is connected, R must have at least two maximal graded modular right ideals of the same degree.

Theorem 3

Let R be a graded semisimple and a graded right Artinian ring. Also, let R be such that \(|\max _{rm}^e(R)|\ge 2\) for every \(e\in E(S)^*.\) Then \(\Gamma ^h(R)\setminus \{0\}\) is a connected graph if and only if \(|E(S)^*|=1.\) Moreover, in that case, the diameter of \(\Gamma ^h(R)\setminus \{0\}\) is at most 5.

Proof

\((\Rightarrow )\) Let \(\Gamma ^h(R)\setminus \{0\}\) be connected. Since there are at least two maximal graded modular right ideals of R of degree e,  for every \(e\in E(S)^*,\) all of them are distinct from 0. Having in mind that there is a one-to-one correspondence between the maximal graded modular right ideals of R of degree e and the maximal modular right ideals of \(R_e,\) for every \(e\in E(S),\) none of the maximal graded modular right ideals of R contains a locally right invertible element. So, there must be at least two distinct vertices in \(\Gamma ^h(R)\setminus \{0\}.\) Since \(\Gamma ^h(R)\setminus \{0\}\) is connected, its edge set is nonempty. Hence, \(|E(S)^*|=1\) by Lemma 3.

\((\Leftarrow )\) Let \(E(S)^*=\{e\}.\) Let us observe a subgraph \(\Gamma '\) of \(\Gamma ^h(R)\setminus \{0\}\) that has only the elements from \(R_e\) as vertices. We claim that \(\Gamma '=\Gamma (R_e){\setminus }\{0\}.\) Let x\(y\in \Gamma '\) be adjacent in \(\Gamma ^h(R)\setminus \{0\}.\) Then \(xR+yR=R.\) Now, \(xR_e+yR_e\subseteq R_e.\) On the other hand, R is with unity \(1=1_e\in R_e\subseteq R=xR+yR.\) Hence, there exist a\(b\in R\) such that \(1_e=xa+yb.\) Since x\(y\in R_e,\) we get that \(1_e=xa_e+yb_e\in xR_e+yR_e,\) where \(a_e\) and \(b_e\) are the e-components of a and b,  respectively. Therefore, for any \(z\in R_e,\) we have that \(z=1_ez\in (xR_e+yR_e)z\subseteq xR_e+yR_e.\) Thus, \(xR_e+yR_e=R_e,\) that is, x and y are adjacent as vertices of \(\Gamma (R_e)\setminus \{0\}.\) It follows that \(\Gamma '\subseteq \Gamma (R_e)\setminus \{0\}.\) Now, let x\(y\in \Gamma (R_e)\setminus \{0\}\) be adjacent. Then \(xR_e+yR_e=R_e.\) Hence, for some a\(b\in R_e,\) we have that \(1_e=xa+yb.\) However, \(1=1_e.\) Therefore, for every \(z\in R,\) we get that \(z=1_ez=(xa+yb)z\subseteq xR+yR,\) and so, \(R\subseteq xR+yR.\) Therefore, \(xR+yR=R,\) that is, x and y are adjacent as vertices of \(\Gamma ^h(R)\setminus \{0\}.\) Since x\(y\in R_e,\) they are adjacent as vertices of \(\Gamma '.\) Hence, indeed, \(\Gamma '=\Gamma (R_e)\setminus \{0\}.\) Now, since R is graded right Artinian, and since S is cancellative, \(R_e\) is right Artinian. Moreover, there exists a one-to-one correspondence between the set of all maximal graded modular right ideals of R of degree e and maximal modular right ideals of \(R_e.\) Since R is with unity \(1_e,\) every maximal homogeneous right ideal of R is a maximal graded modular right ideal of R of degree e. Hence, by the hypotheses, \(R_e\) contains at least two maximal right ideals. Also, since R is graded semisimple, the ring \(R_e\) is semisimple by Theorem 1b). Therefore, \(\Gamma (R_e)\setminus \{0\}=\Gamma '\) is a connected graph according to Theorem 3.2 in [43]. By the same theorem, the diameter of \(\Gamma '\) is at most 3. Now, let \(x\in \Gamma ^h(R)\setminus \{0\}\) be such that \(\deg (x)=s\ne e.\) Since R is graded semisimple, by Theorem 1b), there exists a homogeneous element \(a\in R\) such that \(0\ne xa\in R_e.\) Since x is not locally right invertible in R,  nor is xa right invertible in \(R_e.\) However, \(\Gamma '\) is connected. Therefore, for every \(w\in \Gamma (R_e)\setminus \{0\},\) distinct from xa,  there exists a path between xa and w,  of length at most 3. Since \(R_e\) contains at least two maximal right ideals, it follows that there exists \(y\in \Gamma (R_e)\setminus \{0\},\) distinct from xa,  such that \(xaR_e+yR_e=R_e.\) Thus, \(1=1_e=xau+yv,\) for some u\(v\in R_e.\) Hence, \(1\in xR+yR,\) and therefore, \(xR+yR=R.\) In other words, x and y are adjacent in \(\Gamma ^h(R)\setminus \{0\}.\) Therefore, for every nonzero \(w\in R_e,\) there exists a path in \(\Gamma ^h(R)\setminus \{0\}\) between x and w of length at most 4. Since x was chosen arbitrarily, \(\Gamma ^h(R)\setminus \{0\}\) is a connected graph with the diameter at most 5. \(\square \)

4 Homogeneous Co-maximal Graphs of Groupoid-Graded Matrix Rings

Let \({\mathbb {F}}_q\) be a finite field with q elements, with unity 1,  and let \(R=M_n({\mathbb {F}}_q)\) be the ring of \(n\times n\) matrices over \({\mathbb {F}}_q\) under the usual matrix addition and multiplication, where n is a positive integer.

We know that R can be graded by a Brandt semigroup, a rectangular band and by a group, see [24]. In accordance with Lemma 3, there is only interest in gradings whose grading sets (with zero) contain a single (nonzero) idempotent element. The case of a trivial grading is covered by the results obtained in [43]. So, there are two interesting options left: a nontrivial group grading and a nontrivial grading obtained from a Brandt semigroup, distinct from a group with zero, with a single nonzero idempotent element.

R can be naturally graded by a groupoid with a single nonzero idempotent element, and which is distinct from a group with zero. In this article, we consider this grading only, which moreover “encodes” the good group gradings (see [13, 24, 37]). Indeed, let \(R_e\) be the set \(D_n({\mathbb {F}}_q)\) of all diagonal matrices of R. For \(i\ne j,\) let \(R_{(i,j)}\) be the set of all matrices of R with entries from \({\mathbb {F}}_q\) at the (ij) position and zeroes elsewhere. Define

$$\begin{aligned}S:=\{(i,j)\ |\ i,j\in \{1,\dots ,n\},\ i\ne j\}\cup \{0,e\}\end{aligned}$$

and put \(R_0\) to be the zero matrix. Then \(R=\bigoplus _{s\in S}R_s\) is an S-graded ring inducing S,  and S is a groupoid with respect to the induced operation \((i,j)(k,l)=\delta _{jk}(i,l),\) for \(i\ne l,\) and \((i,j)(k,i)=\delta _{jk}e,\) where \(\delta _{jk}\) is the Kronecker delta, 0 is the zero element of S,  and \(e^2=e\) is such that \(e(i,j)=(i,j)e=(i,j)\) for all (ij). Moreover, R is a pseudo-unitary S-graded ring inducing S with a homogeneous unity \(1_e=1_{M_n({\mathbb {F}}_q)},\) where \(1_{M_n({\mathbb {F}}_q)}\) is the identity matrix of \(M_n({\mathbb {F}}_q).\) Hence, \(\max _{rm}^e(R)=\max _r^h(R).\) Note that \(R=\bigoplus _{s\in S^*}R_s,\) and \(S^*=S\setminus \{0\}\) is a partial groupoid. Of course, if \(n=1,\) then \(R=R_e={\mathbb {F}}_q\) is trivially graded.

Throughout this section, for any full matrix ring \(M_n(F)\) over a finite field F with unity 1,  by \(e_{(i,j)}\) we denote the matrix having 1 at the (ij) position and zeroes elsewhere. The zero matrix of \(M_n(F)\) is denoted by \(0_{M_n(F)},\) and the subset of all diagonal matrices of \(M_n(F)\) is denoted by \(D_n(F).\) Also, when we say that a matrix ring over a finite field is S-graded, we mean that it is graded in the above described way.

If A is a ring with unity, the set of all maximal right ideals of A is denoted by \(\max _r(A).\)

Lemma 4

Let \({\mathbb {F}}_q\) be a finite field with q elements, and let us observe \(R=M_n({\mathbb {F}}_q)\) as an S-graded ring, where n is a positive integer. Then the following statements hold:

  1. (i)

    \(|\max _r^h(R)|=n;\)

  2. (ii)

    Every maximal homogeneous right ideal of R is generated by a homogeneous matrix of rank \(n-1,\) and the number of such matrices is \({\left\{ \begin{array}{ll} 2(q-1) &{} \mathrm {if}\quad n=2;\\ (q-1)^{n-1} &{} \mathrm {if}\quad n\ne 2. \end{array}\right. }\)

Proof

  1. (i)

    Since R is a ring with a homogeneous unity, there exists a one-to-one correspondence between the maximal homogeneous right ideals of R and the maximal right ideals of \(R_e.\) Now, \(R_e\) is a subset of R which consists of all diagonal matrices of R. Hence, \(|\max _r(R_e)|=n,\) which proves the claim.

  2. (ii)

    Let I be a maximal homogeneous right ideal of R. We know that I is principal, observed as a right ideal of R,  and every matrix of I of rank \(n-1\) can serve as a generator of I (see for instance Lemma 4.2 in [43]).

Case 1 \(n=1.\) This is a trivial case when \(R={\mathbb {F}}_q\) and \(\{0\}\) is the only maximal right ideal of R. Hence, the number of homogeneous generators of rank 0 is \(1=(q-1)^{n-1}=(q-1)^0,\) namely, the zero element of \({\mathbb {F}}_q.\)

Case 2 \(n=2.\) There are two maximal homogeneous right ideals of R,  namely, \(\left( \begin{array}{cc} 0 &{} 0 \\ {\mathbb {F}}_q &{} {\mathbb {F}}_q \end{array}\right) \) and \(\left( \begin{array}{cc} {\mathbb {F}}_q &{} {\mathbb {F}}_q \\ 0 &{} 0 \end{array}\right) .\) Let, for instance, \(I=\left( \begin{array}{cc} 0 &{} 0 \\ {\mathbb {F}}_q &{} {\mathbb {F}}_q \end{array}\right) .\) Then the homogeneous matrices of rank \(n-1=1\) that generate I are the matrices \(\left( \begin{array}{cc} 0 &{} 0 \\ a_{(2,1)} &{} 0 \end{array}\right) ,\) \(\left( \begin{array}{cc} 0 &{} 0 \\ 0 &{} a_{(2,2)} \end{array}\right) ,\) where \(a_{(2,1)},\) \(a_{(2,2)}\) are the arbitrary nonzero elements of \({\mathbb {F}}_q.\) Hence, I has \(2(q-1)\) homogeneous generators of rank 1. Of course, the number of generators is the same for the other ideal too.

Case 3 \(n>2.\) In this case, the only homogeneous matrices of R of rank \(n-1\) are matrices that come from \(R_e.\) For \(i\in \{1,\dots ,n\},\) they are of the form

$$\begin{aligned} \left( \begin{array}{cccccccc} a_{(1,1)} &{} \dots &{} 0 &{} 0 &{} 0 &{} \dots &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ 0 &{} \dots &{} a_{(i-1,i-1)} &{} 0 &{} 0 &{} \dots &{} 0 \\ 0 &{} \dots &{} 0 &{} 0 &{} 0 &{} \dots &{} 0 \\ 0 &{} \dots &{} 0 &{} 0 &{} a_{(i+1,i+1)} &{} \dots &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots &{} \vdots \\ 0 &{} \dots &{} 0 &{} 0 &{} 0 &{} \dots &{} a_{(n,n)} \end{array}\right) , \end{aligned}$$
(1)

where \(a_{(k,k)}\in {\mathbb {F}}_q^*,\) \(k=1,\dots ,i-1,i+1,\dots ,n.\) Hence, there are \((q-1)^{n-1}\) such matrices. \(\square \)

In what follows, if \(G=(V,E)\) is a graph, the degree of \(v\in V(G)\) is denoted by \(\deg _G(v).\) As usual, the minimal degree and the maximal degree among the vertices of G are denoted by \(\delta (G)\) and \(\Delta (G),\) respectively. Recall that G is said to be regular of degree r(G) if \(r(G)=\delta (G)=\Delta (G).\) The connectivity number, the diameter, and the chromatic number of G are denoted by \(\kappa (G),\) d(G),  and \(\chi (G),\) respectively. By \(\omega (G)\), we denote the least upper bound of the cardinal numbers of all the cliques in G.

Theorem 4

Let \({\mathbb {F}}_q\) be a finite field with q elements, and let us observe \(R=M_n({\mathbb {F}}_q)\) as an S-graded ring, where \(n\ge 2.\) Also, let \(G=\Gamma ^h(R)\setminus \{0_{M_n({\mathbb {F}}_q)}\}.\) Then the following statements hold:

  1. (i)

    \(|V(G)|=q^n-1+n(n-1)(q-1)-(q-1)^n;\)

  2. (ii)

    G is connected and \(d(G)={\left\{ \begin{array}{ll}2 &{} \mathrm {if}\quad n=2,\\ 3 &{} \mathrm {if}\quad n>2;\end{array}\right. }\)

  3. (iii)

    If \(n\ge 3,\) then \(\delta (G)=(q-1)^{n-1}\) and \(\Delta (G)=n(q-1)+\sum _{i=1}^{n-2}\left( {\begin{array}{c}n-1\\ i\end{array}}\right) (q-1)^{i+1};\)

  4. (iv)

    G is regular if and only if \(n=2.\) In that case, \(r(G)=2(q-1);\)

  5. (v)

    \(\kappa (G)=\delta (G)\) and \(\omega (G)=\chi (G)=|\max ^h_r(R)|;\)

  6. (vi)

    \(|\{a\in G\ |\ \deg _G(a)=\delta (G)\}|=n^2(q-1).\)

Proof

  1. (i)

    It is clear that \(|R_e|=q^n.\) Also, \(|R_{(i,j)}|=q\) for all \((i,j)\in S.\) On the other hand, the number of invertible homogeneous elements of R is equal to the number of invertible elements of \(R_e.\) Hence, there are \((q-1)^n\) such elements. Since \(|\{(i,j)\in S\}|=n(n-1),\) and since the zero matrix of R is not a vertex in G,  we therefore obtain that \(|V(G)|=q^n-1+n(n-1)(q-1)-(q-1)^n.\)

  2. (ii)

    According to Lemma 4, the number of maximal homogeneous right ideals of R is n,  and \(n\ge 2\) by the hypothesis. Theorem 1b) implies that R is graded semisimple. Moreover, R is right Artinian. Hence, R is graded right Artinian. So, G is connected by Theorem 3. By the same theorem, \(d(G)\le 5.\)

Let us assume first that \(n=2.\) Then each homogeneous matrix of R of rank 1 generates a maximal homogeneous right ideal of R. Let \(a\in R_e\) be a homogeneous matrix of rank 1 with zero at the (2, 2) position. Then a is adjacent to every nonzero matrix from \(R_{(2,1)}\) and to every nonzero matrix from \(R_e\) which has zero at the (1, 1) position. The same what is said for a can be said for a nonzero matrix \(b\in R_{(1,2)}.\) Hence, a and b are connected by a path of length 2. We analogously conclude that two matrices of rank 1 from the second row, and from distinct columns, are connected by a path of length 2. Hence, if \(n=2,\) we have that \(d(G)=2.\)

Let now \(n>2.\) Take non-invertible a\(b\in R^*\) such that \(aR+bR\ne R.\) Note that all of the homogeneous elements of R,  which are not of degree e,  are matrices of rank 1.

Case 1 Both a and b are of rank 1.

Subcase 1a. a\(b\in R_e.\) Let us assume first that a and b have a nonzero entry at the same position, say (ii). Let \(c\in R_e\) be of rank \(n-1,\) which is of the form (1). Then c is adjacent to both a and b. So, a and b are connected through c. Now, let us assume that a and b have nonzero entries at different positions. Then, there exist \(c\in R_e\) and \(d\in R_e,\) both of rank \(n-1,\) such that \(aR+cR=R\) and \(bR+dR=R.\) Clearly, \(c\ne d,\) and c and d are adjacent. Hence, in that case, a and b are connected by a path \(a-c-d-b.\)

Subcase 1b. \(a\in R_e\) and \(b\notin R_e\) or \(a\notin R_e\) and \(b\in R_e.\) For instance, let \(a\in R_e\) and \(b\notin R_e.\) Assume that the nonzero entry of a is at the (ii) position. Now, let us suppose first that \(b\in R_{(i,j)},\) for some \((i,j)\in S.\) Let \(c\in R_e\) be a matrix of the form (1). Then c is adjacent to both a and b. So, a and b are connected by a path \(a-c-b.\) Let us now assume that \(b\in R_{(k,j)},\) for some \((k,j)\in S,\) where \(k\ne i.\) Again, take \(c\in R_e\) of the form (1). Then a and c are adjacent. However, there exists \(d\in R_e\) of rank \(n-1\) with the zero entry at the (kk) position. Then b and d are adjacent. Since \(k\ne i,\) we have that c and d are adjacent. Therefore, a and b are connected by a path \(a-c-d-b.\)

Subcase 1c. a\(b\notin R_e.\) Assume that \(a\in R_{(i,j)}\) and \(b\in R_{(k,l)},\) for some (ij),  \((k,l)\in S.\) By reasoning similarly to the previous subcases, if \(i=k,\) we obtain that a and b are connected by a path of length 2,  and, if \(i\ne k,\) we obtain that a and b are connected by a path of length 3.

Case 2 One of the matrices is of rank 1 and the other has the rank at least 2 and at most \(n-1.\) For instance, let the rank of a be 1. Then \(b\in R_e.\)

Subcase 2a. \(a\in R_e\) with the nonzero (ii) entry. Let \(c\in R_e\) be a matrix of the form (1). Then a and c are adjacent. Of course, if \(b=c,\) then a and b are adjacent. So, let \(b\ne c.\) Assume that b has a zero entry at the (ii) position. Let \(d\in R_e\) be of rank \(n-1\) whose zero entry is not at the (ii) position. Then b and d are adjacent, and so are c and d. Hence, a and b are connected by a path \(a-c-d-b.\) Assume now that b has a nonzero entry at the (ii) position. Then b and c are adjacent. So, a and b are connected by a path \(a-c-b.\)

Subcase 2b. \(a\notin R_e.\) Let \(a\in R_{(i,j)},\) for some \((i,j)\in S.\) We may proceed as in the previous case and conclude that either a and b are adjacent or they are connected by a path of length 2 or they are connected by a path of length 3.

Therefore, taking into account all of the cases, if \(n>2,\) we have that \(d(G)=3.\)

  1. (iii)

    Every nonzero homogeneous element x of R,  which is of rank 1,  is adjacent to y only if yR is a maximal homogeneous right ideal of R. Therefore, by Lemma 4, if \(x\in R_{(i,j)}\) or if \(x\in R_e,\) but with a nonzero entry at the (ii) position, then \(y\in R_e\) is of the form (1), and there are \((q-1)^{n-1}\) such elements. It follows that \(\delta (G)=(q-1)^{n-1}.\) Now, let x be a homogeneous element of R that generates a maximal right ideal of R. Then x is of the form (1), for some \(i\in \{1,\dots ,n\}.\) Hence, as a vertex of G,  it is adjacent to every nonzero matrix from \(R_{(i,j)}\) for all \(j=1,\dots ,i-1,i+1,\dots ,n.\) There are \((n-1)(q-1)\) such matrices. Element x is also adjacent to every matrix of rank 1 that belongs to \(R_e,\) but has the only nonzero entry at the (ii) position. Of course, there are \(q-1\) such matrices. Moreover, x is adjacent to every homogeneous element \(y\in R_e\) of rank greater than 1 and less than n,  which has a nonzero entry at the (ii) position. There are \(\sum _{i=1}^{n-2}\left( {\begin{array}{c}n-1\\ i\end{array}}\right) (q-1)^{i+1}\) such elements. Hence, \(\Delta (G)=n(q-1)+\sum _{i=1}^{n-2}\left( {\begin{array}{c}n-1\\ i\end{array}}\right) (q-1)^{i+1}.\)

  2. (iv)

    Let \(n=2.\) As we have already pointed out in the proof of ii),  every nonzero matrix from \(e_{(1,1)}Re_{(1,1)}\) is adjacent to every nonzero matrix from both \(e_{(2,1)}Re_{(1,1)}\) and \(e_{(2,2)}Re_{(2,2)}.\) The same holds true for every nonzero matrix from \(e_{(1,2)}Re_{(2,2)}.\) Symmetrically, every nonzero matrix from \(e_{(2,1)}Re_{(1,1)}\) and every nonzero matrix from \(e_{(2,2)}Re_{(2,2)}\) is adjacent to every nonzero matrix from both \(e_{(1,1)}Re_{(1,1)}\) and \(e_{(1,2)}Re_{(2,2)}.\) Hence, \(\delta (G)=\Delta (G)=2(q-1).\) If \(n>2,\) then, clearly by iii), 

    $$\begin{aligned} \delta (G)=(q-1)^{n-1}=\deg _G(e_{(1,1)})<\deg _G(e_{(1,1)}+e_{(2,2)}) \le \Delta (G). \end{aligned}$$

    So, indeed, G is regular if and only if \(n=2.\)

  3. (v)

    These statements are proved analogously to the way the corresponding statements for the non-graded case are proved (cf. statements v) and vii) of Theorem 4.3 in [43]). For the readers’ convenience, we provide a proof for the assertion concerning the chromatic number. We know that \(\omega (G)\le \chi (G).\) According to Lemma 4, the number of all maximal homogeneous right ideals of R is n. Let \(\{M_1,\dots ,M_n\}\) be the set of all homogeneous maximal right ideals of R. Put \(X_1=M_1\) and \(X_i=M_i{\setminus } M_i\cap (M_1\cup \dots \cup M_{i-1})\) for every \(i=2,\dots ,n.\) Then each \(X_i\) is an independent set, \(G=\bigcup _{i=1}^nX_i,\) and \(X_i\cap X_j=\emptyset \) for all \(i\ne j.\) It follows that \(\chi (G)\le n.\) Let \(x_i\in G\) be a homogeneous generator of \(M_i.\) By Lemma 4, the set \(\{x_1,\dots ,x_n\}\) forms a clique of order n. Hence, \(n\le \omega (G),\) which concludes the proof.

  4. (vi)

    In order to find the cardinality of \(\{a\in G\ |\ \deg _G(a)=\delta (G)\},\) it is enough to count the number of homogeneous elements of R of rank 1. The number of matrices from \(R_e\) of rank 1 is obviously \(n(q-1).\) Also, for every \((i,j)\in S,\) we have that \(|R_{(i,j)}\setminus \{0_{M_n({\mathbb {F}}_q)}\}|=q-1.\) Therefore,

    $$\begin{aligned} |\{a\in G\ |\ \deg _G(a)=\delta (G)\}|=n(q-1)+n(n-1)(q-1)=n^2(q-1), \end{aligned}$$

    as asserted.

\(\square \)

Let A and B be arbitrary rings, and let \(\Gamma (A)\) and \(\Gamma (B)\) be the co-maximal graphs of A and B,  respectively. Example 4.4 in [43] shows that the implication \(\Gamma (A)\cong \Gamma (B)\Rightarrow A\cong B\) does not hold true in general. Namely, if \(A=M_n({\mathbb {Z}}_4)\) and \(B=M_n({\mathbb {Z}}_2[x]/(x^2)),\) then \(\Gamma (A)\cong \Gamma (B)\) but A is not isomorphic to B. This particular example also shows that in the case of two S-graded rings inducing S,  say A and B,  the graph isomorphism of graphs \(\Gamma ^h(A)\) and \(\Gamma ^h(B)\) does not in general imply that A and B are graded isomorphic as S-graded rings, by observing \(M_n({\mathbb {Z}}_4)\) and \(M_n({\mathbb {Z}}_2[x]/(x^2))\) as trivially graded rings. However, by Theorem 4.5 in [43], if R is a ring with unity and \(n\ge 2,\) then \(\Gamma (R)\cong \Gamma (M_n({\mathbb {F}}_q))\) implies that \(R\cong M_n({\mathbb {F}}_q).\) Here, we obtain an S-graded version of this result.

Let us recall a few notions first. If \(G=(V,E)\) is a graph and \(V'\subset V,\) then \(\langle V'\rangle \) denotes the induced subgraph, whose vertex set is \(V'\) and with vertices being adjacent if and only if they are adjacent in G. Let \(G_1=(V_1,E_1)\) and \(G_2=(V_2,E_2)\) be such that \(V_1\cap V_2=\emptyset \) and \(E_1\cap E_2=\emptyset .\) The join of \(G_1\) and \(G_2\) is a graph \(G_1\cup G_2\) with the edges that join \(V_1\) and \(V_2\) being added.

Theorem 5

Let \({\mathbb {F}}_q\) be a finite field with q elements, and let us observe \(M_n({\mathbb {F}}_q)\) as an S-graded ring, where \(n\ge 2.\) Also, let R be an S-graded ring with unity, and \(\mathrm {supp}(R)=S^*.\) If \(G'=\Gamma ^h(R)\cong \Gamma ^h(M_n({\mathbb {F}}_q))=G,\) then R and \(M_n({\mathbb {F}}_q)\) are graded isomorphic as S-graded rings.

Proof

Since R is S-graded and R is with unity 1,  let us note that 1 is a homogeneous element \(1_e.\) So, \(\max ^e_{rm}(R)=\max ^h_r(R).\) Every homogeneous zero divisor of R is a vertex in \(G'.\) On the other hand, the number of homogeneous elements of \(M_n({\mathbb {F}}_q)\) is finite. Therefore, since \(G\cong G',\) the number of homogeneous zero divisors of R is finite. Hence, by Lemma 1, it follows that the homogeneous part of R is finite. In particular, R is graded right Artinian. If \(J^g(R)\ne 0,\) then \(G'\) contains more than one isolated vertex, according to the discussion preceding Theorem 3. This implies that the same holds true for G,  which is a contradiction by Theorem 4ii). Therefore, R is graded semisimple. Then, by Theorem 2, there exist positive integers p and \(n_1,\) \(\dots ,\) \(n_p\) such that R is graded isomorphic to a direct product \(M_{n_1}(F_1)\times \dots \times M_{n_p}(F_p),\) where each \(M_{n_i}(F_i)\) is a graded matrix ring over a graded division ring \(F_i.\) Each \(M_{n_i}(F_i)\) is a homogeneous ideal of R,  that is, an S-graded ring. Hence, each \(M_{n_i}(F_i)\) is an \(S_i\)-graded ring inducing \(S_i,\) where \(S_i\) is a subgroupoid of S. On the other hand, we know, and it is easy to check, that a graded division ring is graded by a group, and, that its ring component is a division ring (see for instance [33]). Now, \(\{e\}\) is the only nonzero subgroup of S. Hence, each \(F_i\) is trivially graded, that is, each \(F_i\) is a division ring. Moreover, \(H_R\) is finite, which implies that each \(F_i\) is a finite field, say \(q_i=|F_i|.\) So, each \(M_{n_i}(F_i)\) is an \(S_i\)-graded ring \(M_{n_i}({\mathbb {F}}_{q_i}).\) Let \(\phi \) be a graph isomorphism from G onto \(G'.\) Note that \(\phi \) is also a graph isomorphism between the graphs \(G\setminus \{0_{M_n({\mathbb {F}}_q)}\}\) and \(G'\setminus \{0_R\}.\) For every i,  denote by \(M_i\) the set of all maximal right ideals of R of the form

$$\begin{aligned}M_{n_1}(F_1)\times \dots \times M_{n_{i-1}}(F_{i-1})\times M\times M_{n_{i+1}}(F_{i+1})\times \dots \times M_{n_p}(F_p),\end{aligned}$$

where M is a maximal homogeneous right ideal of \(M_{n_i}(F_i).\) Then \(\max ^h_r(R)=\bigcup _{i=1}^pM_i.\) Since \(\omega (G)=\omega (G'),\) by Theorem 4v), we get \(|\max ^h_r(M_n({\mathbb {F}}_q))|=|\max ^h_r(R)|.\) By Lemma 4, we have that \(|\max ^h_r(M_n({\mathbb {F}}_q))|=n.\) There exists a one-to-one correspondence between the set of all maximal homogeneous right ideals of R and the set of all maximal right ideals of \(R_e.\) So, \(|\max ^h_r(R)|=|\max _r(R_e)|.\) On the other hand, \(R_e\cong D_{n_1}(F_1)\times \dots \times D_{n_p}(F_p).\) Therefore, by Lemma 4, we obtain that \(|\max ^h_r(R)|=\sum _{i=1}^pn_i.\) Hence,

$$\begin{aligned} n=\sum _{i=1}^pn_i. \end{aligned}$$
(2)

Let u and \(u_i\) be the number of elements that can be generators in any maximal homogeneous right ideal of R and \(M_i,\) respectively. Then, by reasoning as in the proof of Theorem 4.5 in [43], we get from (2) that \(u=u_i.\) Namely, since

$$\begin{aligned}\langle \{a\in V(G)\ |\ \deg _G(a)=\Delta (G)\}\rangle \cong \langle \{a\in V(G')\ |\ \deg _{G'}(a)=\Delta (G')\}\rangle ,\end{aligned}$$

we have that \(\langle \{a\in V(G)\ |\ \deg _G(a)=\Delta (G)\}\rangle \) is the join of n copies of the complement graph of \(K_u,\) and \(\langle \{a\in V(G')\ |\ \deg _{G'}(a)=\Delta (G')\}\rangle \) is the join of \(\sum _{i=1}^pn_i\) copies of the complement graph of \(K_{u_i}.\) (Here, as usual, \(K_m\) denotes the complete graph with m vertices.) According to Lemma 4, note that for every i we have that

$$\begin{aligned}u={\left\{ \begin{array}{ll} 2(q-1) &{} \mathrm {if}\quad n=2;\\ (q-1)^{n-1} &{} \mathrm {if}\quad n>2, \end{array}\right. }\quad \mathrm {and}\quad u_i={\left\{ \begin{array}{ll} 2(q_i-1) &{} \mathrm {if}\quad n_i=2;\\ (q_i-1)^{n_i-1} &{} \mathrm {if}\quad n_i\ne 2. \end{array}\right. }\end{aligned}$$

So, if \(n=2,\) then \(u>1.\) Since \(u=u_i\) for every i,  it follows that \(n_i\ne 1\) for every i. Therefore, by (2), we get that \(p=1\) and \(n_1=2.\) Thus, \(2(q-1)=2(q_1-1),\) which implies that \(q=q_1.\) Hence, R and \(M_2({\mathbb {F}}_q)\) are graded isomorphic as S-graded rings. So, from now on, we assume that \(n>2.\) Then, since \(\mathrm {supp}(R)=S^*,\) we conclude from (2) that \(n_i>2\) for every i.

Case i \(q=2.\) Then \(u_i=(q-1)^{n-1}=1\) for every i. Since \(n_i>2,\) it follows that \((q_i-1)^{n_i-1}=1\) for every i. Hence, \(q_i=2\) for every i. By Theorem 4vi),  we have that \(n^2=\sum _{i=1}^pn_i^2.\) However, this, together with (2), implies that \(p=1\) and \(n_1=n.\) Therefore, R and \(M_n({\mathbb {F}}_2)\) are graded isomorphic as S-graded rings.

Case ii \(q>2.\) Then, \(u_i=u=(q-1)^{n-1}>1\) for every i. Now, let M be a maximal homogeneous right ideal of \(M_n({\mathbb {F}}_q),\) and a a generator of M. It follows that \(\deg _{G'}(\phi (a))=\Delta (G)=\Delta (G')\) and \(\phi (a)\) generates a maximal homogeneous right ideal \(M'\) of R. Analogously to the proof of Theorem 4.5 in [43], we conclude that \(\phi \) induces a one-to-one correspondence between the set of all maximal homogeneous right ideals of \(M_n({\mathbb {F}}_q)\) and those of R. Namely, M is a unique maximal independent set in G that contains a,  and therefore, \(M'\) is a unique maximal independent set in \(G'\) that contains \(\phi (a).\) Hence, \(\phi (M)\) is a maximal homogeneous right ideal of R. Let

$$\begin{aligned}B_i=0_{M_{n_1}(F_1)}\times \dots \times 0_{M_{n_{i-1}}(F_{i-1})} \times e_{(1,1)}\times 0_{M_{n_{i+1}}(F_{i+1})}\times \dots \times 0_{M_{n_p}(F_p)}.\end{aligned}$$

Then \(\deg _G(e_{(1,1)})=\delta (G)=\delta (G')=\deg _{G'}(B_i)\) for every i. Since \(n>2\) and \(n_i>2\) for every i,  we get that

$$\begin{aligned} \deg _G(e_{(1,1)})=(q-1)^{n-1}\quad \mathrm {and}\quad \deg _{G'}(B_i)=\frac{\prod _{j=1}^p(q_j-1)^{n_j}}{q_i-1}. \end{aligned}$$
(3)

Now, \(\deg _G(e_{(1,1)})=\deg _{G'}(B_i)\) for every i,  so (3) implies that \(q_1=\dots =q_p.\) Since \(u_i=(q_i-1)^{n_i-1}=(q-1)^{n-1}>1\) for every i,  and since \(q_1=\dots =q_p,\) we get that \(n_1=\dots =n_p.\) Therefore, from (2) we obtain that \(n=pn_1.\) This, together with \(\deg _G(e_{(1,1)})=\deg _{G'}(B_i)\) and (3), implies that

$$\begin{aligned}(q-1)^{n-1}=(q_1-1)^{pn_1-1}=(q_1-1)^{n-1}.\end{aligned}$$

Hence, \(q=q_1.\) By Theorem 4vi), we have that \(n^2(q-1)=pn_1^2(q_1-1).\) Since \(n=pn_1\) and \(q=q_1,\) it follows that \(p=1.\) Hence, \(n=n_1.\) Thus, R and \(M_n({\mathbb {F}}_q)\) are graded isomorphic as S-graded rings, which completes the proof. \(\square \)