1. Introduction
The theory of formal concept analysis (FCA), proposed by Rudolf Wille in 1982 [
1,
2], describes entities or abstract concepts in a formal manner and establishes their corresponding hierarchical structures. Regarding the core data structures and tools for formal concept analysis in the context of data analysis and processing, the concept lattice has been widely used in many fields. Many studies have extensively explored the diversity of knowledge representation and reasoning based on the theory of the concept lattice [
3]. Examples include knowledge exploration [
4,
5,
6], concept learning [
7,
8,
9,
10,
11], data extraction [
12], and path planning [
13].
Significant progress has been made in research on the formal concept lattice and its extended structure in recent years. Rough set (RS) theory is a useful mathematical tool that was proposed by Pawlak [
14]. Given that FCA and the RS are highly complementary, it is useful to combine them for knowledge discovery. Duntsch and Gediga [
15] defined model-style operators based on a binary relation. Inspired by this, Yao [
16,
17] proposed the object-oriented concept lattice based on necessary and possible operators. A number of studies on the subject have been published following the proposal of the three-way decision [
18]. Three-way concept analysis is the product of combining the three-way decision with FCA [
19,
20]. The three-way concept lattice is the minimal closure system that contains both the concept lattice and complementary concept lattice [
21]; thus, it can describe more information. Wei et al. [
22] extended the three-way concept lattice to the three-way object-oriented concept lattice. They described the necessary attributes of object sets based on the formal context as well as the necessary attributes not possessed by them based on the complement formal context. Thus, the three-way object-oriented concept contains both positive and negative parts. However, in contrast to the three-way concept, these two parts can be used to simultaneously describe the attributes that are necessarily possessed and not possessed by the object sets. Moreover, three-way rules can be extracted from these concepts [
23,
24,
25].
In addition, most applications based on FCA require first acquiring a concept lattice or its extended structure. Obtaining all the relevant concepts is important but difficult because of their high time complexity. Many studies have been devoted to acquiring object-oriented concept lattices and three-way concept lattices. Wang et al. [
26] proposed a method to construct object-oriented concept lattices based on approximation operators. Ma et al. [
27] put forward an approach to acquire all object-oriented concepts based on layered extent sets. She et al. [
28] presented a theoretical study on object-oriented concept lattices and property-oriented concept lattices in multi-scale formal contexts. Shao et al. [
29] proposed the zoom algorithm, which is composed of the zoom-in and zoom-out algorithms. It can be used to transform object-oriented concept lattices with different combinations of attribute granularity. Qian et al. [
30,
31,
32] proposed a method for generating three-way object-oriented concepts. It first generates the apposition of a given formal context and its complementary context, and then applies an algorithm of constructing the object-oriented concepts to obtain all three-way object-oriented concepts based on the isomorphic relationship between the object-oriented concept lattice and the three-way object-oriented concept lattice. Long et al. [
33] and Hu et al. [
34] developed a method to update attribute-induced and object-induced three-way concepts, respectively. Hao et al. [
35] proposed a method to incrementally construct the three-way concept lattice.
However, to the best of our knowledge, little effort has been dedicated in research for three-way object-oriented concept acquisition. Inspired by past work in the field [
26,
30,
31,
32], this study develops an algorithm that can completely and directly acquire all three-way object-oriented concepts from a given formal context
. We call it the
algorithm. It is a structured algorithm with a time complexity of
. It not only avoids traversing the power set of the attribute set
V but also uses bitwise operations on hash values instead of union operations on object sets to enhance the efficiency of acquisition. The results of comparative experiments demonstrated that it can be used to acquire all three-way object-oriented concepts more quickly than the prevalent algorithm in the field on various datasets. Our work can serve as a basic algorithm for three-way rule acquisition from three-way object-oriented concepts.
The remainder of this paper is organized as follows:
Section 2 reviews some basic notions that are relevant to three-way object-oriented concept lattices. To clearly and accurately illustrate concept acquisition process of the
algorithm, we provide its theoretical foundation in
Section 3.
Section 4 presents the pseudo-code of the
algorithm and analyses its time complexity, while
Section 5 provides its experimental verification. Finally,
Section 6 summarizes our contributions and future research in the area.
2. Preliminaries
In this section, we briefly review some basic notions and relevant properties of three-way object-oriented concepts in order to clearly describe the acquisition process of these concepts in next section.
Definition 1 (Formal context [
1,
2])
. A formal context consists of two sets U and V and a relation R between U and V. The elements of set U are called objects, while those of set V are called attributes of the context. For and can be written as , which means that object x has attribute y, or that attribute y belongs to object x. For a formal context , let . is then the complement context of . For and , if , this can be written as . This means that object x does not possess attribute y, or that attribute y does not belong to object x.
For any
and any
on a formal context
, Wille and Ganter also defined two operators,
f and
g [
1,
2]:
The
f and
g operators are also called positive operators, while the two corresponding operators,
and
, on the complement context
are called negative operators in three-way concept analysis [
19]. The
and
operators are defined as follows:
Example 1. Table 1 shows a formal context , while Table 2 shows the complement context . is the object set, and is the attribute set. Each row represents an object and each column represents an attribute. Usually, □ is called the necessity operator and ⋄ the possibility operator. For a formal context
,
and
,
is the set consisting of all necessary attributes of
X, while
is the object set that possesses at least one attribute in
Y. They are defined as follows [
16,
17]:
Furthermore, □ and ⋄ have the following properties [
16,
17]:
For the complement context
, operators □ and ⋄ are called negative approximation operators as a pair. To refer to them explicitly, they are denoted by
and
, respectively.
and
have the same properties as □ and ⋄; thus, we do not list them here again. By combining the operators □, ⋄,
, and
, a pair of object-induced three-way object-oriented operators (OEO operators), “⊳:”
and “⊲:”
, can be defined as follows [
22,
30]:
where
and
. If and only if
and
, the pair
is called an object-induced three-way object-oriented concept, i.e., an OEO-concept [
22,
30].
X and
are called the extent and the intent of the OEO-concept
, respectively. The set of all OEO-concepts of
is denoted by
. For any
and
,
The relation ≤ defined above is a partial-order relation on
[
22,
30]. For any
,
Thus, forms a complete lattice, which is called the three-way object-oriented concept lattice.
3. Theoretical Foundation
In this section, we describe the theoretical principles of the algorithm to acquire all three-way object-oriented concepts, i.e., OEO-concepts, from a given formal context . The related definitions and propositions are as follows.
Definition 2 (Single-attribute concept). For a formal context , a pair , with , and , is called a single-attribute concept. Similarly, for the complement context , a pair , with , and , is also called a single-attribute concept.
For the formal context , the set of all single-attribute concepts is denoted by . Similarly, for the complement context , the set of all single-attribute concepts is denoted by . Single-attribute concepts are directly obtained by mapping individual attributes to objects, with the operators g and , i.e., Equations (2) and (4), in the formal context and the complement context, respectively. Therefore, these single-attribute concepts are not formal concepts. However, we can obtain OEO-concepts through single-attribute concepts. This procedure is defined by using the following function:
Definition 3 (Function
)
. Given a formal context , the λ function is a mapping to . The definition is as follows: where . In order to prove that is an OEO-concept, Propositions 1 and 2 are presented separately.
Proposition 1. For a formal context and its complement context , if , then , is an OEO-concept.
Proof. According to the definition of the OEO-concept [
22,
30], we need to only prove that
,
=
.
First, we can obtain
. It follows from the property (Equation (
7)) that
. Further, we can deduce from the property in Equation (10) that
. Second, we know from the property in Equation (9) that
and
. Consequently, we obtain
. This implies
. Thus, we can conclude that
.
Similarly, . Hence, based on the definition of the OEO concept, is an OEO-concept. □
For any given object set , an OEO-concept can be obtained based on Proposition 1. It can subsequently be used in the proof of Proposition 2.
Proposition 2. For a formal context and its complement context , any , is an OEO-concept.
Proof. Based on the function (Definition 3), let = . We need to prove that satisfies such conditions that and . According to Proposition 1, it is an OEO-concept.
- (1)
First, we prove that
. According to Definition 3, we can obtain
, where
. Therefore,
Y satisfies the definition of
in the formal context
, i.e., Equation (
5). Thus,
.
- (2)
Second, we prove that . We know that , where . Thus, satisfies the definition of in the complement context . Hence, .
- (3)
Finally, we prove . Based on (1), (2), and the property in Equation (9), we obtain . Assuming that , we have and . As , this means that and . Thus, we obtain . This leads to a contradiction with the assumption. Thus, we obtain .
Based on (1), (2) and (3), the proposition has been proven. □
According to Proposition 2, we can obtain OEO-concepts with the function for a formal context . Furthermore, these OEO-concepts that are derived by the function can be used to obtain the other remaining OEO-concepts by using the steps below. For convenience of expression, we provide the following definitions:
Definition 4 (Basic OEO-concept). For a formal context , the concept derived from , where and , is called a basic OEO-concept. The set of all basic OEO-concepts is denoted by .
Definition 5 (k-granularity OEO-concept). Given an OEO-concept c of a formal context , if the cardinality of the extent of c is equal to k, i.e., = k, then the concept c is called a k-granularity OEO-concept, and it is denoted by .
For a formal context
, the set of all
k-granularity OEO-concepts is denoted by
, while the set of all
k-granularity basic OEO-concepts is denoted by
. Moreover, all OEO-concepts can be categorized into
by their
k-granularity. Thus, we can get the following equation:
Proposition 3. Any 1-granularity OEO-concept can be obtained from the basic OEO-concepts, i.e., .
Proof. For a 1-granularity OEO-concept , we can obtain . and . Thus, and are single-attribute concepts based on Definition 2. Furthermore, according to Definition 4, we can obtain = , which is a basic OEO-concept. Thus, any 1-granularity OEO-concept can be obtained from basic OEO-concepts, i.e., . □
Now, we can obtain by Proposition 1, i.e., , and can obtain based on Proposition 3. In order to obtain the remaining OEO-concepts, i.e., , it is necessary to perform merge operations on the generated OEO-concepts.
Definition 6 (Concept merging)
. For a formal context , if and are OEO-concepts, then the merge operation of and is defined as follows: where , , and , For any two OEO-concepts and , a new pair can be obtained by using . However, the new pair derived from the merge operation may be not an OEO-concept. Thus, we introduced the definitions of the candidate k-granularity OEO-concept.
Definition 7 (Candidate k-granularity OEO-concept). For a formal context (U, V, R), and are any two OEO-concepts, and the pair obtained by is called the candidate OEO-concept. If , the pair can be called the candidate k-granularity OEO-concept and is denoted by .
For a formal context (U, V, R), the set of all candidate k-granularity concepts is denoted by
, i.e.,
For any , regardless of whether c is an OEO-concept or not, its extent part, i.e., , must be the extent of a certain OEO-concept based on the definition of the supremum of two OEO-concepts (Equation (16)) and merge operation (Definition 6). Does the set of all candidate k-granularity concepts include all extents of all k-granularity OEO-concepts , i.e., ? We answer this question by following proposition.
Proposition 4. For a formal context (U, V, R), and are OEO-concepts. If is an immediate sub-concept of , i.e., , then there must exist an OEO-concept such that and .
Proof. Assume that and . Because , there must at least exist an object .
- (1)
If , we obtain . Thus, let . Based on Proposition 1, let = ; thus, it is an OEO-concept. According to the properties of □ and ⋄ (Equation (9)), . Thus, . Furthermore, according to the properties of OEO-concept lattices and the definition of supremum (Equation (16)), we obtain = . Hence, .
- (2)
If , we get . Thus, . We thus let . Similarly, we can get and .
Based on (1) and (2), the proposition has been proven. □
According to Proposition 4, if
, we can get
and
. However, if
,
owing to the definition of
(Equation (
22)). However, if
, we can obtain a further conclusion based on Proposition 4. We state it as the following proposition:
Proposition 5. For a formal context (U, V, R), and are OEO-concepts, such that and . If or , then .
Proof. If and , we can get based on the properties of operator g. On the contrary, because a is a necessary attribute, we get . Thus, it can be concluded that . Furthermore, according to Definitions 2 and 4, we get and .
The same conclusion can be obtained for the case where . We omit its proof. □
Based on Propositions 4 and 5, it can be concluded that . Therefore, we can group the candidate k-granularity OEO-concepts and the k-granularity basic OEO-concepts with the same extent. And, then, the corresponding intents of these extents are confirmed as follows:
Definition 8 (Equivalence class of extent)
. Given a formal context (U, V, R), if and the set meets the condition then the set is called the equivalence class of the extent of c. The equivalence class of the extent of c is used to obtain the intents of a new OEO-concept through the union operations of the intents of all concepts in the equivalence class. The process is defined as the function .
Definition 9 (Function
)
. Given a formal context (U, V, R), the φ function is a mapping to . The definition is as follows: where . As has been already generated by (Definition 3), needs to only map each concept to an OEO-concept in . Now, Proposition 6 is provided to prove that is an OEO-concept.
Proposition 6. For a formal context (U, V, R), if , then is an OEO-concept.
Proof. If we want to prove that is an OEO-concept, it needs to satisfy and based on the definition of OEO-concepts.
- (1)
First, we prove that .
, if ; then, by the definition of the necessary operator, . Given the arbitrariness of b, it follows that .
Assume that but , i.e., ; then, let = . is then an OEO-concept based on Proposition 1. Because , . If , then we get . This implies that . Therefore, given the arbitrariness of b, we conclude that .
In the case , let . Because and is the extent of an OEO-concept, is an OEO-concept and . According to Proposition 4, there must exist an OEO-concept such that . This means that . Given the arbitrariness of b, we get as well.
According to above 1. and 2., we get .
- (2)
Second, it can similarly be proved that .
- (3)
Third, . Moreover, is an OEO-concept. Therefore, . Thus, .
From the above proofs, the proposition has been proven. □
For the formal context , all OEO-concepts can be categorized into , , by their k-granularity. Thus, we can obtain from the basic OEO-concepts, and we can then apply function to iteratively obtain the others based on the k-granularity. Consequently, all OEO-concepts of the formal context can be obtained. Proposition 7 proves that the OEO-concepts generated by this method are complete.
Proposition 7. All OEO-concepts of the formal context can be obtained by iteratively applying function φ based on the basic OEO-concepts.
Proof. We use mathematical induction to prove the proposition. For convenience, all OEO-concepts are categorized into , by their k-granularity.
- (1)
Inductive Foundation: Based on Propositions 1 and 3, and can be obtained from basic OEO-concepts.
- (2)
Inductive Hypothesis: Assume that the k-granularities of all OEO-concepts with granularity less than k are known, i.e., , and are already known.
- (3)
Inductive Step: Based on the inductive hypothesis and the partial-order relationship among OEO-concepts, all of the sub-concepts of each k + 1 granularity OEO-concept are known. The candidate set for k + 1 granularity OEO-concepts, , can be obtained by Definition 7. Furthermore, according to Propositions 4 and 5, and Definition 8, the equivalence class of the extent of each k + 1 granularity OEO-concept can be obtained. Thus, all k + 1 granularity OEO-concepts can be obtained by using the function based on Proposition 6. Finally, can be obtained.
- (4)
Conclusion: can all be obtained.
□
Based on Proposition 7, we designed a structural algorithm to construct all OEO-concepts from a formal context. The details are provided in the next section.
4. Algorithm Description and Time Complexity
The main idea underlying the 3WOC algorithm is as follows: First, is obtained by Proposition 1, and then the set of single-attribute concepts (Definition 2) is built from the formal context and its complementary context . Second, the set of all basic OEO-concepts, i.e., , is obtained from function (Definition 3), and is obtained based on Propostion 3. Third, the candidate k-granularity OEO-concepts (k = 2 when beginning) are obtained according to Propositions 4 and 5. The function is then used to obtain all new k-granularity OEO-concepts in based on Proposition 6. By iteratively repeating this procedure, all concepts in , can be constructed. Finally, all OEO-concepts of the formal context , i.e., , are constructed based on Proposition 7.
4.1. Algorithm Description
The pseudo-code description of our proposed algorithm is as follows:
Algorithm 1 is a structured algorithm. Lines 2 to 5 are used to generate the basic OEO-concepts, i.e., (Definition 4). By Proposition 3, was constructed. Lines 6 to 16 are then used to iteratively construct . Lines 7 to 16 implement the function (Definition 9). Finally, all OEO-concepts are constructed and collected (line 17). The computational process of the 3WOC algorithm involves a large number of search and union operations, i.e., the functions find() and M(). The hash key is not only used to improve the efficiency of searching for a concept in L but also to improve the efficiency of union operations by directly performing bitwise operations with their hash values in place of the union operations on the set. The hash function , which maps the extent of an OEO-concept to a unique value, is defined as follows:
Definition 10 (Function h)
. Given a formal context , we can provide a linear order on the object set U, i.e., . Then, each object , , has its ordered position i in U. The function h is a mapping from an object set to a natural number, i.e., : where X = , . Algorithm 1: 3WOC |
![Applsci 15 06486 i001]() |
Due to the correspondence relationship between the hash value and the extent of a concept, the time complexity of in line 12 is . Furthermore, we can obtain the extent that is composed of objects from the hash value by using the function :
Definition 11 (Function
)
. Function : where AND is the bitwise AND operation on the binary representation of two natural numbers. For a given formal context , each corresponds to a hash key based on the above functions, h and . Let represent all hash values from , i.e., . Thus, = . We can consider and as two algebraic systems, where OR is the bitwise OR operation on the binary representation of two natural numbers. They are isomorphic. Moreover, the proof is given in Proposition 8.
Proposition 8. The algebraic systems and are isomorphic.
Proof. - (1)
is the non-empty set of natural numbers ranging from 0 to . Thus, = .
- (2)
For any
, there is an
such that
. Thus, the function
h is an injection. Furthermore, for any
, if
, then
. Thus, the function
h is a surjection. Consequently, the function
h is a bijection.
- (3)
For any
, there exists
such that
. Thus, the function
is an injection. For any
, if
, then there must be at least one bit that is different between the binary representations of
a and
b, i.e.,
. Thus, the function
is a surjection. Consequently, the function
is a bijection.
Based on the above, (1), (2), (3), the proposition has been proven. □
According to Proposition 8, we can directly perform the bitwise OR operations with their hash values in place of union operations on object sets in the algorithm. However, the time complexity of function h, which converts the extent of concepts into a natural number, is .
4.2. Time Complexity
The time complexity of Algorithm 1 is analyzed as follows: According to Equations (2) and (4), executing Steps 2–3 takes
to obtain all single-attribute concepts (Definition 2) from the formal context
and its complement context
. According to Definition 3 and Proposition 8, the time complexity of function
is
, and it is
in the worst case. Thus, Steps 4–5 take at most
to obtain all basic OEO concepts,
(Definition 4). Steps 6–16 take at most
. Based on Equation (
20), letting
, we can obtain the total time complexity of Algorithm 1 as
. As
is significantly larger than
, the time complexity of Algorithm 1 is
.
Example 2 illustrates the process of constructing OEO-concepts for the 3WOC algorithm. The details are as follows:
Example 2. The formal context is shown in Table 1 while the complement context is shown in Table 2. The object set is = 1, 2, 3, 4, 5 and the attribute set is = a, b, c, d, e. For the sake of clarity, the extents of the concepts considered in this example are still represented in the form of object sets. Additionally, the hash key of the extent of each concept is also provided. By using g and (Equations (2) and (4)), we can obtain sets of single-attribute concepts and (Definition 2), as shown in Table 3. The hash key can be obtained by using the above function h (Definition 10) on the extent of each concept. For instance, the object set {1,2,4,5} is the extent of the single-attribute concept . Thus, its hash key is . Then, (Definition 4) is generated from and , as shown in Table 4. According to line 1 in Algorithm 1, is . Based on Proposition 3, all 1-granularity OEO-concepts have been constructed. In this example, = . In order to obtain all 2-granularity OEO-concepts except for , we need to perform , such that and . Thus, key: 1 OR key: 4 = key: 5 = based on Proposition 8. Thus we get : . When the loop (lines 7 to 16 in Algorithm 1) is completed, we obtain as a new OEO-concept according to Proposition 6, i.e., . Consequently, is added to . The updated is shown in Table 5. We now construct , i.e., . and , are computed. This yields the following candidate OEO-concepts: , , , , , , and . Similarly, we can obtain and as new OEO-concepts according to Proposition 6, and we add them to . , , and are 4-granularity candidate OEO-concepts now. We can obtain when k = 4. Finally, all OEO-concepts are obtained as shown in Table 6. Furthermore, the three-way object-oriented concept lattice can be built based on the partial relationship between the concepts (Equation (14)). The lattice is shown in Figure 1, in which the concepts marked with a box are basic OEO-concepts. For any two formal contexts, and , V is the set of condition attributes, T is the set of decision attributes, and . They form a formal decision context . We can obtain two three-way object-oriented concept lattices, and , using Algorithm 1. Assume that the formal decision context is OEO-consistence. Then, for any and , if , and are not ∅, we can obtain a positive three-way rule and a negative three-way rule [25]. Thus, Algorithm 1 can serve as a basic algorithm for three-way rule acquisition from OEO-concepts.