In this section, the MNG-SC algorithm that can accurately calculate the concept stability is introduced in detail. Unlike traditional algorithms that use minimal generators to calculate stability values, we provide a novel perspective of stability calculation by linking it to maximal non-generator. Then thanks to the proved equivalence between the maximal non-generator and the lower neighbor concept, the maximal non-generator is directly obtained form the existing concept lattice. At last, a novel Maximal Non-Generator-based Stability Calculation (MNG-SC) algorithm is proposed.
4.1. Linking Stability Calculation to Maximal Non-Generator
In this part, we first provide a formula (Corollary 2) for calculating stability value leveraging the non-generators. Then, we make use of the special properties (Property 1) of maximal non-generators to obtain a novel perspective (Theorem 1) for calculating the stability of a concept.
Corollary 2. Given a formal concept , the stability of is the proportion of generator in the power set of A. On the contrary, it also can be computed by the proportion of the total number of non-generator . Therefore, Equation (1) of the stability is simplified as follow: where is the total number of non-generator of .
Proof. According to Corollary 1, is the total number of . Then we have the following equality: . Naturally, . ☐
Definition 3 (Maximal Non-generator). Given a formal context and a concept of K. If there is a subset P of A which makes , then P will be a maximal non-generator if there no exists and such that .
Property 1 (
Property of Definition 3 [
18]).
Let be a formal concept. If P is a maximal non-generator of the extent A, then P fulfills that , is also a non-generator of A. Proof. It could be found in [
18]. ☐
Based on the special Property 1 of maximal non-generator, we have known all subsets of maximal non-generator are non-generators. On this basic, we can naturally calculate the number of subsets of maximal non-generators to obtain the in Equation (3). Therefore, a new theorem for calculating the stability of a concept is proposed. The theorem is as follows:
Theorem 1. Given a formal context and a concept of K. If all maximal non-generators of are , then Proof. Since are the maximal non-generators of , based on Property 1, all subsets of are non-generators. Thus, the total number of non-generator is . Based on Corollary 2 and the Inclusion-Exclusion principle, the total number of non-generators could got via . Naturally, Equation (4) can be directly derived. ☐
Example 3. Continue the Example 2, we have known the generators of are and its stability is equal to 3/8. Obviously, all the subsets of except these three generator are non-generators. Thus, the non-generator of are . According to the Definition 3, the maximal non-generators are .
Suppose we first have know the maximal non-generators , according the Property 1, the number of subsets of and is equal to the number of non-generators of the concept. According the Theorem 1, we can get the number of non-generator is 5 and the stability of is equal to .
4.2. Extracting Maximal Non-Generator
Summarize the preceding part of this section, we have known that the stability of can be calculated by linking it to maximal non-generator. Now, how to obtain all maximal non-generators of is becoming important. The brute force method of traversing all subsets of A and checking whether Definition 3 is satisfied undoubtedly wastes computing resources.
Interestingly, we have found the equivalence between maximal non-generator of A and the lower neighbor concept of . This equivalence makes it sufficient to calculate the concept stability by only exploring its lower neighbor concepts, which greatly improves scalability and reduces computational complexity. The equivalence theorem is given below:
Theorem 2. Given a formal context and a concept of K. The maximal non-generators of A is equivalent to the lower neighbor concepts of .
Proof. In order to prove the equivalence of lower neighbor concept and maximal non-generator, we need to prove from two directions: (1) Suppose X is a maximal non-generator of A, then it can form a lower neighbor concept of . (2) If is a lower neighbor concept of , then X is a maximal non-generator of A.
(1) Since X is a maximal non-generator of A, then . In addition, , thus we can get . However, X is a subset of could never hold, otherwise X could not be maximal. Thus, , it means that there exists a lower neighbor concept (X, f(X)) of (A, B).
(2) Since is a lower neighbor concept of , then . So X is a non-generator of A. Suppose X is not maximal, there exists a maximal non-generator of A. From (1), there should exist a concept . This conclusion contradicts the initial conditions. Thus, X is a maximal non-generator of A. ☐
Based on the proved the equivalence of lower neighbor concept and maximal non-generator, we can directly obtain the maximal non-generator form the existing concept lattice. For example, as shown in
Figure 3, calculating the maximal non-generators of
only needs to directly explore its lower neighbor concepts
and
.
Next, on the basis of Theorem 1, the core theorem is proposed as follows. It uses the inclusion-exclusion principle and the lower neighbor concept of that represents maximal non-generator of A to calculate concept stability. The core theorem is as follows:
Theorem 3. Let be a formal context and a formal concept of K. If all neighbor concepts of are , then Proof. According to the Theorem 2, all lower neighbor concepts of are its maximal non-generators. Then, Equation (5) can be naturally derived from Theorem 1. ☐
Corollary 3. Let be a formal context and a formal concept of K. If the lower neighbor concept of is the bottom concept, the stability of is equal to .
Proof. The extent of the bottom concept is an empty set. So the maximal non-generator is an empty set means only one empty set in the powerset of A is a non-generator. Thus, the stability of is equal to . ☐
Example 4. Continue the Example 3, according Theorem 1, we have known how to compute the stability of by using the maximal non-generators. Next, we give a demonstration of how to directly obtain the maximal non-generators according to Theorem 2 and how to calculate the stability by using the obtained maximal non-generators according Theorem 3.
According to Theorem 2, the lower neighbor concepts , are maximal non-generators of . As shown in Figure 3, calculating the maximal non-generators of only needs to directly explore its lower neighbor concepts and . Then, according to Theorem 3, the number of distinct subsets of which equals to the number of non-generators of is 5. Thus, the stability value of is . 4.3. MNG-SC Algorithm
Based on the previous discussion, the MNG-SC algorithm for the accurate computation of concept stability is proposed. The guiding idea is the fact that the maximal non-generators of a given formal concept is equivalent to its lower neighbor concepts.
The pseudo-code of the MNG-SC algorithm is described by Algorithm 1. The algorithm takes a formal concept as input and starts by initializing the stability value to 0, the total number of non-generator to 0, the of the empty maximal non-generator intersection to false (c.f. Line 1). In Lines 3–4, the maximal non-generator objects are assigned to the lower neighbor concepts of (c.f. Theorem 2). The goal of the for loop (c.f. Lines 5–13) is to compute the total number of non-generator. To do so, if the is false, the getINongenNum function will be invoked. The goal of the function is to calculate the number of non-generator obtained by i maximal non-generator objects. The flag is ture means that the intersection of i or more maximal non-generator is empty. Therefore, is accumulated according to Equation (3). In Lines 14–15, the stability of the concept is calculated (c.f. Equation (3)) and returned.
As shown in Algorithm 2, the getINongenNum function inputs the maximal non-generator objects, the number of maximal non-generator objects to be intersected and outputs the number of non-generator obtained by
i maximal non-generators. It starts by initializing
to 0 (c.f. Line 2). In the for loop on the
i elements of the objects
M (c.f. Line 3), the intersection of any
i maximal non-generator objects is calculated and the number of non-generators is accumulated and assigned to
. In Lines 7–9, if the
is equal to 0, the
represented the empty set of
is assigned to true. At last, the number of non-generator obtained by
i maximal non-generators
is returned.
Algorithm 1: Maximal Non-generator-based Stability Calculation Algorithm. |
Input: A formal concept |
Output: Stability of concept C |
1 Initialize =0, = 0, = false |
2 begin |
3 MaxNonGen = C.lowerNeighbors |
4 N = |MaxNonGen| |
5 for (i = 1; i ≤ N; i++) do |
6 if == false then |
7 = + getINongenNum(MaxNonGen, i) |
8 else if == true && i%2 == 0 then |
9 = + |
10 else if flag == true && i%2 != 0 then |
11 = - |
12 end if |
13
end for |
14 |
15 return |
16 end |
Algorithm 2: getINongenNum Function. |
Input: M: The maximal non-generator objects of A |
i: The number of maximal non-generator objects to be intersected |
Output: : The number of non-generator obtained by i maximal non-generators
|
1 begin |
2 = 0 |
3 for, , do |
4 |
5 |
6 end for |
7 if == 0 then |
8 = true |
9 end if |
10 return |
11 end |