Detection of Maximal Balanced Clique in Signed Networks Based on Improved Three-way Concept Lattice and Modiﬁed Formal Concept Analysis

In the era of artiﬁcial intelligence including the fourth industrial revolution, social networks analyzing is a signiﬁcant topic in big data analysis. Clique detection is a state-of-the-art technique in social network structure mining, which is widely used in a particular social network like signed network. There are positive and negative relationships in signed networks which detect not only cliques or maximal cliques but also maximal balanced cliques. In this paper, two algorithms have been addressed to the problems. First, we modify three-way concept lattice algorithm using a modiﬁed formal context and supplement formal context to obtain an object-induced three-way concept lattice (OE-concept) to detect the maximal balanced cliques. Second, in order to improve the cost of memory and eﬃciency, we modify formal concept analysis algorithm by using modiﬁed formal context combine with supplement formal context to ﬁnd the maximal balance cliques. Additionally, we utilized four real-world datasets to test our proposed approaches as well as the running time in the experimental section.


Introduction
With the development of information technology, many researchers are paying attention to social network structures analysis in computer science. Clique is a very popular research direction in social network structure mining. Vilakone & Park [1,2] used clique detection and standardized cumulative gains to solve some problems in the movie recommendation system. However, the use of maximal clique detection and balanced clique in social network analysis are not applicable only on social media software but also can be applied on other domains, such as the Internet of Things (IoT), healthcare, biology, and more. Recently, several new issues combined social network with smart devices, smart cars, and medicines have been proposed.
Meanwhile, maximal clique detection can be used to detect the structure of proteins, which can prevent or control diseases. For this reason, we can find a group of the most suitable medical specialists for a target patient to get the best medical treatment through remote consultation. Besides, maximal clique can combine social network analysis with social Internet of Things (SIOT) [3] detection and cyber-physical system (CPS), etc. to explore new topics to address other issues.
In many existing works, cliques are typically detected in undirected and unweight graphs [4][5][6][7][8]. However, some social networks contain positive and negative relationships between users in their real-life; it can be named as a signed social network. Significantly, there are some studies about mining cliques from the signed network [9][10][11][12]. Chen [13] used an enumeration framework to optimize the baseline enumeration algorithm for obtaining maximal balanced cliques in signed networks. Salminen [14] introduced a method for classifying hate in social networks using signed social net-works. This method controlled and prevented spread promptly and prevented the proliferation of dangerous information. Shakeel [15] analyzed risk information through emotion analysis techniques to analyze signed social networks. However, few studies used formal concept analysis (FCA) to detect maximal balanced cliques in signed social networks. FCA is a novel approach applied in social network analysis. Furthermore, it gives a concept lattice which contains the structure of a social network and some relationships (objects and attributes) between the users.
In this paper, we propose an improved three-way concept lattice algorithm and a modified formal concept analysis algorithm to solve the maximal balanced clique (MBCP) detection problem. In our work, we design an improved three-way concept algorithm based on the traditional three-way concept lattice algorithm [16]. This method is most appropriate for the detection of maximal balanced cliques in a signed network. Then, we design a modified formal context analysis to optimize the first algorithm.
Specifically, signed network g is characterized by a graph structure with many nodes and some positive or negative edges. For example, Fig. 1 shows five nodes in signed network g. And there are some edges between them. In Fig. 1, the solid lines are positive edges, and the dotted lines are negative edges. In this paper, we will detect maximal balanced cliques in signed social networks. In this paper, there are some contributions as follow: 1) Improved Three-way Concept Lattice: According to the adjustment of the formal context and supplement formal context for a traditional Threeway concept lattice method, we can obtain a modified OE-concept lattice (object-induced three-way concept lattice) and a modified AE-concept lattice (attribute-induced three-way concept lattice). Since we divide the positive and negative edges in a signed social network into two parts including a modified formal context and supplement formal context, the modified OE-concept lattice and modified AE-concept lattice can be used to detect maximal balanced cliques in a signed social network. 2) Modified Formal Concept Analysis: We have implemented the second approach to save the memory and improve the application efficiency of the first approach. This method is suitable for the symmetrical formal contexts, which is constructed by an undirected social network graph. Therefore, we maintain the modified formal context and supplement formal context of the first approach to obtain two modified concept lattices based on the traditional formal concept analysis method. Then we process these lattices to get the maximal balanced cliques. 3) Experiment: We apply four real-life datasets in this paper. One real-life dataset has been used as a case study to explain the application of the maximal balanced cliques. Also, we use the other three reallife datasets to test and compare the running time with the two approaches.
In this paper, Chapter 1 describes the background, related work and significances of research. Chapter 2 describes some preliminary knowledge. Chapter 3 shows the problem statement and the proposed method. Furthermore, we describe two proposed algorithms. Chapter 4 describes the results of the experiment, it was evaluated using four real-life datasets to find the maximal balance cliques in the signed social network. Chapter 5 describes conclusions and future research.

Basic notions
In this section, we introduce several basic concepts and properties for signed networks, maximal balanced cliques and three-way concept lattice.

Signed Networks and Balanced Clique
Definition 1 (Signed networks [13]) Let G = (V, E + , E − ) be an undirected and weighted signed network g, where V denotes the set of nodes in g, E + denotes the set of positive edges between each 2 nodes in g, E − denotes the set of negative edges between each 2 nodes in g.
Definition 2 (Balanced Network [13]) Given a signed network G = (V, E + , E − ), it's balanced network if it can be split into two subgraphs G L and G R so that ∃(u, v) ∈ E + which u, v ∈ G L or u, v ∈ G R , and Definition 3 (Maximal Balanced Network [13]) Given a signed network G = (V, E + , E − ), a maximal balanced clique M BC is a maximal subgraph of G, M BC is a complete subgraph which ∀(u, v) ∈ M BC → (u, v) ∈ E + ∪ E − , and M BC can be divided into 2 subcliques C 1 and C 2 , a maximal balanced clique M BC is a maximal subgraph of G that satisfies the following constraints: The main task of this paper is to detect all the maximal balanced cliques in the signed networks with an Improved three-way concept lattice. The definitions of the traditional three-way concept in the following section.  If

Formal concept lattice
Then "≤" is a partial relation of F (K).
Definition 8 (Concept Lattice [17]) For a set of all concepts of the formal context F = (O, A, I), a Concept Lattice, CL(F ), satisfies the following constraints: The partial ordered relation ≤ can form a Concept Lat- Here, graphical representation of the partial ordered relation ≤ is a Hasse diagram. We provide an example to facilitate the understanding of a formal context and formal concept lattice.
, and the set of attributes is A = (a 1 , a 2 , a 3 , a 4 , a 5 ). "I" represents the binary relationship between O and A. For example, I(o 1 , a 2 ) = 1 means that there is an attribute of a 2 on the object o 1 , and I(o 2 , a 4 ) = 0 means that object o 2 has no attribute a 4 . And the attributes "a 1 ", "a 2 ", and "a 3 " have the common objects "o 2 ", "o 4 ", so we can get a concept is ((o 2 , o 4 ), (a 1 , a 2 , a 3 )).
The Hasse diagram as shown in Fig. 2 illustrates the concept lattice for the context of Table 1. As shown in Fig. 2, each node indicates a formal concept, and the labels of a node represent intents and extents of the concepts.
The Concept Lattice of A Formal Context F .

Three-way concept lattice
Two special three-way operations are defined based on two operations (↑ and ↓) of traditional formal concept analysis.
a pair of operators ↑ and ↓ is defined by: A, a pair of three-way operators ≤ and ≥ is defined by: Based on definition 10, three-way concept is defined as follows.
where (X, M ) is called the extent and Y is called the intent of ((X, M ), Y ). The set of all AE-concepts of F = (O, A, I) can form a lattice by some partial order structure, this lattice is called AE lattice. The partial order is defined by: Similarly, object-induced three-way concepts is defined as follows.
2) OE-concept: N ) is called the intent of (X, (Y, N )). The set of all OE-concepts of F = (O, A, I) can form a lattice by some partial order structure, this lattice is called OE lattice. The partial order is defined by: We present an example to make it easier to understand three-way context and three-way concept lattice. Table 2 shows a supplementary formal context F C for Table 1. Fig. 3 illustrates the concept lattice for the context of Table 2. Fig. 4 shows the OE lattice for formal context F and F C .

Problem statement and proposed approach
In this section, we describe maximal balanced clique detection in signed networks and propose two modified and improved methods for maximal balanced clique detection in signed networks.

Problem statement
As shown in Fig. 1, there is a signed network g, we can detect and enumerate the maximal balanced cliques in this signed network. Fig.1 shows 5 nodes from v 1 to v 5 , and there are positive relationships between each node in (v 1 , v 2 , v 5 ) and (v 3 , v 4 ), respectively. They can be represented as Fig.1.
The purpose of this paper is to detect the maximal balanced cliques in the signed social network using modified formal context and supplement formal context.
In this paper, we proposed two solutions: the first method obtains the modified OE lattice through the existing three-concept lattice algorithm using the modified formal context and the supplement formal context. We detect all maximal balanced cliques in the OE lattice. The second method is to optimize the first method to improve the detection efficiency of the maximal balanced cliques.

Proposed approach
In signed social networks, we use the formal context and supplement formal context in a traditional three-way concept lattice to represent the positive and negative relationships between nodes. Because in Definition9, there are no any positive or negative relation in formal context and supplement formal context, it cannot be used for a signed social network, in this section, we redefine the formal context and supplement formal context for signed social network.
Definition 13 (Modified OE and AE) Given the modified formal context and supplement formal context to generate OE-concept and AE-concept in a threeway concepts algorithm, we can get a modified OE lattice (denoted MOE) and modified AE lattice (denoted MAE).

Maximal Cliques Detection
Proof There are (X, Y ) ∈ F C(F ) and (M, N ) ∈ F C(F c ), and (X, (Y, N )) ∈ M OE. 1) If X = Y , we can get (X, X) = (X, Y ) ∈ F C(F ), (X, X) is an equiconcept in F C(F ), (X, X) is a maximal clique and ∀u, v ∈ X, (u, v) ∈ E + . 2) Because of (X, (Y, N )) ∈ M OE, if X = Y , we can get (X, (Y, N )) = (X, (X, N )) ∈ M OE. According to Definition 10, for a modified OE-concept (X, (X, N )), (X, N ) ≥ = X ↓ ∩ N ↓ = X. Based on Definition 5 and Definition 9, The working process of maximal cliques detection approach 1 is described in Algorithm 1. In Algorithm 1, Line 1 initializes a set of maximal balanced cliques and modified OE-concept. Line 3 constructs formal contexts F and F c for signed social network G. The Construct MFC is given by Algorithm 2. Line 4 follows the rules of traditional three-way concept algorithm according to the modified contexts F and F c to get the modified OE lattice. Lines 5-8 use theorem 1 to detect the maximal balanced cliques from M OE. Finally, set M BC returns from Line 9.
On Line 1 of algorithm 2, we initialize the matrices of both F and F c to 0. Lines 3-10 construct two matrices, three-way formal context F and supplement formal context F c , according to definition 12. Line 11 return three-way contexts F and F c . if i = j : 5: if (u i , u j ) ∈ E + and i = j : 8: if (u i , u j ) ∈ E − and i = j : 10: F c (u i , u j ) ← 1 11: return F, F c 12: end Here, we provide an example to facilitate understanding of how to use a modified three-way concept method to detect maximal balanced cliques in signed social network.
For an undirected weighted signed network graph, vertices can be regarded as its objects and attributes of the formal context, so the corresponding formal context F and supplement formal context F c are a symmetric matrix in undirected weighted signed network.
The formal context F represents a positive relationship between vertices, and the supplement formal context F c represents a negative relationship between vertices. Hao et. al [8] showed that when the extent and intent of a concept are equal, it is called an equiconcept, which is a maximal clique in the social network. Thus, for the modified formal context F , all equiconcepts are maximal cliques with positive relationships in signed social network graphs.
On the contrary, there should be a negative relationship between the extent and intent of the concept obtained from the supplement formal context F c . If the extent and intent of the concept obtained from the supplement formal context F c are the same as the equiconcepts in the formal context F , it indicates that this concept of supplement context F c satisfies the definition 3. In the signed social networks, it is the maximal balanced clique. The above process is described in Algorithm 3. In algorithm 3, Line 1 initializes the sets of maximal balanced cliques, equiconcept, concept lattice Ω(F ), Ω(F c ). Line 3 constructs the formal context F and F c for a signed social network G, while Construct MFC is given Algorithm 2. Lines 4-5 obtain the concept lattice of formal F and F c . Lines 6-8 obtain the set of equiconcept. Lines 9-12 detect maximal balanced cliques through EC ← (x, y) 9: for each (x, y) ∈ EC : 10:

Experiment
This chapter presents experimental results. The experimental environment is macOS Catalina operating system, two Intel 2.3 GHz Quad-Core Intel Core i5, RAM 16G, and the Programming language is Python 3.8. In this chapter, we use two approaches proposed in chapter 3 to perform experiments.
The modified three-way concept lattice method can deal with symmetric and asymmetric formal context, but the modified formal concept analysis can only handle symmetric formal context of maximal balanced detection. Therefore, we test approach 1(modified threeway concept) using three different real-life asymmetric datasets at first. Then, we using a large symmetric real-life datasets to compare approach 1 the approach 2 (modified formal concept analysis).

Modified Three-way Concept
Experiment 1: Case Study There is a real-life dataset AdjWordNet [18] downloaded from WordNet (http://wordnet.princeton.edu). This dataset contains 117 000 words for synonyms and antonyms. Synonyms have positive edges, antonyms have negative edges, and there is no edge between unrelated words.
In this case study, we selected 25 words (Table 3) from AdjWordNet and obtained three maximal balanced cliques, thus finding three sets of synonyms with opposite meanings (Table 4). In Table 4, each line in S 1 and S 2 represents a group of synonyms, and each column of S 1 and S 2 represents a group of two antonyms.  (table 5), and the first dataset is 11 nodes from AdjWordNet [18], which is about synonyms and antonyms of words. The second dataset is a network of Intra-organization [19], which is a dataset of consulting company (46 employees) and records the frequency of requests for information or advice among employees. The third dataset is Freeman's EIES networks [20], which includes some personal relationships among 46 researchers.
As shown in Fig. 9, the running time of the first data set is less than that of the other two datasets. Thus, although we can see that Approach 1 is highly sensitive by the number of nodes and edges, it has the advantage of being able to compute asymmetric formal context that are not limited to social network datasets.

Modified Formal Concept Analysis
In this session, we test approach 2 using the Slashdot dataset [21]. Slashdot is a technology-related news website known as a specific user community. The website has the capability for users to submit to the site about the latest news, which is mainly technology oriented, and for editors to evaluate the content. In addition, the Slashdot dataset contains friend and the relationships between Slashdot users. The Slashdot includes 77350 nodes and 516575 edges, but in this paper, we take only the first 2000 nodes of the dataset and experiment in groups of different sizes. We transform the relationships of a dataset into undirected relationships without considering a positive or negative relationship with one direction to obtain a symmetric matrix that simulates an undirected weighted social network (Table 6). Figure 10 shows the comparison of the run-time on dataset 1-9 with Approach 1 and Approach 2 methods. The blue column shows the runnigtime by Approach 1 method, and the orange polyline shows the runningtime by Approach 2 method. It can be seen that the runningtime of the Approach 2 method is much shorter than the runningtime of the Approach 1 method. When the number of nodes increases to 900, that is, when running DataSet-9, measuring run-time using Approach 1 method takes a lot of time. Figure 11 shows the runningtime of Approach 2 method for DataSet 10-14. Although the time is getting longer, the Approach 2 method can easily obtain execution results until 2000 nodes are reached. However, the limitation of Approach 2 method lies in that many real-life datasets are bidirectional graphs, while they only apply to undirected weighted signed social networks. Since both Approach 1 and 2 methods have advantages in each case, applying them to real-life social networks will allow us to choose a more appropriate method.

Conclusion
Based on the traditional formal concept analysis method and the three-way concept lattice algorithm, this paper proposes a modified three-way concept algorithm and a modified formal concept algorithm to detect the maximal balanced clique in the signed social network and reduce execution time. To demonstrate feasibility for the proposed method, in the performance evaluation, four real-life signed social networks are used to detect maximal balanced cliques, and synonyms and antonyms were used on the AdjWorldNet dataset. Also, we found that both two methods have advantages and disadvantages. Approach 1 method has a wider application range on asymmetric dataset, and Approach 2 method have a faster computation speed and higher efficiency. This proposed method can apply to detect of synonyms and antonyms in dictionary, the detection of social network user groups, and the analysis of protein molecular structure. It can be applied to more scenarios in the future. In addition, we will solve the problem of long running time in Approach 1 method.

Ethical approval
This article does not contain any studies with human participants or animals performed by any of the authors.