# BERT-based Ensemble Approaches for Hate Speech Detection

Khouloud Mnassri, Praboda Rajapaksha, Reza Farahbakhsh, Noel Crespi  Telecom
SudParis, IMT, Institut Polytechnique de Paris, 91764 Palaiseau, France
{khouloud.mnassri, praboda.rajapaksha, reza.farahbakhsh, noel.crespi}@telecom-
sudparis.eu

###### Abstract

With the freedom of communication provided in online social media, hate speech
has increasingly generated. This leads to cyber conflicts affecting social
life at the individual and national levels. As a result, hateful content
classification is becoming increasingly demanded for filtering hate content
before being sent to the social networks. This paper focuses on classifying
hate speech in social media using multiple deep models that are implemented by
integrating recent transformer-based language models such as BERT, and neural
networks. To improve the classification performances, we evaluated with
several ensemble techniques, including soft voting, maximum value, hard voting
and stacking. We used three publicly available Twitter datasets (Davidson,
HatEval2019, OLID) that are generated to identify offensive languages. We
fused all these datasets to generate a single dataset (DHO dataset), which is
more balanced across different labels, to perform multi-label classification.
Our experiments have been held on Davidson dataset and the DHO corpora. The
later gave the best overall results, especially F1 macro score, even it
required more resources (time execution and memory). The experiments have
shown good results especially the ensemble models, where stacking gave F1
score of 97% on Davidson dataset and aggregating ensembles 77% on the DHO
dataset.

###### Index Terms:

hate speech detection, BERT, deep neural networks, Twitter, ensemble learning.

##  I introduction

Twitter is used to disseminate hate speech, especially with the anonymity
provided [1]. Thus, any strategy to identify such content is critical in
today’s world for keeping the internet a safe environment. Detecting online
hateful content is the first step in developing a system that flags such items
and take right actions. Human annotators are employed by social media
corporations to erase these samples and users can flag anything they find
harmful to the public. But these procedures are time consuming and depend on
human judgment. Thus, automated hate speech detection approaches have been a
major concern in this era. To this end, in early research, many attempts were
built upon machine learning algorithms and different features extraction
techniques, but in recent years, significant performances were obtained by
using Transformer-based Language Models [3]. Bidirectional Encoder
Representations from Transformers, BERT, has achieved state-of-the-art results
in many NLP tasks [7]. Moreover, Neural Network - NN approaches managed to
reduce feature engineering and are implemented and coupled with the
representation of texts as word vectors through word embedding models.
However, machine learning and NN models required to have a larger corpus of
datasets to train, but BERT-based models work with a small number of labeled
data and sometimes. Hence, to use the advantage of both approaches, we
integrate them together to build a deep architecture in order to achieve
considerable performances in hate speech classification. In addition, we use
Ensemble learning approaches to improve model performances further [10]. In
this context, we employed and fine tuned BERT, combined it with deep neural
networks and merged obtained models via ensemble learning, in order to detect
hate speech in Twitter base data.

The main contributions of this paper are: 1) Presenting transfer learning
approach by integrating BERT with Multi Layers Perceptron (MLP), Convolutional
Neural Networks (CNN) and Long short-term memory (LSTM) for hate speech
detection, in order to explore this mix of models performs better in text
classification tasks compared to neural networks or BERT alone. 2) Applying
several ensemble learning approaches to improve the performance of these
models. 3) Creating new corpora, by fusing multiple public and labeled
datasets to get large-size and more balanced corpora. 4) Comparing the
integrated models with baseline models and, 5) Comparing model performances
through their memory utilization and runtime parameters. We managed to get
benefit from the contribution of the combination of BERT and deep neural
networks in the text classification task, dealing with the scarcity and the
imbalanced data. In addition, we exploited that ensemble learning approaches
enhanced our deep models’ ability in the classification of hate speech
content.

##  II Literature Survey

Transfer learning: The deep learning models rely on the adoption of Neural
Networks - NN coupled with conventional word embedding techniques, which
achieved effective performance but often not as efficient as a transformer’s
[5]. Recent methodologies have gradually changed approaches from RNNs to self-
attention and transformers [6] in many NLP tasks. Google’s BERT [7] adapted
Transformers in 2018, that can condition both left and right context to
pretrain deep bidirectional representations from texts. Chiril et al [8] built
a BERT-based muti-task hate speech detection method that outperforms a system
trained on a single topic-generic dataset. Moreover, Kovács et ai [9]
suggested a model of a conjunction of RoBERTa and FastText incorporated with
CNNs and RNNs and achieved 63% F1 score. Malik et al. [15] conducted a review
of 14 shallow/deep classifiers, driven by a variety of word representation
approaches. They resulted that coupling BERT, ELECTRA, and Al-BERT with NNs
outperforms other approaches. Their best models were BERT+CNN and ELECTRA+MLP
giving F1 macro score of 76% on Davidson [2] dataset. Moreover, Mozafari et
al. [16] used BERT-based methods (BERT+Bi-LSTM, and BERT+CNN) to detect hate
speech and achieved significant performances.

Ensemble learning: This is a machine learning approach that involves training
several models together in a given task. An ensemble is made up of a group of
learners known as base/weak learners, trained for the same problem, then
integrated to improve results [10].

Badjatiya et al. [4] ensembled Embedding, LSTM and gradient boosted trees to
determine whether a tweet is racist, sexist, or neither in a 16k dataset and
achieved 93% F1 score. Plaza-del et al. [11] built a vote ensemble classifier
including SVM, LR and Decision Tree(DT) to classify hate tweets in English and
Spanish and achieved 44% F1 score. Agarwal et al. [12] proposed a Stacking
classifier to extract word embedding with RNNs, then, they used SVM, DT, MLP,
kNeighbors, ELM, with LR as the meta-classifier and F1 score of 73%. Aljero et
al. [17] got F1 score of 97% with their stacking ensemble that combines SVM,
LR, and XGBoost.

According to the recent researches that have been held using ensemble
learning, we find that the majority of them didn’t implement transformers in
their experiments (whether for word embedding or as classifiers). Moreover,
most of the recent studies were focused on assembling only machine learning
classifiers. The classification process was also binary detection of
hateful/abusive content.
Based on the state-of-the-art on hate speech detection using transformers-
based transfer learning and ensemble learning, in this work we propose several
strategies to the same task by integrating best of both approaches.

Figure 1: Datasets labels distribution.

##  III Methodology

We aim to build deep learning hate speech detectors by fine tuning and
integrating BERT with several NNs, and to enhance hate speech detection
performance via ensemble learning. We work on multi-label classification task
to distinguish between hateful, offensive and normal content from Twitter.

###  III-A Dataset

Our analyses are based on 3 publicly available datasets: Davidson [2], HatEval
[13], and OLID [14]. 1) Davidson: created by Davidson et al.[2] (2017). It
includes 24783 tweets and 3 labels (hateful, offensive, and neither), that
were generated using Figure Eight crowdsourcing111https://appen.com/figure-
eight-is-now-appen/. These tweets were selected from 85.4M archive tweets,
focusing on HateBase keywords (hatebase.org), and annotated by 3 people. For
the rest of the paper, we refer this dataset as Davidson dataset. 2) HatEval:
contains 13000 tweets about immigrants and women, and generated for the
SemEval2019 Task5[13]. The majority of the tweets came from the AMI
corpus222https://groups.inf.ed.ac.uk/ami/corpus/ and the dataset was labeled
via Figure Eight crowdsourcing1.

The annotators detect if a tweet is hateful, aggressive, and whom it is
directed (individual or group). In this paper, we refer this dataset as
HatEval2019. 3) OLID: Offensive Language Identification Dataset, created by
Zampieri et al. [14] and composed of 14100 tweets. A 3-level hierarchical
annotation was used, with the first one determines if a tweet is offensive. In
this paper, We refer this dataset as OLID dataset. 4) DHO: generated by
merging Davidson, HatEval2019 and OLID datasets to build a large data corpus
for our analysis. Data statistics of these corpora are illustrated in Figure
1. Compared to Davidsons, DHO is more balanced, it is used to demonstrate the
resilience and generalization of our models.

Figure 2: General Architecture: BERT+Deep Neural Networks.

a

b

c

d

Figure 3: The architectures of integrated deep models: (a.) BERT baseline,
(b.) BERT+MLP, (c.) BERT+LSTM, (d.) BERT+CNN

. . . .

###  III-B Deep models

Trained on large amounts of data [7], BERT will certainly lead to excellent
performances when using for downstream tasks. It also returns different
vectors and contextual embedding for the same word, which extract more
information from texts. In the other hand, deep learning networks provide many
advantages for NLP, where CNN and RNN are majorly used for text
classification. Therefore, we implemented 4 models integrating BERT with other
popular NN models such as MLP, CNN and LSTM. At first, we assess the
contextual information derived from BERT. We fine-tune them using our datasets
to get its contextual representations and then, ensemble models with several
ensemble learning techniques: aggregation and stacking, aiming to improve
performance and robustness, and to get better classification. The Figure 2
shows the general architecture of our models: Text data needs to be
transformed to numeric token ids then arranged in several Tensors before being
input to BERT-model, here, TensorFlow Hub provides a matching BERT-
preprocessor (tokenizer) for each of the BERT models, which implements this
transformation using TF.text
library333https://www.tensorflow.org/text/tutorials/classify_text_with_bert.
Our Bert-Model you will return 512 dimension embedding for each token:
’sequence output’ and ’Pooled output’, which, will be fed into the created NN
(Keras layer).

In this work, we used BERT Tensorflow
Hub444https://tfhub.dev/google/collections/bert/1 to compute vector-space
representations of datasets, to implement 4 different deep models.

1) BERT baseline: (Figure 3.a) We used BERT uncased L-4 H-512 A-8 model: 4
hidden layers (L), 512 hidden size (output size of 512 dimensions) (H). We
took the pooled output and integrated a dropout and a dense layer (Softmax
activation). 2) BERT+MLP: (Figure 3.b) MLP is a type of traditional neural
networks that are highly adaptable. They consist in 3+ layers of neurons. 2
dense and one dropout layers are added to BERT’s pooled output. 3) BERT+LSTM
(Figure 3.c): LSTM is a RNN that update hidden layers using memory cells, and
appear to be effective in sequential learning long-range text dependencies. We
integrated into BERT’s sequence output, 2 LSTM layers (512 units) followed by
a dropout and a dense layer. 4) BERT+CNN (Figure 3.d): CNNs are deeper and
sparsely connected, allowing to efficiently find patterns in noisy texts.
Here, 2 CNN (conv1D with ReLu activation), a Global Max Pooling and 2 dense
layers are integrated into BERT’s sequence output.

###  III-C Ensemble Learning

Since Neural networks are nonlinear, they have high variance and low bias,
being very sensitive to noisy data. Thus, there is no guarantee to exhibit low
generalization error when predicting. Hence, we implemented ensemble learning
to improve model performance by reducing these issues’ effects. We used 4
ensembling methods combining BERT+MLP, BERT+CNN and BERT+LSTM, with stacking
and aggregation: 1) Soft Voting Or averaging, merges several fine tuned models
trained on the same dataset. We took the average of predicted class
probabilities of each individual classifier $C_{j}$ and then, used argmax to
obtain the final class as shown in equation 1. The predicted probabilities
were treated equally ($\omega_{j}=1$ for each $\textit{j}th$ model).

$\displaystyle\hat{y}=argmax_{i\in\left\\{1,...c\right\\}j\in\left\\{1,...m\right\\}}\omega_{j}\hat{p}_{ij}$
(1)

$i$ is the class value in data and the class probability $\hat{p}$ is $\forall
i$,
$\hat{p}\left(y=i\right)=\sum_{j=1}^{m}\frac{\hat{p}\left(y=i|C_{j}\right)}{m}.$

Figure 4: Different Ensemble learning Models (EM):
EM1: BERT-MLP + BERT-CNN, EM2: BERT-MLP + BERT-LSTM EM3:, BERT-CNN + BERT+LSTM
EM4: and BERT-MLP + BERT-CNN + BERT-LSTM

2) Maximum voting  Consider the maximum prediction probability from the
models. We have $C(x)=\hat{p}$: the probability distribution over the c
classes $y$ where:
$\hat{p}=\left\\{\hat{p}(y=0|C),\hat{p}(y=1|C),...\hat{p}(y=m|C)\right\\}$.
Thus, the max value ensemble result is the class with the maximum probability
among the classifiers, as illustrated in the equation 2.

$\displaystyle\hat{y}=argmax_{i\in\left\\{1,...c\right\\}}\hat{p}\left(y=i|C\right)$
(2)

3) Hard voting  Employs the principle of majority voting (of an odd number of
classifiers), it takes the predictions of each model and output the most
frequent class. We predict the class $\hat{y}$ via majority vote of each of
the $m$ classifiers as shown in equation 3.

$\displaystyle\hat{y}=mode\left\\{C_{1},C_{2},...C_{m}\right\\}.$ (3)

4) Stacked Generalization ensemble Or stacking, is an integration strategy
[18]. It frequently combines heterogeneous trained base learners by training a
meta-model to output a prediction based on the predictions of the base models.
We have implemented the Stratified k-fold cross-validation technique to
partition the training set between the models, keeping the same ratio of 10%
for the validation set. Given the training set
$D=\left\\{D_{1},D_{2},D_{3}\right\\}$ where $D_{j}$ and
$\bar{D_{j}}=D\setminus D_{j}$ are respectively the training set and its
corresponding test set, each base $t^{th}$ learner $h_{t}^{(j)}$ is trained on
a $D_{j}$, then, their predictions z (equation 4) are fed as training set into
the meta learner (Linear Regression classifier in our case) which will predict
the final predictions.

$\displaystyle z=stack\left\\{h_{t}\left(D\right)\right\\}.\vspace{-10pt}$ (4)

All ensemble models are depicted in Figure 4 which presents the architecture
of the integration of multiple deep learning models to form 10 different
ensemble models. These ensembles have 2 prediction levels: Predictions1: the
predictions of each model and Predictions2: the output after ensembling them
using different scenarios. EM1 is the ensemble of BERT-MLP and BERT-CNN, based
on these 2 levels. As Figure 4 depicts, EM2, EM3 and EM4 are implemented by
the same technique.

##  IV Experiments and Results

|  | Davidson Dataset | Merged Dataset
---|---|---|---
| Model | Accuracy | F1 Score | Precision | Accuracy | F1 Score | Precision
| BERT (baseline) | 0.8498 | 0.7209 | 0.6894 | 0.79164 | 0.7571 | 0.7466
| BERT-MLP | 0.876 | 0.7401 | 0.7209 | 0.8087 | 0.7704 | 0.764
| BERT-CNN | 0.8943 | 0.7355 | 0.7379 | 0.7853 | 0.74902 | 0.7391
| BERT-LSTM | 0.8968 | 0.7548 | 0.7397 | 0.8013 | 0.762 | 0.7559
|  |  |  |  |  |  |  |
|  | EM1 | 0.9005 | 0.7558 | 0.7468 | 0.8045 | 0.7672 | 0.7586
|  | EM2 | 0.8943 | 0.7554 | 0.7354 | 0.8158 | 0.7783 | 0.7724
|  | EM3 |  0.9047 | 0.7596 | 0.7519 | 0.8091 | 0.7734 | 0.7641
| Soft voting | EM4 | 0.9018 | 0.7589 | 0.7469 | 0.812 | 0.7746 | 0.7669
|  | EM1 | 0.9009 | 0.7564 | 0.747 | 0.8077 | 0.7715 | 0.7622
|  | EM2 | 0.8939 | 0.7549 | 0.7348 | 0.8162 | 0.7786 | 0.7726
|  | EM3 | 0.9034 | 0.7566 | 0.7494 | 0.8077 | 0.7715 | 0.7622
| Max value | EM4 | 0.9026 | 0.7588 | 0.748 | 0.814 | 0.7773 | 0.769
| Hard voting | EM4 | 0.9001 | 0.7595 | 0.7457 | 0.8085 | 0.771 | 0.7628
Ensembler Method | Stacking | EM4 | 0.776 | 0.9706 | 0.9430 | 0.463 | 0.9278 | 0.8654
Table I: Experimental Results for the Davidson dataset and DHO dataset.

###  IV-A Data Pre-processing

We started pre-processing our raw data: 1) Switch tweets to lower case, 2)
Delete URLs, 3) Remove users names, 4) Shorten prolonged words (”yeeessss” to
”yes”…), 5) Keep stop words, 6) Remove punctuation marks, unknown uni-codes,
and additional delimiting characters, 7) Remove hashtags (#) and correct their
texts (e.g, ”#notracism” to ”not racism”), 8) Eliminate tweets of length less
than 2, and 9) Remove emoticons.

###  IV-B Data analysis platform and evaluation metrics

The implemented models are trained with various fine-tuning strategies (batch
size of 32 for 50 epochs) on Colab. We created our custom optimizer with a
learning rate of 2e-5, and experimented with AdamW optimizer and Sparse
Categorical Cross-entropy loss functions. In order to utilize features from
each label, we introduced weights in the training phase. Thus, classifiers
performances are measured via macro averaged F1 score, accuracy, precision and
recall scores.

###  IV-C Results and Interpretations

The results are shown in Table 1 and the best results of each group of the
same ensemble and are highlighted in blue and the best overall ones are in
red. We set up early stopping with Validation Accuracy as a monitor parameter
to prevent overfitting. Following experiments are mainly based on Davidson
dataset and DHO dataset. Davidson dataset: As illustrated in Table 1,
BERT+LSTM has shown the best results on the test set. Moreover, all the models
outperform BERT baseline, which prove the importance of adding NN classifiers
for such a task. As for the aggregation ensembles, all the approaches
outperformed single models, it shows obviously better results, especially the
Soft Voting of BERT+LSTM with BERT+CNN, as well as Hard Voting ensembling (in
bold) that outperformed both of the other aggregation ensembles. DHO dataset:
Models trained and tested on this dataset gave better performance than on
Davidson’s. Getting the most performed model BERT+MLP. Moreover, aggregation
ensembles outperformed each of these single models, getting the best result
when ensembling the 2 most performed models: BERT+MLP and BERT+LSTM. All of
the 3 ensemble approaches have given almost similar results, but we can
observe that Maximum value and Hard Voting are the best ones. Unlike BERT-CNN,
BERT-MLP and BERT-LSTM gave the best performance on DHO and Davidson datasets
respectively, this is related to the type of corpora and the subject we are
dealing with: NLP Twitter text classification with small imbalanced dataset.
As for the stacking approach, it outperformed all the other ensembles in both
datasets, giving highest F1 and precision, even with the lower accuracy, which
is not always guaranteed in this ensemble and unexpectedly, Davidson accuracy
results were better then DHO’s. We refer these results to the meta classifier
used (Linear Regression), which is not a complex multi layered model that can
correctly deal with the used datasets. And, as David H. et al. stated [18],
for almost any real-world generalization problem one should use some version
of stacked generalization to minimize the generalization error rate. Moreover,
the main reason for getting lower accuracy is not easy to be interpretable
since BERT (as any other transformer) is a black box, so it is not easy to
understand its functioning. Meanwhile, we refer also these results to the
imbalanced corpora used in our experiments. Figure 5 shows the confusion
matrix to present clearly the ensembles’ classification performance of the
best performed models: soft voting EM3 for Davidson, and Max value EM2 for
DHO. The classification performance of both models is very good for each
class, especially for ’Offensive’ and ’Neither’ (Highest True Positives) since
they represent the biggest percentages of each dataset. Moreover, ’Hateful’
class classification error rate is decreased in DHO because this corpora is
more balanced.

a

b

Figure 5: Confusion matrix of ensembles: (a.) Soft voting EM3 - Davidson, (b.)
Max value EM2 - DHO

. .

##  V Discussions and future work

###  V-A Discussions and Challenges

Data: As shown in the section above, we worked on a small-size imbalanced
datasets, where there is a huge gap between class distribution (in Davidson
dataset ‘Hateful’ label takes 5.77% while ‘Offensive’ takes 77.34% of all
data) Figure 1. This led to many issues we faced during training such as the
overfitting problems. Computational power: Our proposed approaches require a
strong GPU, and even with the use of Google Colab Pro for training, we were
restricted to some limitations (Number of BERT and deep learning layers). We
ended up getting a 28,765,188-parameter BERT baseline, 29,027,844-parameter
BERT-MLP, 28,835,428-parameter BERT-CNN and 32,963,588-parameter BERT-LSTM,
which, increases the models’ complexity, thus, required more computational
resources as displayed in Figure 6.

Obviously, DHO require more resources than Davidson. And even getting less
number of parameters, training BERT-CNN took more memory size than BERT-MLP.
Although requiring more memory, the ensembles were very faster than baselines’
training, which explains their efficiency. The best least resouces consuming
models are EM1 and EM3 for both datasets. Multi-label classification: We
worked on multi-label datasets, which add more complexity to the
classifications. When compared with the previous works, our results didn’t
often overcome the binary classifications on the same datasets. Stacking
ensemble: Dealing with BERT+NN, we couldn’t implement directly the pre-defined
stacking ensemble functions of Sklearn library. Thus, we manually elaborated
the required functions (Defining: stacked dataset got from the predictions of
base learners, the meta learner and, its stacked final predictions).

Figure 6: Runtime and memory models.

###  V-B Future work

Various improvements can be added to our study in the future to enhance hate
speech detection approach with ensemble transfer learning. It starts with the
data where we can work more on the labels’ distribution. Taking into
consideration balance status, we can use several techniques like data
augmentation. Dealing with the dataset bias issue and the granularity of hate
speech content, we can get benefit further from K-BERT (using Knowledge Graph)
[19], it helps also to handle the issue of the data scarcity, especially in
other languages, thus, detecting hateful and offensive content from unlabeled
corpora. Adding to that, we can check our models’ generalization by testing
them on other datasets, from different social media resources like Facebook
etc. As for the models’ implementation, we can use TensorFlow Hub BERT
architecture similar to BERT base Hugging Face model’s (L=12, H=768 and A=12),
or at least, increase the number of parameters and test their impact on
models’ performances. Moreover, we can employ other ensemble learning
techniques and enhance the stacking ensemble we built, we can also improve the
baseline models and build new and more complex deep learning classifiers and
combine them with other transformers than BERT and compare their effects.

##  VI Conclusion

For the purpose of hate speech detection on social media, this paper worked on
several public datasets to build large more balanced corpora used to train and
test transfer learning classifiers. Combining BERT transformer with several
deep neural networks, we managed to get heterogeneous multi-label classifiers
that successfully detect hateful and offensive content from Twitter. We, then
, improved their performance using different aggregating and stacking ensemble
techniques, the latter significantly outperformed the baselines and the other
ensembles’ predictions even with giving low accuracy, which is a future
subject to work on, where we aim to develop more powerful and resilient
stacking meta-classifiers.

## References

  * [1] Ascher, Diana L, ”Unmasking hate on Twitter: Disrupting anonymity by tracking trolls”, 2019.
  * [2] Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar, ”Automated hate speech detection and the problem of offensive language”, Proceedings of the international AAAI conference on web and social media, vol. 11, pp. 512–515, 2017.
  * [3] , Wolf, Thomas and Debut, Lysandre and Sanh, Victor and Chaumond, Julien and Delangue, Clement and Moi, Anthony and Cistac, Pierric and Rault, Tim and Louf, Rémi and Funtowicz, Morgan and others, ”Transformers: State-of-the-art natural language processing”, Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pp. 38–45, 2020.
  * [4] Badjatiya, Pinkesh and Gupta, Shashank and Gupta, Manish and Varma, Vasudeva, ”Deep learning for hate speech detection in tweets”, pp. 759–760, 2017
  * [5] Tay, Yi and Dehghani, Mostafa and Bahri, Dara and Metzler, Donald, ”Efficient transformers: A survey”, ACM Computing Surveys (CSUR), 2020, ACM New York, NY.
  * [6] Yang, Baosong and Wang, Longyue and Wong, Derek and Chao, Lidia S and Tu, Zhaopeng, ”Convolutional self-attention networks”, arXiv preprint arXiv:1904.03107, 2019.
  * [7] Devlin, Jacob and Chang, Ming-Wei and Lee, Kenton and Toutanova, Kristina, ”Bert: Pre-training of deep bidirectional transformers for language understanding”, arXiv preprint arXiv:1810.04805, 2018.
  * [8] Chiril, Patricia and Pamungkas, Endang Wahyu and Benamara, Farah and Moriceau, Véronique and Patti, Viviana, ”Emotionally informed hate speech detection: a multi-target perspective”, Cognitive Computation, vol. 14, no. 1, pp. 322–352, 2022, Springer.
  * [9] Kovács, György and Alonso, Pedro and Saini, Rajkumar, ”Challenges of hate speech detection in social media”, SN Computer Science, vol. 2, no. 2, pp. 1–15, 2021, Springer.
  * [10] Zhou, Zhi-Hua, ”Ensemble learning”, Machine learning, pp. 181–210, 2021, Springer.
  * [11] Plaza-del-Arco, Flor Miriam and Molina-González, M Dolores and Martín-Valdivia, M Teresa and Lopez, L Alfonso Urena, ”SINAI at SemEval-2019 Task 5: Ensemble learning to detect hate speech against inmigrants and women in English and Spanish tweets”, Proceedings of the 13th International Workshop on Semantic Evaluation, pp. 476–479, 2019
  * [12] Agarwal, Shivang and Chowdary, C Ravindranath, ”Combating hate speech using an adaptive ensemble learning model with a case study on COVID-19”, Expert Systems with Applications, vol. 185, pp. 115632, 2021, Elsevier.
  * [13] Basile, Valerio and Bosco, Cristina and Fersini, Elisabetta and Nozza, Debora and Patti, Viviana and Pardo, Francisco Manuel Rangel and Rosso, Paolo and Sanguinetti, Manuela, ”Semeval-2019 task 5: Multilingual detection of hate speech against immigrants and women in twitter”, pp. 54–63, 2019.
  * [14] Zampieri, Marcos and Malmasi, Shervin and Nakov, Preslav and Rosenthal, Sara and Farra, Noura and Kumar, Ritesh, ”Predicting the type and target of offensive posts in social media”, arXiv preprint arXiv:1902.09666, 2019.
  * [15] Malik, Jitendra Singh and Pang, Guansong and Hengel, Anton van den, ”Deep Learning for Hate Speech Detection: A Comparative Study”, arXiv preprint arXiv:2202.09517, 2022.
  * [16] Mozafari, Marzieh and Farahbakhsh, Reza and Crespi, Noël, ”Hate speech detection and racial bias mitigation in social media based on BERT model”, PloS one, vol. 15, no. 8, pp. e0237861, 2020, Public Library of Science San Francisco, CA USA.
  * [17] Aljero, Mona Khalifa A and Dimililer, Nazife, ”A Novel Stacked Ensemble for Hate Speech Recognition”, Applied Sciences, vol. 11, no. 24, pp. 11684, 2021, MDPI.
  * [18] Wolpert, David H, ”Stacked generalization”, Neural networks, vol. 5, no. 2, pp. 241–259, 1992, Elsevier.
  * [19] Liu, Weijie and Zhou, Peng and Zhao, Zhe and Wang, Zhiruo and Ju, Qi and Deng, Haotang and Wang, Ping, ”K-bert: Enabling language representation with knowledge graph”, Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 3, pp. 2901–2908, 2020.


# More on the Annihilator-Ideal Graph of
a Commutative Ring ††thanks: Key Words: Annihilator-Ideal Graph; Annihilating-
Ideal Graph; Minimal prime ideal; Girth; Star graph. ††thanks: 2010
Mathematics Subject Classification: 13A15; 13B99; 05C99.

M.J. Nikmehr  and S.M. Hosseini
Faculty of Mathematics, K.N. Toosi University of Technology,
P.O. Box 16315-1618, Tehran, Iran

<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

Let $R$ be a commutative ring with identity and $\mathbb{A}(R)$ be the set of
ideals of $R$ with non-zero annihilator. The annihilator-ideal graph of $R$,
denoted by $A_{I}(R)$, is a simple graph with the vertex set
$\mathbb{A}(R)^{\ast}:=\mathbb{A}(R)\setminus\\{(0)\\}$, and two distinct
vertices $I$ and $J$ are adjacent if and only if
$\mathrm{Ann}_{R}(IJ)\neq\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$. In this
paper, we study the affinity between the annihilator-ideal graph and the
annihilating-ideal graph $\mathbb{A}\mathbb{G}(R)$ (a well-known graph with
the same vertices and two distinct vertices $I,J$ are adjacent if and only if
$IJ=0$) associated with $R$. All rings whose
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and $\mathrm{gr}(A_{I}(R))=4$ are
characterized. Among other results, we obtain necessary and sufficient
conditions under which $A_{I}(R)$ is a star graph.

1\. Introduction

Many interesting algebraic and combinatorics problems arise when we associate
a combinatorics object with an algebraic structure. Therefore, one of the most
popular and active area in algebraic combinatorics is study of graphs
associated with rings. Papers in this field apply combinatorial methods to
obtain algebraic results in ring theory (see for instance [1], [7], [13] and
[15]). Moreover, for the most recent study in this direction see [6], [11] and
[15].

Throughout this paper, $R$ denotes a unitary commutative ring which is not an
integral domain. The sets of all zero-divisors, nilpotent elements and minimal
prime ideals of $R$ are denoted by $Z(R)$, $\mathrm{Nil}(R)$ and
$\mathrm{Min}(R)$, respectively. For a subset $T$ of a ring $R$ we let
$T^{*}=T\setminus\\{0\\}$. An ideal with non-zero annihilator is called an
annihilating ideal. The set of annihilating ideals of $R$ is denoted by
$\mathbb{A}(R)$. The ring $R$ is said to be reduced if it has no non-zero
nilpotent element. For any undefined notation or terminology in ring theory,
we refer the reader to [5, 10].

Let $G=(V,E)$ be a graph, where $V=V(G)$ is the set of vertices and $E=E(G)$
is the set of edges. If $x,y$ are adjacent vertices, then we write $x--y$. By
$\mathrm{diam}(G)$ and $\mathrm{gr}(G)$, we mean the diameter and the girth of
$G$, respectively. A cycle (path) graph of order $n$ is denoted by $C_{n}$
($P_{n}$). A complete bipartite graph with part sizes $m$ and $n$ is denoted
by $K_{m,n}$. If the size of one of the parts is $1$, then the graph is said
to be a star graph. Also, a complete graph of order $n$ is denoted by $K_{n}$.
The distance between two vertices $x,y$ in $G$ is denoted by
$\mathrm{d}_{G}(x,y)$. For any $x\in V(G)$, $N_{G}(x)$ represents the set of
all adjacent vertices to $x$. For any undefined notation or terminology in
graph theory, we refer the reader to [14].

The annihilator graph of a ring $R$ is defined as the graph $AG(R)$ with the
vertex set $Z(R)^{*}=Z(R)\setminus\\{0\\}$, and two distinct vertices $x$ and
$y$ are adjacent if and only if $ann_{R}(xy)\neq ann_{R}(x)\cup ann_{R}(y)$.
This graph was first introduced and investigated in [7] and many of
interesting properties of annihilator graph were studied. The  annihilator-
ideal graph of $R$, denoted by $A_{I}(R)$, is an undirected (simple) graph
with the vertex set $\mathbb{A}(R)^{\ast}=\mathbb{A}(R)\setminus\\{0\\}$, and
two distinct vertices $I$ and $J$ are adjacent if and only if
$\mathrm{Ann}_{R}(IJ)\neq\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$. This
graph was first introduced and investigated in [12] and many of interesting
properties of annihilator-ideal graph were studied. The annihilating-ideal
graph of a ring $R$, denoted by $\mathbb{A}\mathbb{G}(R)$, is a graph with the
vertex set $\mathbb{A}(R)^{\ast}$ and two distinct vertices $I$ and $J$ are
adjacent if and only if $IJ=(0)$ (see [1, 2, 8] for more details). It is not
hard to see that the annihilating-ideal graph is a subgraph of the
annihilator-ideal graph and so it is interesting to explore some further
relations between two graphs $\mathbb{A}\mathbb{G}(R)$ and $A_{I}(R)$. For
instance, it is proved that if $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and
$\mathbb{A}\mathbb{G}(R)$ is a star graph, then $A_{I}(R)$ is a complete
graph. Among other results, we obtain necessary and sufficient condition in
which $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ and $A_{I}(R)$ is a star graph.

2\. Preliminars

First we recall the fundamental properties of $A_{I}(R)$ that are necessary in
this paper.

The first result of this section has an essential role through the paper.

###### Lemma 1

.[12, Lemma $2.1$] Let $R$ be a ring and $I$ and $J$ be distinct elements of
$\mathbb{A}(R)^{\ast}$. Then the following statements hold.

(1) $I--J$ is not an edge of $A_{I}(R)$ if and only if
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)$ or
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(J)$.

(2) If $I--J$ is an edge of $\mathbb{A}\mathbb{G}(R)$, then $I--J$ is an edge
of $A_{I}(R)$. In particular, if $P$ is a path in $\mathbb{A}\mathbb{G}(R)$,
then $P$ is a path in $A_{I}(R)$.

(3) If $I--J$ is not an edge of $A_{I}(R)$, then
$\mathrm{Ann}_{R}(I)\subseteq\mathrm{Ann}_{R}(J)$ or
$\mathrm{Ann}_{R}(J)\subseteq\mathrm{Ann}_{R}(I)$.

(4) If $\mathrm{Ann}_{R}(I)\nsubseteq\mathrm{Ann}_{R}(J)$ and
$\mathrm{Ann}_{R}(J)\nsubseteq\mathrm{Ann}_{R}(I)$, then $I--J$ is an edge of
$A_{I}(R)$.

(5) If $\mathrm{d}_{\mathbb{A}\mathbb{G}(R)}(I,J)=3$, then $I--J$ is an edge
of $A_{I}(R)$.

(6) If $I--J$ is not an edge of $A_{I}(R)$, then there is a
$K\in\mathbb{A}(R)^{\ast}\setminus\\{I,J\\}$ such that $I--K--J$ is a path in
$\mathbb{A}\mathbb{G}(R)$, and hence $I--K--J$ is also a path in $A_{I}(R)$.

By [8, Theorem 2.1], for every ring $R$, the annihilating-ideal graph
$\mathbb{A}\mathbb{G}(R)$ is a connected graph and
$\mathrm{diam}(\mathbb{A}\mathbb{G}(R))\leq 3$. Moreover, if
$\mathbb{A}\mathbb{G}(R)$ contains a cycle, then
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))\leq 4$. By using these facts and part
(6) of Lemma 1, we have the following result.

###### Theorem 2

. [12, Corollary $2.2$] Let $R$ be a ring with $|\mathbb{A}(R)^{\ast}|\geq 2$.
Then $A_{I}(R)$ is a connected graph and $\mathrm{diam}(A_{I}(R))\leq 2$.
Moreover, if $A_{I}(R)$ contains a cycle, then $\mathrm{gr}(A_{I}(R))\leq 4$.

###### Theorem 3

. [12, Corollary $2.8$] Let $R$ be a reduced ring and
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$. Then $\mathrm{gr}(A_{I}(R))=3$.
Furthermore, there is a cycle $C$ of length three in $A_{I}(R)$ such that each
edge of $C$ is not an edge of $\mathbb{A}\mathbb{G}(R)$.

Next, we provide an example of a non-reduced ring $R$ where $I--J$ is an edge
of $A_{I}(R)$ that is not an edge of $\mathbb{A}\mathbb{G}(R)$ for some
distinct $I,J\in\mathbb{A}(R)^{\ast}$, but every path in $A_{I}(R)$ of length
two from $I$ to $J$ is also a path in $\mathbb{A}\mathbb{G}(R)$.

###### Example 4

. Let $R\cong\mathbb{Z}_{16}$. Clearly,
$\mathfrak{m}=Z(R),\mathfrak{m}^{2},\mathfrak{m}^{3}$ are non-zero proper
ideals of $R$ and $\mathfrak{m}^{4}=(0)$. It is easily seen that
$\mathfrak{m}--\mathfrak{m}^{2}$ is an edge of $A_{I}(R)$ that is not an edge
of $\mathbb{A}\mathbb{G}(R)$. Moreover,
$\mathfrak{m}--\mathfrak{m}^{3}--\mathfrak{m}^{2}$ is the only path in
$\mathbb{A}\mathbb{G}(R)$ of length two from $\mathfrak{m}$ to
$\mathfrak{m}^{2}$. Indeed, $A_{I}(R)=K_{3}$ and
$\mathbb{A}\mathbb{G}(R)=K_{1,2}$.

The following is an example of a non-reduced ring $R$ such that
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and if $I--J$ is an edge of $A_{I}(R)$
that is not an edge of $\mathbb{A}\mathbb{G}(R)$ for some distinct
$I,J\in\mathbb{A}(R)^{\ast}$, then there is no path in $A_{I}(R)$ of length
two from $I$ to $J$.

###### Example 5

. Let $R\cong F\times S$, where $F$ is a field and $S$ is a ring with a unique
non-trivial ideal, say $I$. Clearly, $I_{1}=F\times(0)$, $I_{2}=F\times I$,
$I_{3}=(0)\times I$ and $I_{4}=(0)\times S$ are non-zero proper ideals of $R$.
Then $I_{2}--I_{4}$ is an edge of $A_{I}(R)$ that is not an edge of
$\mathbb{A}\mathbb{G}(R)$, but there is no path in $A_{I}(R)$ of length two
from $I_{2}$ to $I_{4}$. Indeed, $\mathbb{A}\mathbb{G}(R)\cong P_{4}$ and
$A_{I}(R)\cong C_{4}$,

The next theorem characterizes all rings $R$ with
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and $\mathrm{gr}(A_{I}(R))=4$.

To prove Theorem 7, the following lemma is needed.

###### Lemma 6

. [12, Lemma $2.5$] Let $R$ be a ring and $I,J\in\mathbb{A}(R)^{\ast}$.
Suppose that $I--J$ is an edge of $A_{I}(R)$ that is not an edge of
$\mathbb{A}\mathbb{G}(R)$. If there is a
$K\subseteq\mathrm{Ann}_{R}(IJ)\setminus\\{I,J\\}$ such that $KI\neq(0)$ and
$KJ\neq(0)$, then $C:I--K--J$ is a path in $A_{I}(R)$ that is not a path in
$\mathbb{A}\mathbb{G}(R)$, and hence $C:I--K--J--I$ is a cycle in $A_{I}(R)$
of length three and each edge of $C$ is not an edge of
$\mathbb{A}\mathbb{G}(R)$.

###### Theorem 7

. Let $R$ be a ring and $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$. Then the
following statements are equivalent:

(1) $\mathrm{gr}(A_{I}(R))=4$;

(2) If $I--J$ is an edge of $A_{I}(R)$ that is not an edge of
$\mathbb{A}\mathbb{G}(R)$ for some distinct $I,J\in\mathbb{A}(R)^{\ast}$, then
there is no path in $A_{I}(R)$ of length two from $I$ to $J$;

(3) There are some distinct $I,J\in\mathbb{A}(R)^{\ast}$ such that $I--J$ is
an edge of $A_{I}(R)$ that is not an edge of $\mathbb{A}\mathbb{G}(R)$ and
there is no path in $A_{I}(R)$ of length two from $I$ to $J$;

(4) $R\cong F\times S$, where $F$ is a field and $S$ is a ring with a unique
non-trivial ideal.

###### Proof.

$(1)\Rightarrow(2)$ Suppose that $I--J$ is an edge of $A_{I}(R)$ that is not
an edge of $\mathbb{A}\mathbb{G}(R)$ for some distinct
$I,J\in\mathbb{A}(R)^{\ast}$. Since $\mathrm{gr}(A_{I}(R))\neq 3$, there is no
path in $A_{I}(R)$ of length two from $I$ to $J$.

$(2)\Rightarrow(3)$ Since $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$, there are
distinct vertices $I,J\in\mathbb{A}(R)^{\ast}$ such that $I--J$ is an edge of
$A_{I}(R)$ that is not an edge of $\mathbb{A}\mathbb{G}(R)$, and hence there
is no path in $A_{I}(R)$ of length two from $I$ to $J$ by part (2).

$(3)\Rightarrow(4)$ Suppose (3) is hold. Then
$\mathrm{Ann}_{R}(I)\cap\mathrm{Ann}_{R}(J)=\\{0\\}$. Since $IJ\neq(0)$ and
$\mathrm{Ann}_{R}(I)\cap\mathrm{Ann}_{R}(J)=\\{0\\}$, it follows from Lemma 6
that
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)\cup\\{I\\}$
such that $I^{2}\neq(0)$ or
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)\cup\\{J\\}$
with $J^{2}\neq(0)$ (We note that if $\\{I,J\\}\subseteq\mathrm{Ann}_{R}(IJ)$,
then $A_{I}(R)$ find the path $I--IJ--J$, a contradiction). Without loss of
generality, we may assume that
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)\cup\\{J\\}$
and $J^{2}\neq(0)$. Let $0\neq a\in\mathrm{Ann}_{R}(I)$ and $0\neq
b\in\mathrm{Ann}_{R}(J)$. Since
$\mathrm{Ann}_{R}(I)\cap\mathrm{Ann}_{R}(J)=\\{0\\}$, we deduce that
$a+b\in\mathrm{Ann}_{R}(IJ)$ but $a+b\not\in\mathrm{Ann}_{R}(I)$ and
$a+b\not\in\mathrm{Ann}_{R}(J)$, and hence $R(a+b)=J$. If $K$ is a non-zero
ideal properly contained in $\mathrm{Ann}(I)$, then
$K\subseteq\mathrm{Ann}_{R}(IJ)$, a contradiction. Thus $\mathrm{Ann}_{R}(I)$
is a minimal ideal of $R$. Similarly, $\mathrm{Ann}_{R}(J)$ is a minimal ideal
of $R$. Since
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)\cup\\{J\\}$,
where $J^{2}\neq(0)$ and $R(a+b)=J$, we conclude that
$|\mathrm{Ann}_{R}(IJ)|=3$. The inclusion relation
$J\subseteq\mathrm{Ann}_{R}(IJ)$ implies that $IJ^{2}=(0)$ and so
$J^{2}\subseteq\mathrm{Ann}_{R}(I)$. Thus $J^{2}=\mathrm{Ann}_{R}(I)$ (As
$\mathrm{Ann}_{R}(I)$ is a minimal ideal of $R$). By a similar argument and
because of the minimality of $\mathrm{Ann}_{R}(J)$, $IJ=\mathrm{Ann}_{R}(J)$.
Since $\mathrm{Ann}(I)$ and $\mathrm{Ann}(J)$ are two minimal ideals of $R$
and $R(a+b)=J$, $J=\mathrm{Ann}(I)+\mathrm{Ann}(J)$. Hence $J=J^{2}+IJ$ and so
$J^{2}=(J^{2})^{2}+(IJ)^{2}$. Since
$IJ=\mathrm{Ann}(J)\subseteq\mathrm{Ann}(IJ)$, $(IJ)^{2}=0$. Therefore,
$J^{2}=(J^{2})^{2}$ and so by Brauer’s Lemma (see [10, 10.22]), $R\cong
R_{1}\times R_{2}$, where $R_{1}$ and $R_{2}$ are two rings. To complete the
proof we show that one of $R_{i}$s is a filed and the other one contains
exactly one non-trivial ideal. Suppose that $I=(I_{1},I_{2})$ and
$J=(J_{1},J_{2})$, where $I_{1},J_{1}$ and $I_{2},J_{2}$ are ideals of $R_{1}$
and $R_{2}$, respectively. With no loss of generality, assume that
$I_{1}J_{1}=(0)$ and $I_{2}J_{2}$ is a (non-zero) minimal ideal of $R_{2}$,
i.e., $IJ=(0,I_{2}J_{2})$. As $\mathrm{Ann}_{R}(J)=IJ$,
$\mathrm{Ann}_{R}(J)=(\mathrm{Ann}_{R_{1}}(J_{1}),\mathrm{Ann}_{R_{2}}(J_{2}))=(0,I_{2}J_{2})$.
Consequently, $\mathrm{Ann}_{R_{1}}(J_{1})=(0)$ and since $I_{1}J_{1}=(0)$, we
conclude that $I_{1}=(0)$. Thus $J_{1}\neq(0)$, for if not
$I=(0,I_{2})--(R_{1},0)--J=(0,J_{2})$ is a path in
$\Gamma^{\prime}_{\mathrm{Ann}}(R)$ of length two from $I$ to $J$, a
contradiction. Since $I_{2}J_{2}\neq(0)$, $J_{2}\neq(0)$, i.e.,
$J=(J_{1},J_{2})\neq(0,0)$ and $J\in\mathbb{A}(R)^{\ast}$. Hence
$\mathrm{Ann}_{R_{2}}(J_{2})\neq(0)$ and so
$J_{2}\in\mathbb{A}(R_{2})^{\ast}$. By the minimality of
$\mathrm{Ann}_{R}(I)=(R_{1},\mathrm{Ann}_{R_{2}}(I_{2}))$,
$\mathrm{Ann}_{R_{2}}(I_{2})=(0)$. Also, the equality
$\mathrm{Ann}_{R_{2}}(J_{2})=I_{2}J_{2}$ shows that $I_{2}J_{2}^{2}=(0)$ and
hence $J_{2}^{2}=(0)$ (As $\mathrm{Ann}_{R_{2}}(I_{2})=(0)$). Since
$IJ\neq(0)$, $I_{2}\neq J_{2}$. Clearly, $J_{2}\subseteq I_{2}J_{2}$ and
(again) by the minimality of $I_{2}J_{2}$, we infer $J_{2}=I_{2}J_{2}$ is a
minimal ideal of $R_{2}$ and thus $IJ=(0,J_{2})$. Suppose that $K$ is a non-
trivial ideal of $R_{2}$ such that $K\neq J_{2}$ and $KJ_{2}=(0)$. Now,
$(R_{1},K)\subseteq\mathrm{Ann}_{R}(IJ)\setminus\\{I,J\\}$ and
$(R_{1},K)I=(0,KI_{2})\neq(0,0)$, $(R_{1},K)J=(J_{1},0)\neq(0,0)$ imply that
$I--(R_{1},K)--J$ is a path in $A_{I}(R)$ of length two from $I$ to $J$ by
Lemma 6, a contradiction. Thus $K=J_{2}$, i.e.,
$|\mathbb{A}(R_{2})^{\ast}|=1$, and so by [8, Theorem 1.4], $R_{2}$ has
exactly one non-trivial ideal. Since $R_{2}$ is a ring with a unique non-
trivial ideal and $IJ\neq(0)$, we deduce that $I_{2}=R_{2}$. Next, we claim
that $Z(R_{1})=\\{0\\}$. Assume to the contrary, $R_{1}$ contains a non-
trivial annihilating-ideal, say $L$. It is obvious that $LJ_{1}\neq(0)$. Since
$(L,J_{2})\subseteq\mathrm{Ann}_{R}(IJ)\setminus\\{I,J\\}$ and
$(L,J_{2})I\neq(0,0)$, $(L,J_{2})J\neq(0,0)$, $I--(L,J_{2})--J$ is a path in
$A_{I}(R)$ of length two from $I$ to $J$ by Lemma 6, which is impossible and
so the claim is proved. Finally, it is enough to show that $R_{1}$ has no non-
trivial ideal. Assume that $R_{1}$ has a non-trivial ideal $M\neq J_{1}$.
Since $(M,J_{2})\subseteq\mathrm{Ann}(IJ)\setminus\\{I,J\\}$ and
$(M,J_{2})I\neq(0)$, $(M,J_{2})J\neq(0)$, one may find the path
$I--(M,J_{2})--J$, a contradiction. Since $J_{1}\neq(0)$, we conclude that
$J_{1}=R_{1}$ and so $R_{1}$ is a field, as desired (We note that
$I=(0,R_{2})$ and $J=(R_{1},J_{2})$, where $J_{2}$ is the unique non-trivial
ideal of $R_{2}$).

$(4)\Rightarrow(1)$ It is clear.  $\Box$

###### Corollary 8

. Let $R$ be a ring such that $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$, and
assume that $R$ is not ring-isomorphic to $F\times S$, where $F$ is field and
$S$ is a ring with a unique non-trivial ideal. If $E$ is an edge of $A_{I}(R)$
that is not an edge of $\mathbb{A}\mathbb{G}(R)$, then $E$ is an edge of a
cycle of length three in $A_{I}(R)$.

In view of Theorems 3 and 7, we have the following corollary.

###### Corollary 9

. Let $R$ be a ring such that $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$. Then
$\mathrm{gr}(A_{I}(R))\in\\{3,4\\}$.

3\. When $A_{I}(R)$ and $\mathbb{A}\mathbb{G}(R)$ are Identical?

We observed that the annihilating-ideal graph $\mathbb{A}\mathbb{G}(R)$ is a
subgraph of the annihilatior-ideal graph $A_{I}(R)$. This section is devoted
to characterize all rings whose annihilator-ideal graphs are identical to the
annihilating-ideal graphs. Also, annihilator-ideal graphs and annihilating-
ideal graphs associated with reduced and non-reduced rings of girths 4 and
$\infty$ are completely identified.

We first study reduced rings.

###### Lemma 10

. Let $R$ be a ring. If $I--J$ is an edge of $A_{I}(R)$, then
$I\cap\mathrm{Ann}_{R}(J)\neq(0)$ and $J\cap\mathrm{Ann}_{R}(I)\neq(0)$.
Moreover, if $R$ is a reduced ring, then the converse is also true.

###### Proof.

Assume that $I--J$ is an edge of $A_{I}(R)$. Thus
$\mathrm{Ann}_{R}(IJ)\neq\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$. Suppose
that
$K\subseteq\mathrm{Ann}_{R}(IJ)\setminus\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$.
Hence $KIJ=(0)$ whereas $KI\neq(0)$ and $KJ\neq(0)$. Since $KI\subseteq I$ and
$KIJ=(0)$, we deduce that $I\cap\mathrm{Ann}_{R}(J)\neq(0)$. Moreover
$KJ\subseteq J$ and $KIJ=(0)$ imply that $J\cap\mathrm{Ann}_{R}(I)\neq(0)$.
Note that if $KI=J\subseteq I$, then $J^{2}=(0)$, i.e., we may suppose that
$R$ is a non-reduced ring. Thus $J\cap\mathrm{Ann}_{R}(J)\neq(0)$. Since
$KI=J\subseteq I$, $I\cap\mathrm{Ann}_{R}(J)\neq(0)$. Similarly, if $KJ=I$,
then $J\cap\mathrm{Ann}_{R}(I)\neq(0)$.

To prove the other side, let $R$ be a reduced ring,
$I\cap\mathrm{Ann}_{R}(J)\neq(0)$ and $J\cap\mathrm{Ann}_{R}(I)\neq(0)$.
Assume to the contrary, $I--J$ is not an edge of $A_{I}(R)$. Hence by part (3)
of Lemma 1, either $\mathrm{Ann}_{R}(I)\subseteq\mathrm{Ann}(J)$ or
$\mathrm{Ann}_{R}(J)\subseteq\mathrm{Ann}_{R}(I)$. Without lost of generality,
assume that $\mathrm{Ann}_{R}(I)\subseteq\mathrm{Ann}(J)$. Therefore
$\mathrm{Ann}_{R}(I)\cap J\subseteq\mathrm{Ann}_{R}(J)\cap J$ and hence
$\mathrm{Ann}_{R}(J)\cap J\neq(0)$, a contradiction. Thus $I--J$ is an edge of
$A_{I}(R)$.  $\Box$

The following example shows that the condition of $R$ to be reduced in Lemma
10 is necessary.

###### Example 11

. Let $D=\mathbb{Z}_{2}[X,Y,W]$ and $I=(X^{2},Y^{2},XY,XW)D$ be an ideal of
$D$. Let $R=D/I$. Let $x=X+I$, $y=Y+I$ and $w=W+I$ be elements of $R$. Then
$\mathrm{Nil}(R)=(x,y)R$ and $Z(R)=(x,y,w)R$ is an ideal of $R$. It is not
hard to check that $(x)R=\mathrm{Ann}_{R}(Z(R))$ and
$\mathrm{Nil}(R)=\mathrm{Ann}_{R}(\mathrm{Nil}(R))$. Now suppose that
$I=\mathrm{Nil}(R)$ and $J=Z(R)$. Thus $I\cap\mathrm{Ann}_{R}(J)\neq(0)$ and
$J\cap\mathrm{Ann}_{R}(I)\neq(0)$, whereas
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$. Therefore
$I--J$ is not an edge of $A_{I}(R)$.

###### Corollary 12

. Let $R$ be a ring and $I,J\in\mathbb{A}(R)^{\ast}$. If
$\mathrm{Ann}_{R}(I)\nsubseteq\mathrm{Ann}_{R}(J)$ and
$\mathrm{Ann}_{R}(J)\nsubseteq\mathrm{Ann}_{R}(I)$, then $I--J$ is an edge of
$A_{I}(R)$. Moreover, if $R$ is a reduced ring, then the converts is also
true.

###### Proof.

One side is similar to part (4) of Lemma 1. To prove the other side, assume to
the contrary, $\mathrm{Ann}_{R}(I)\subseteq\mathrm{Ann}_{R}(J)$. Since $R$ is
reduced, $J\cap\mathrm{Ann}_{R}(J)=(0)$. Thus
$J\cap\mathrm{Ann}_{R}(I)\subseteq J\cap\mathrm{Ann}_{R}(J)=(0)$, a
contradiction (see Lemma 10). Thus
$\mathrm{Ann}_{R}(I)\nsubseteq\mathrm{Ann}_{R}(J)$. Similarly,
$\mathrm{Ann}_{R}(J)\nsubseteq\mathrm{Ann}_{R}(I)$.  $\Box$

To prove Theorems 14 and 15, we have to recall the following results.

###### Lemma 13

. (1) [8, Theorem $2.7$] Let $R$ be a reduced ring. Then
$\mathbb{A}\mathbb{G}(R)$ is complete graph if and only if $R\cong F_{1}\times
F_{2}$, where $F_{1}$ , $F_{2}$ are fields.

(2) [9, Lemma $1.8$] Let $R$ be a reduced ring with finitely many minimal
prime ideals. If $R$ has more than two minimal primes, then
$\mathrm{diam}(\mathbb{A}\mathbb{G}(R))=3$.

###### Theorem 14

. Let $R$ be a reduced ring. Then the following statements are equivalent:

(i) $A_{I}(R)$ is a complete graph;

(ii) $\mathbb{A}\mathbb{G}(R)$ is a complete graph $($and hence
$A_{I}(R)\cong\mathbb{A}\mathbb{G}(R))$;

(iii) $R\cong F_{1}\times F_{2}$, where $F_{1}$, $F_{2}$ are two fields.

###### Proof.

$(i)\Rightarrow(ii)$ Suppose that $A_{I}(R)$ is a complete graph. It is enough
to show that all elements of $\mathbb{A}(R)^{\ast}$ are minimal ideals of $R$.
Assume to the contrary, $I\in\mathbb{A}(R)^{\ast}$ and $J\subsetneqq I$. Thus
$\mathrm{Ann}_{R}(J)\neq(0)$ and clearly $J$ is vertex of $A_{I}(R)$. By
Corollary 12, $I--J$ is not an edge of $A_{I}(R)$ and this contradicts the
assumption.

$(ii)\Rightarrow(iii)$ It follows from part (1) of Lemma 13.

$(iii)\Rightarrow(i)$ It is clear.  $\Box$

###### Theorem 15

. Let $R$ be a reduced ring with $3\leq|\mathrm{Min}(R)|<\infty$. Then
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and $\mathrm{gr}(A_{I}(R))=3$.

###### Proof.

By part (2) of Lemma 13, $\mathrm{diam}(\mathbb{A}\mathbb{G}(R))=3$ and hence
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ by Theorem 2. Since $R$ is a reduced
ring and $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$, Theorem 3 follows that
$\mathrm{gr}(A_{I}(R))=3$.  $\Box$

###### Theorem 16

. [12, Theorem $3.4$] Let $R$ be a reduced ring. Then
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ if and only if $|\mathrm{Min}(R)|=2$.

###### Theorem 17

. Let $R$ be a reduced ring. Then the following statements are equivalent:

(1) $\mathrm{gr}(A_{I}(R))=4$;

(2) $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ and
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$;

(3) $\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$;

(4) $|\mathrm{Min}(R)|=2$;

(5) $\mathbb{A}\mathbb{G}(R)\cong K_{m,n}$ with $m,n\geq 2$;

(6) $A_{I}(R)\cong K_{m,n}$ with $m,n\geq 2$.

###### Proof.

$(1)\Rightarrow(2)$ Since $\mathrm{gr}(A_{I}(R))=4$,
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ by Theorem 3.

$(2)\Rightarrow(3)$ It is clear.

$(3)\Rightarrow(4)$ If $|\mathrm{Min}(R)|\geq 3$, then
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=3$ by [3, Theorem 7], a contradiction.
Thus $|\mathrm{Min}(R)|=2$.

$(4)\Rightarrow(5)$ It is obvious by [2, Corollary 24].

$(5)\Rightarrow(6)$ It follows from hypothesis and [2, Corollary 24] that
$|\mathrm{Min}(R)|=2$. By Theorem 16, $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$.

$(6)\Rightarrow(1)$ It is clear.  $\Box$

The following example provides a reduced ring with $|\mathrm{Min}(R)|=2$,
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ and
$\mathrm{gr}(A_{I}(R))=\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$.

###### Example 18

. Let $R=K[X,Y]/(XY)$ where $K$ is an arbitrary field. It is not hard to see
that $\mathbb{A}\mathbb{G}(R)$ is a complete bipartite graph with two infinite
parts $V_{1}=\\{(\overline{f})|~{}f\in K[X],f(0)=0\\}$ and
$V_{2}=\\{(\overline{g})|~{}g\in K[Y],g(0)=0\\}$. Since $R$ is a reduced ring
with $|\mathrm{Min}(R)|=2$, by Theorem 17, $A_{I}(R)$ is a complete bipartite
graph. Thus $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ and
$\mathrm{gr}(A_{I}(R))=\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$.

###### Theorem 19

. Let $R$ be a reduced ring. Then the following statements are equivalent:

(1) $\mathrm{gr}(A_{I}(R))=\infty$;

(2) $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ and
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=\infty$;

(3) $\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=\infty$;

(4) $|\mathrm{Min}(R)|=2$ and $\mathbb{A}\mathbb{G}(R)\cong K_{1,n}$ for some
$n\geq 1$;

(5) $R\cong F\times D$, where $F$ is a field and $D$ is an integral domain;

(6) $A_{I}(R)\cong K_{1,n}$ for some $n\geq 1$.

###### Proof.

$(1)\Rightarrow(2)$ Since $\mathrm{gr}(A_{I}(R))=\infty$,
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ by Theorem 3.

$(2)\Rightarrow(3)$ It is obvious.

$(3)\Rightarrow(4)$ If $|\mathrm{Min}(R)|\geq 3$, then
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=3$ by [3, Theorem 7], a contradiction.
Thus $|\mathrm{Min}(R)|=2$. Since $R$ is reduced and $|\mathrm{Min}(R)|=2$,
$\mathbb{A}\mathbb{G}(R)$ is a complete bipartite graph by [2, Corollary 24].
Now, $\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=\infty$ implies that
$\mathbb{A}\mathbb{G}(R)$ is a star graph.

$(4)\Rightarrow(5)$ It follows from [8, Corollary 2.3 $(2)\Rightarrow(3)$].

$(5)\Rightarrow(6)$ It is not hard to see that $\mathbb{A}\mathbb{G}(R)$ is a
star graph, and so by [3, Theorem 7], $|\mathrm{Min}(R)|=2$. Hence
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ by Theorem 16, and thus
$\mathrm{gr}(A_{I}(R))=\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=\infty$.
Therefore, $A_{I}(R)$ is a star graph.

$(6)\Rightarrow(1)$ It is clear.  $\Box$

In view of Theorems 17 and 19, we have the following result.

###### Corollary 20

. Let $R$ be a reduced ring. Then $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ if and
only if
$\mathrm{gr}(A_{I}(R))=\mathrm{gr}(\mathbb{A}\mathbb{G}(R))\in\\{4,\infty\\}$.

In the rest of this section, we focus on non-reduced rings for which
$\mathbb{A}\mathbb{G}(R)$ and $A_{I}(R)$ are identical.

###### Theorem 21

. Let $R$ be a non-reduced ring such that $Z(R)$ is not an ideal of $R$. Then
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$.

###### Proof.

Since $R$ is a non-reduced ring and $Z(R)$ is not an ideal of $R$,
$\mathrm{diam}(\mathbb{A}\mathbb{G}(R))=3$ by [9, Theorem 1.3
$(1)\Leftrightarrow(3)$]. So $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ by Theorem
2.  $\Box$

###### Theorem 22

. Let $R$ be a non-reduced ring. Then the induced subgraph of $A_{I}(R)$ on
nilpotent ideals is a complete graph.

###### Proof.

Suppose that $I$ and $J$ are two distinct nilpotent ideals of $R$ such that
$IJ\neq(0)$. Assume to the contrary,
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$. Without
loss of generality and by part 1 of Lemma 1, we may assume that
$\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)$. Let $n$ be the least positive
integer such that $J^{n}=(0)$. Suppose that $IJ^{k}\neq(0)$ for each $k$,
$1\leq k<n$. Then
$J^{n-1}\in\mathrm{Ann}_{R}(IJ)\setminus\mathrm{Ann}_{R}(I)$, a contradiction.
Assume that $k$ ($1\leq k<n$) is the least positive integer such that
$IJ^{k}=(0)$. Therefore
$J^{k-1}\in\mathrm{Ann}_{R}(IJ)\setminus\mathrm{Ann}_{R}(I)$, a contradiction.
Thus $\mathrm{Ann}_{R}(IJ)\neq\mathrm{Ann}_{R}(I)\cup\mathrm{Ann}_{R}(J)$, and
hence $I,J$ are adjacent. $\Box$

To prove Theorem 25, the following lemma is needed.

###### Lemma 23

. Let $R$ be a non-reduced ring and suppose that $(\mathrm{Nil}(R))^{2}=(0)$.
Then the induced subgraph of $\mathbb{A}\mathbb{G}(R)$ on nilpotent ideals is
a complete graph. Moreover, if $R$ is not a principal ideal ring, then the
converse is also true.

###### Proof.

Let $(\mathrm{Nil}(R))^{2}=(0)$. Then clearly the induced subgraph of
$\mathbb{A}\mathbb{G}(R)$ on nilpotent ideal is complete graph. Suppose that
$R$ is not a principal ideal ring. We need only to show that $x^{2}=0$ for
each $x\in\mathrm{Nil(R)}^{\ast}$. Let $x\in\mathrm{Nil(R)}^{\ast}$ and
$x^{2}\neq 0$. Suppose that $n$ be the least positive integer such that
$x^{n}=0$. Thus $n\geq 3$ and hence $x$, $x^{n-1}+x$ are distinct elements of
$\mathrm{Nil(R)}^{\ast}$. Since $(Rx)(R(x^{n-1}+x))=(0)$ and $x^{n}=0$,
$x^{2}=0$, a contradiction. Therefore $x^{2}=0$ for each
$x\in\mathrm{Nil(R)}^{\ast}$.  $\Box$

###### Remark 24

. It is known that if $R$ is a non-reduced principal ideal ring, then
$(\mathrm{Nil}(R))^{n}=(0)$, for some positive integer $n$. Thus
$\mathrm{Nil}(R),\ldots,\mathrm{Nil}(R)^{n-1}$ are only nilpotent ideals of
$R$. If $n=2$ or $3$, then the induced subgraph of $\mathbb{A}\mathbb{G}(R)$
on nilpotent ideals is a complete graph.

###### Theorem 25

. Let $R$ be a non-reduced ring that is not a principal ideal ring, and
suppose that $(\mathrm{Nil}(R))^{2}\neq(0)$. Then
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and $\mathrm{gr}(A_{I}(R))=3$.

###### Proof.

Since $(\mathrm{Nil}(R))^{2}\neq(0)$, $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ by
Theorem 22 and Lemma 23. By Corollary 9, $\mathrm{gr}(A_{I}(R))\in\\{3,4\\}$.
Let $R\cong F\times S$, where $F$ is a field and $S$ is a ring with a unique
non-trivial ideal. Since $R$ is a non-reduced ring and
$(\mathrm{Nil}(R))^{2}=(0)$, we deduce from Theorem 7 that
$\mathrm{gr}(A_{I}(R))=3$.  $\Box$

Let $R$ be a ring. By [8, Lemma 1.11], every minimal ideal is a vertex of
$\mathbb{A}\mathbb{G}(R)$. Using fact, we may state the following lemma.

###### Lemma 26

. Let $R$ be a ring. If $I$ is a minimal ideal of $R$, then
$N_{\mathbb{A}\mathbb{G}(R)}(I)=N_{A_{I}(R)}(I)$.

###### Proof.

By part 2 of Lemma 1, it is enough to show that $N_{A_{I}(R)}(I)\subseteq
N_{\mathbb{A}\mathbb{G}(R)}(I)$. Let $I--J$ be an edge of $A_{I}(R)$. Since
$I$ is a minimal ideal of $R$, either $I\subsetneqq J$ or $I\cap J=(0)$. If
$I\cap J=(0)$, then $IJ=(0)$ and $I--J$ is an edge of
$\mathbb{A}\mathbb{G}(R)$. Now, suppose that $I\subsetneqq J$ and $IJ\neq(0)$.
Thus $IJ=I$, and hence $\mathrm{Ann}_{R}(IJ)=\mathrm{Ann}_{R}(I)$. Therefore
$I--J$ is not an edge of $A_{I}(R)$ by part 1 of Lemma 1, a contradiction.
This means that $IJ=(0)$ and so
$N_{\mathbb{A}\mathbb{G}(R)}(I)=N_{A_{I}(R)}(I)$.  $\Box$

The following Theorem was proved in [12].

###### Theorem 27

. Let $R$ be a non-reduced ring. Then the following statements are equivalent:

(1) $\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$;

(2) $A_{I}(R)=\mathbb{A}\mathbb{G}(R)=K_{2,3}$;

(3) $\Gamma(R)=\overline{K_{1,3}}$;

(4) $R$ is ring-isomorphic to either $\mathbb{Z}_{2}\times\mathbb{Z}_{4}$ or
$\mathbb{Z}_{2}\times\mathbb{Z}_{2}[X]/(X^{2})$.

In the proof of the previous Theorem, the authours claim that
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)=K_{2,3}$ is equivalent to either
$R=\mathbb{Z}_{2}\times\mathbb{Z}_{4}$ or
$R=\mathbb{Z}_{2}\times\mathbb{Z}_{2}[X]/(X^{2})$. The claim is not true
because it is clearly both $R=\mathbb{Z}_{2}\times\mathbb{Z}_{4}$ and
$R=\mathbb{Z}_{2}\times\mathbb{Z}_{2}[X]/(X^{2})$ have four non-trivial
annihilating-ideal and by Example 5, $A_{I}(R)\cong C_{4}$.

Now we provide a correct condition for this Theorem and its proof.

annihilator-ideal graphs of non-reduced rings of girth 4 are identified in the
following result.

###### Theorem 28

. Let $R$ be a non-reduced ring. Then the following statements are equivalent:

(1) $\mathrm{gr}(A_{I}(R))=4$;

(2) $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$ and $\mathrm{gr}(A_{I}(R))=4$;

(3) $R\cong F\times S$, where $F$ is a field and $S$ is a ring with a unique
non-trivial ideal;

(4) $\mathbb{A}\mathbb{G}(R)\cong P_{4}$;

(5) $A_{I}(R)\cong C_{4}$.

###### Proof.

$(1)\Rightarrow(2)$ Assume to the contrary,
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$. Then
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=4$, and $R\cong D\times S$ where $S$ is
a ring with a unique non-trivial ideal and $D$ is an integral domain which is
not a field by [4, Theorem 3.5]. Suppose that $I$ is the unique non-trivial
ideal of $S$. Then $(0,S)$ and $(D,I)$ are two distinct elements of
$\mathbb{A}(R)^{\ast}$ such that $(0,S)(D,I)\neq(0,0)$. It is not hard to see
that
$\mathrm{Ann}_{R}((0,S)(D,I))\neq\mathrm{Ann}_{R}(0,S)\cup\mathrm{Ann}_{R}(D,I)$.
So $(0,S)--(D,I)$ is an edge of $A_{I}(R)$ that is not an edge of
$\mathbb{A}\mathbb{G}(R)$, a contradiction. Thus
$A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$.

$(2)\Rightarrow(3)$ It is clear by Theorem 7.

$(3)\Rightarrow(4)$ By [3, Theorem 2], the proof is clear.

$(4)\Rightarrow(5)$ Suppose that $\mathbb{A}\mathbb{G}(R)\cong P_{4}$, and
$\mathbb{A}\mathbb{G}(R)$ is the path $I--K--L--J$. Clearly $IL$ and $KJ$ are
two vertices of $\mathbb{A}\mathbb{G}(R)$. Since $ILJ=ILK=KJL=KJI=(0)$, we
have $KJ=K$ and $IL=L$, so $L\subsetneqq I$ and $K\subsetneqq J$. Clearly,
$K\nsubseteq J$ and $J\nsubseteq K$, and hence $R$ has exactly two minimal
ideals $K$ and $L$. By Lemma 26,
$N_{\mathbb{A}\mathbb{G}(R)}(L)=N_{\Gamma^{\prime}_{\mathrm{Ann}}(R)}(L)$ and
$N_{\mathbb{A}\mathbb{G}(R)}(K)=N_{\Gamma^{\prime}_{\mathrm{Ann}}(R)}(K)$.
Since $\mathrm{d}_{\mathbb{A}\mathbb{G}(R)}(I,J)=3$, $I--J$ is an edge of
$A_{I}(R)$ by part 5 of Lemma 1, i.e., $A_{I}(R)\cong C_{4}$.

$(5)\Rightarrow(1)$ It is clear.  $\Box$

The following result shows that if $\mathbb{A}\mathbb{G}(R)$ is a star graph
and $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$, then $A_{I}(R)$ is a complete
graph.

###### Theorem 29

. Let $R$ be a ring and $A_{I}(R)\neq\mathbb{A}\mathbb{G}(R)$. Suppose that
$\mathbb{A}\mathbb{G}(R)$ is a star graph. Then the following statements hold:

(1) $R$ is indecomposable.

(2) $A_{I}(R)$ is a complete graph.

###### Proof.

(1) First we note that $R$ is a non-reduced ring. If $R$ is reduced, then [2,
Corollary 26] implies that $R\cong F\times D$, where $F$ is a field and $D$ is
an integral domain. By Theorem 19, $A_{I}(R)=\mathbb{A}\mathbb{G}(R)$, a
contradiction. Suppose that $R\cong R_{1}\times R_{2}$, where $R_{i}$ is a
ring, for $1\leq i\leq 2$. Since $\mathbb{A}\mathbb{G}(R)$ has no cycle, we
deduce that $R\cong F\times S$, where $F$ is a field and $S$ is a ring with a
unique non-trivial ideal by [3, Lemma 1]. Thus $\mathbb{A}\mathbb{G}(R)\cong
P_{4}$ and this contradicts the assumption.

(2) Suppose that $I$ is the center of $\mathbb{A}\mathbb{G}(R)$. It is not
hard to check that $\mathrm{Ann}(J)=I$, for every $J(\neq
I)\in\mathbb{A}(R)^{\ast}$. Assume that $J--K$ is an edge of $A_{I}(R)$ that
is not an edge of $\mathbb{A}\mathbb{G}(R)$, for some
$J,K\in\mathbb{A}(R)^{\ast}\setminus\\{I\\}$. If $|\mathbb{A}(R)^{\ast}|=3$,
then there is nothing to prove. So let $|\mathbb{A}(R)^{\ast}|>3$. Obviously,
$\mathrm{Ann}(JK)\neq\mathrm{Ann}(J)\cup\mathrm{Ann}(K)$ and
$\mathrm{Ann}(J)=\mathrm{Ann}(K)=I$. Hence $\mathrm{Ann}(JK)\neq I$ and so
$JK=I$. The equalities $JKK=JK^{2}=(0)$ imply that $K^{2}=I$. Since
$JKJ=J^{2}K=(0)$, $J^{2}=I$. Let $H,H^{\prime}\neq I$ be two arbitrary
annihilating ideals. We prove that the following claims:

Claim 1. The equality $JH=I$ holds. Assume to the contrary, $JH\neq I$. Since
$JJH=J^{2}H$ and $J^{2}=I$, we deduce that $JJH=(0)$ and hence $JH=I$, a
contradiction.

Claim 2. The equality $HH^{\prime}=I$ holds. For if not, $HH^{\prime}\neq I$.
Since $JH^{2}=IH=(0)$, we deduced that $JH^{2}=(0)$ and so $H^{2}=I$. Thus
$H^{2}H^{\prime}=IH^{\prime}=(0)$ and hence $HH^{\prime}=I$, a contradiction.

Now, it is easy to see that
$\mathrm{Ann}(HH^{\prime})\neq\mathrm{Ann}(H)\cup\mathrm{Ann}(H^{\prime})$.
Therefore $H--H^{\prime}$ is an edge of $A_{I}(R)$. This completes the proof.
$\Box$

###### Theorem 30

. Let $R$ be an Artinian ring and $\mathbb{A}\mathbb{G}(R)$ be a star graph.
Then $A_{I}(R)$ is a complete graph.

###### Proof.

By [8, Theorem 2.6], either $R\cong F_{1}\times F_{2}$, where $F_{1}$ and
$F_{2}$ are fields, or $R$ is a local ring with non-zero maximal ideal
$\mathfrak{m}$ and one of the following cases holds:

(i) $\mathfrak{m}^{2}=(0)$ and $\mathfrak{m}$ is the only non-zero proper
ideal of $R$.

(ii) $\mathfrak{m}^{3}=(0)$, $\mathfrak{m}^{2}$ is the only minimal ideal of
$R$ and for every distinct proper ideals $I_{1},I_{2}$ of $R$ such that
$\mathfrak{m}^{2}\neq I_{i}$ ($i=1,2$), $I_{1}I_{2}=\mathfrak{m}^{2}$.

(iii) $\mathfrak{m}^{4}=(0)$, $\mathfrak{m}^{3}\neq(0)$ and
$\mathbb{A}(R)^{\ast}=\\{\mathfrak{m},\mathfrak{m}^{2},\mathfrak{m}^{3}\\}$.

If $R\cong F_{1}\times F_{2}$, then $\mathbb{A}\mathbb{G}(R)=A_{I}(R)=K_{2}$.
Suppose that $R$ is a local ring with non-zero maximal ideal $\mathfrak{m}$.
If case (i) holds, then there is nothing to prove. If case (ii) holds, then
for every pair of distinct proper ideals $I_{1},I_{2}$such that
$\mathfrak{m}^{2}\neq I_{i}$ ($i=1,2$), we have $I_{1}I_{2}=\mathfrak{m}^{2}$
and so
$\mathrm{Ann}_{R}(I_{1}I_{2})\neq\mathrm{Ann}_{R}(I_{1})\cup\mathrm{Ann}_{R}(I_{2})$.
Thus $A_{I}(R)$ is a complete graph. If case (iii) holds, then
$\mathbb{A}(R)^{\ast}=\\{\mathfrak{m},\mathfrak{m}^{2},\mathfrak{m}^{3}\\}$
and $\mathbb{A}\mathbb{G}(R)$ is the path
$\mathfrak{m}--\mathfrak{m}^{3}--\mathfrak{m}^{2}$. Obviously,
$\mathrm{Ann}_{R}(\mathfrak{m}^{3})\neq\mathrm{Ann}_{R}(\mathfrak{m})\cup\mathrm{Ann}_{R}(\mathfrak{m}^{2})$
and so $A_{I}(R)\cong K_{3}$.  $\Box$

###### Remark 31

. Let $\mathbb{A}\mathbb{G}(R)$ be a star graph and $I$ be the center of
$\mathbb{A}\mathbb{G}(R)$. Then it is easily seen that $I$ is a minimal ideal
of $R$. Also, it is worthy to mention that if $R$ is a non-reduced ring, then
$I^{2}=(0)$ (As $R$ is indecomposable, by part 1 of Theorem 29).

Finally, we may characterize star annihilator-ideal graphs of non-reduced
rings.

###### Theorem 32

. Let $R$ be a non-reduced ring with $|\mathbb{A}(R)^{\ast}|\geq 2$. Then the
following statements are equivalent:

(1) $A_{I}(R)$ is a star graph;

(2) $\mathrm{gr}(A_{I}(R))=\infty$;

(3) $\mathbb{A}\mathbb{G}(R)=A_{I}(R)$ and
$\mathrm{gr}(\mathbb{A}\mathbb{G}(R))=\infty$;

(4) $\mathrm{Nil}(R)$ is a prime ideal and either $Z(R)=\mathrm{Nil}(R)$ and
$|\mathbb{A}(R)^{\ast}|=2$ or $Z(R)\neq\mathrm{Nil}(R)$ and $\mathrm{Nil}(R)$
is a minimal ideal of $R$;

(5) Either $A_{I}(R)\cong K_{1,1}$ or $A_{I}(R)\cong K_{1,\infty}$;

(6) Either $\mathbb{A}\mathbb{G}(R)\cong K_{1,1}$ or
$\mathbb{A}\mathbb{G}(R)\cong K_{1,\infty}$.

###### Proof.

$(1)\Rightarrow(2)$ It is clear.

$(2)\Rightarrow(3)$ It follows from Corollary 9.

$(3)\Rightarrow(4)$ By Theorems 22, 28 and [4, Theorem 3.4],
$\mathbb{A}\mathbb{G}(R)=A_{I}(R)$ is a star graph and $R$ has at most two
non-zero nilpotent ideals. Suppose that $R$ has exactly one nilpotent ideal.
It is not hard to see that, in this case, $\mathrm{Nil}(R)$ is the only
nilpotent ideal of $R$. By Remark 31, $\mathrm{Nil}(R)$ is a minimal ideal of
$R$ and so $Z(R)\neq\mathrm{Nil}(R)$. We need only to show that
$\mathrm{Nil}(R)$ is a prime ideal of $R$. Assume that
$I,J\in\mathbb{A}(R)^{\ast}\setminus\\{\mathrm{Nil}(R)\\}$. Since
$\mathbb{A}\mathbb{G}(R)$ is a star graph, we conclude that $IJ\neq(0)$. We
show that $xy\neq 0$, for every $x\in I,~{}y\in J$ where
$x,y\notin\mathrm{Nil}(R)^{\ast}$. Assume to the contrary, $xy=0$. Thus
$(Rx)(Ry)=(0)$. If $Rx\neq Ry$, then $\mathrm{Nil}(R)--Rx--
Ry--\mathrm{Nil}(R)$ is a cycle in $\mathbb{A}\mathbb{G}(R)$, a contradiction.
Thus $Rx=Ry$, and hence $(Rx)^{2}=(0)$ which means that
$Rx\subseteq\mathrm{Nil}(R)$ is a nilpotent ideal of $R$, a contradiction.
Since $\mathrm{Nil}(R)$ is the center of $\mathbb{A}\mathbb{G}(R)$,
$\mathrm{Nil}(R)Z(R)=(0)$ (We note that by [8, Theorem 2.2], $Z(R)$ is a
vertex) and $xy\neq 0$ for every $x,y\in
Z(R)^{\ast}\setminus(\mathrm{Nil}(R))^{\ast}$, as desired.

Now, assume that $R$ has exactly two nilpotent ideals, say $I$ and $J$ where
$I$ is the center of $\mathbb{A}\mathbb{G}(R)$. If $J$ is a minimal ideal,
then $I--I+J--J--I$ is a cycle in $\Gamma^{\prime}_{\mathrm{Ann}}(R)$ by
Theorem 22, a contradiction. If $J$ is not a minimal ideal and $I\nsubseteq
J$, then there exists $J^{\prime}\subseteq J$ and so $J^{\prime}$ is a
nilpotent ideal of $R$. Therefore $I--J--J^{\prime}--I$ is a cycle of length
three in $A_{I}(R)$ by Theorem 22, a contradiction. Hence $I\subsetneqq J$. If
$x\in\mathrm{Nil}(R)$, then $Rx\subseteq J$ and so $J=\mathrm{Nil}(R)$. We
claim that $J^{2}\neq(0)$. If $J^{2}=(0)$, then $J\subseteq\mathrm{Ann}(J)$.
By the proof of part 2 of Theorem 29, $\mathrm{Ann}(J)=I$. Therefore
$J\subseteq I$, a contradiction and so the claim is proved. Since $J^{2}$ is a
nilpotent ideal of $R$, either $J^{2}=I$ or $J^{2}=J$. If $J^{2}=J$, then by
Nakayama,s Lemma, $J=(0)$, which is impossible. Consequently, $J^{2}=I$. Now
we show that $\mathrm{Nil}(R)=Z(R)$. Suppose that $x\in
Z(R)\setminus\mathrm{Nil}(R)$. Thus $Rx$ is an annihilating ideal of $R$, and
hence $Rx\in\mathbb{A}(R)^{\ast}$. If $J(Rx)=(0)$, then $I--J--Rx--I$ is a
cycle of length three in $\mathbb{A}\mathbb{G}(R)$, a contradiction. Thus, we
may assume that $J(Rx)\neq(0)$. Since $J(Rx)$ is a nilpotent ideal of $R$ and
$R$ has exactly two nilpotent ideals, either $J(Rx)=I$ or $J(Rx)=J$. If
$JR(x)=J$, then $J^{2}(Rx)^{2}=J^{2}=I$. Since $J^{2}(Rx)^{2}=I(Rx)^{2}=(0)$
and $I\neq(0)$, we conclude that $J(Rx)=I$. Set $K=I+Rx$. The equality
$IK=I^{2}+I(Rx)=(0)$ implies that $K$ is a vertex of
$\mathbb{A}\mathbb{G}(R)$. Clearly, $K\neq I,J$. Thus $JK=J(I+Rx)=IJ+J(Rx)=I$
and hence $\mathrm{Ann}(JK)=\mathrm{Ann}(I)=Z(R)$. In addition, by the proof
of part 2 of Theorem 29, $\mathrm{Ann}(J)=\mathrm{Ann}(K)=I$. These facts mean
that $\mathrm{Ann}(JK)\neq\mathrm{Ann}(J)\cup\mathrm{Ann}(K)$. Therefore, $I--
J--K--I$ is a cycle of length three in $\mathbb{A}\mathbb{G}(R)$, a
contradiction. So $Z(R)=\mathrm{Nil}(R)$ and since $I,J=\mathrm{Nil}(R)$ are
nilpotent ideals of $R$, we deduce that $|\mathbb{A}(R)^{\ast}|=2$.

$(4)\Rightarrow(5)$ Suppose that $\mathrm{Nil}(R)$ is a prime ideal. Let
$Z(R)=\mathrm{Nil}(R)$ and $|\mathbb{A}(R)^{\ast}|=2$. Then $A_{I}(R)\cong
K_{1,1}$. Now, let $Z(R)\neq\mathrm{Nil}(R)$ and $\mathrm{Nil}(R)$ be a
minimal ideal of $R$. Since $\mathrm{Nil}(R)$ is prime, if $xy=0$ where
$x,y\neq 0$, then $x\in(\mathrm{Nil}(R))^{\ast}$ or
$y\in(\mathrm{Nil}(R))^{\ast}$. Therefore if
$I,J\in\mathbb{A}(R)^{\ast}\setminus\mathrm{Nil}(R)$, then $IJ\neq(0)$. Thus
$\mathbb{A}\mathbb{G}(R)$ is a star graph with $\mathrm{Nil}(R)$ as the
center. It is clear $\mathrm{Ann}(I)=\mathrm{Ann}(J)=\mathrm{Nil}(R)$, for
every $I,J\neq\mathrm{Nil}(R)$. Hence
$\mathrm{Ann}(IJ)=\mathrm{Ann}(I)\cup\mathrm{Ann}(J)$, for every
$I,J\in\mathbb{A}(R)^{\ast}$ where $I,J\neq\mathrm{Nil}(R)$, i.e., $A_{I}(R)$
is also star graph. If $A_{I}(R)\neq K_{1,\infty}$, then $R$ has only finitely
many ideals, by [8, theorem 1.4]. This implies that $R$ is an Artinian ring.
Since $\mathbb{A}\mathbb{G}(R)$ is a star graph and $\mathrm{Nil}(R)$ is a
minimal prime ideal, we get a contradiction (See [8, Theorem 2.6]). Therefore,
$\mathbb{A}\mathbb{G}(R)\cong K_{1,\infty}$ and so the proof is complete.

$(5)\Rightarrow(6)$ It is obvious.

$(6)\Rightarrow(1)$ Since $\mathbb{A}\mathbb{G}(R)$ is a star graph and
$\mathbb{A}\mathbb{G}(R)\ncong K_{1,n}$ for some $1<n<\infty$,
$A_{I}(R)=\mathbb{A}\mathbb{G}(R)$ by part 2 of Theorem 29. Thus $A_{I}(R)$ is
a star graph.  $\Box$

The last example of this paper provides a ring $R$ such that
$\mathbb{A}\mathbb{G}(R)=A_{I}(R)=K_{1,\infty}$.

###### Example 33

. Let $R=\mathbb{Z}_{2}[X,Y]/(X^{2},XY)$ and let $x=X+(X^{2}+XY)$,
$y=Y+(X^{2}+XY)\in R$. Then $Z(R)=(x,y)R$, $\mathrm{Nil}(R)=(x)R=\\{0,x\\}$,
and $Z(R)\neq\mathrm{Nil}(R)$. It is clear that $\mathrm{Nil}(R)$ is a minimal
prime ideal of $R$ and $\mathbb{A}\mathbb{G}(R)=A_{I}(R)=K_{1,\infty}$.

## References

  * [1] G. Aalipour, S. Akbari, M. Behboodi, R. Nikandish, M. J. Nikmehr, and F. Shaveisi, The classification of the annihilating-ideal graph of a commutative ring, Algebra Colloq. 21(2) (2014), 249-256.
  * [2] G. Aalipour, S. Akbari, R. Nikandish, M. J. Nikmehr, and F. Shaveisi, On the coloring of the annihilating-ideal graph of a commutative ring, Discrete Mat. 312 (2012), 2620-2626.
  * [3] G. Aalipour, S. Akbari, R. Nikandish, M. J. Nikmehr, and F. Shaveisi, Minimal prime ideals and cycles in annihilating-ideal graphs, Rocky Mountain J. Math, 5 (2013), 1415-1425.
  * [4] F. Aliniaeifard, M. Behboodi, E. Mehdi-nezhad, Amir M. Rahimi, On the diameter and girth of an annihilating-ideal graph, arXiv: 1411.4163v1 [math.RA] 15 Nov 2014.
  * [5] M. F. Atiyah, I. G. Macdonald, Introduction to Commutative Algebra, Addison-Wesley Publishing Company, 1969.
  * [6] A. Badawi, On the dot product graph of a commutative ring, Comm. Algebra, 43 (2015) 43–50.
  * [7] A. Badawi, On the annihilator graph of a commutative ring, Comm. Algebra, 42 (2014) 108-121.
  * [8] M. Behboodi, Z. Rakeei, The annihilating-ideal graph of commutative rings I, J. Algebra Appl. 10 (2011), no. 4, 727-739.
  * [9] M. Behboodi, Z. Rakeei, The annihilating-ideal graph of commutative rings II, J. Algebra Appl. 10 (2011), no. 4, 741-753.
  * [10] T. Y. Lam, A First Course in Non-commutative Rings, Graduate Texts in Mathematics, Vol 131, Springer-Verlag, Berlin/Heidelberg, New York, (1991).
  * [11] B. Miraftab, R. Nikandish, Co-maximal ideal graphs of matrix algebras, Bol. Soc. Mat. Mex., (2016) DOI 10.1007/s40590-016-0141-7.
  * [12] S. Salehifar, K. Khashayarmanesh, M. Afkhami, On the annihilator-ideal graph of commutative rings, Ricerche mat., DOI 10.1007/s11587-016-0311-y.
  * [13] T. Tamizh Chelvam, K. Selvakumar, On the connectivity of the annihilating-ideal graphs, Discussiones Mathematicae General Algebra and Applications, 35 (2015), 195 -204.
  * [14] D. B. West, Introduction to Graph Theory, Second Edition, Prentic Hall, Upper Saddle river,(2001).
  * [15] H. Y. Yu, T. Wu, Commutative rings $R$ whose $C(\mathbb{AG}(R))$ consists only of triangles, Comm. Algebra 43 (2015), 1076–1097.