Box Elements in a Concept Lattice Attila K¨orei1 and S´andor Radeleczki2 1
Institute of Information Sciences, University of Miskolc, 3515 Miskolc-Egyetemv´ aros, Hungary,
[email protected] 2 Institute of Mathematics, University of Miskolc, 3515 Miskolc-Egyetemv´ aros, Hungary,
[email protected]
Abstract. The notion of the classification system is related to an application of Concept Lattices to one of the main problems in Cluster Analysis, namely, to classify some objects on the basis of their common attributes. They can be introduced as particular subsets of a complete lattice. It is known that the classification systems of a complete CJgenerated lattice can be reduced to the classification systems of a complete atomistic lattice, which is called the box lattice of L. Having started from a given row-reduced context (G, M, I) we construct the elements of the box lattice of the concept lattice B(G, M, I). We also study the classification systems of an atomistic complete lattice.
Keywords: Concept lattice, classification system, classification lattice, box lattice, classification tree, atomistic lattice.
2000 Mathematics Subject Classification: Primary 06B23; Secondary 0B05, 06B15.
1
Introduction
The problem discussed in this paper is originated in Group Technology. This engineering discipline exploits similarities between technological objects and classify them on the basis of their common attributes in order to reduce the overall manufacturing costs. The same problem, in a more general framework is also studied by Cluster Analysis. The classification can be carried out by means of concept lattices using the notion of the classification system (see [2]). We note that the dual of this notion was introduced first in the literature by R. Wille [6]. Although classification systems were defined in concept lattices, they can be introduced even in an arbitrary complete lattice (see [3] and [4]). The classification systems of a CJ-generated complete lattice L can be ordered in a natural 1
2
The first author was partially supported by Hungarian National Foundation for Scientific Research (Grant No. T046913). The second author was partially supported by Hungarian N. F. for Scientific Research (Grant No. T034137, T049433 and T046913) and by Istv´ an Sz´echenyi Grant.
way and form a complete lattice, called the classification lattice of the lattice L. This lattice Cls(L) can be considered as a generalization of a partition lattice. It was also proved in [4], that the classification lattice of any lattice L can be represented as a classification lattice of a complete atomistic lattice, called the box lattice of L. In this paper, having started from a given context (G, M, I), the box lattice of the concept lattice B(G, M, I) is constructed. The elements of this lattice are characterized in Section 4. The basic notions and results are presented in Section 2. In Section 3 some elementary properties of the classification systems of an atomistic complete lattice are emphasized. Finally, in Section 5 an algorithm generating the box lattice of a concept lattice B(G, M, I) in the case of a finite context (G, M, I) is presented.
2
Preliminaries
Let (G, M, I) be a formal context (with I j G × M ). It is well-known that the complete lattice B(G, M, I) consists of the pairs (A, B) with A ⊆ B, B ⊆ A, A0 = B, B 0 = A. Clearly, for a set A j G the pair (A, A0 ) is a formal concept of the context (G, M, I) if and only if A = A00 . In this case A T is called a concept extent of G. Let Q be a subset of the power-set P(G). If Ak ∈ k∈K
Q holds for any system Ak ∈ Q, k ∈ K (K 6= ∅) and G ∈ Q, then (G, Q) is called a closure system on G. The family of the concept extents of the context (G, M, I) is denoted by Ext(G, M, I) and forms a closure system (G, Ext(G, M, I)). Moreover, the complete lattice (Ext(G, M, I), j) is isomorphic to the concept lattice B(G, M, I). 00 0 W Defining the concept γ(g) = ({g} , {g} ) for any g ∈ G, we obtain (A, B) = γ(g), for any concept (A, B) ∈ B(G, M, I) (see [1]). A nonzero element p g∈A
of a lattice L is called completely W join-irreducible if for any system of elements xi ∈ L, i ∈ I the equality p = {xi | i ∈ I} implies p = xi0 for some i0 ∈ I. If any nonzero element of L is a join of completely join-irreducible elements, then L is called a CJ-generated lattice. A context (G, M, I) is called row-reduced if every γ(g), g ∈ G is completely join-irreducible (see [1], Section 1.2, Definition 24). Therefore the concept lattice of a row-reduced context is a CJ-generated lattice. In this case the 0 element of the lattice B(G, M, I) is the concept (∅, M ). An extent partition of the elements of G means a partition π = {Gj | j ∈ J} of G, where any block Gj of π is characterized by the common attributes of its objects, i.e. where G00j = Gj , for all j ∈ J. In this case any aj = (Gj , G0j ) is a concept of (G, M, I), i.e. aj ∈ B(G, M, I). Definition 2.1. Let L be a complete lattice. A set S = {aj | j ∈ J}, J 6= ∅ of nonzero elements of L is called a classification system of L if the following conditions are satisfied: (1) ai ∧ aW j = 0, for all i 6= j, (2) x= (x ∧ aj ), for all x ∈ L. j∈J
If S = {1}, then we say that the classification system S is trivial. The above definition was motivated by the following result of [4]: Theorem 2.2.[4; Theorem 2.3] If (G, M, I) is a row-reduced context, then to any extent partition π = {Gj | j ∈ J} of the elements of G corresponds a classification system aj = (Gj , G0j ), j ∈ J of the lattice B(G, M, I). Conversely, any classification system of the lattice B(G, M, I) induces an extent partition of the elements of G. Let L be a CJ-generated complete lattice. The set of all completely joinirreducible elements W of L is denoted by J(L). For W a ∈ L let J(a) = {p ∈ J(L) | p ≤ a} and set ∅ = 0. Then obviously, a = J(a). If every p ∈ J(L) is an atom in L, then L is called atomistic. In [4] it was proved that any classification system S = {ai | i ∈ I} of a CJ-generated lattice L is determined by the partition πS = {J(ai ), i ∈ I}, induced by S on J(L). Definition 2.3. Let L be a CJ-generated complete lattice and let S1 and S2 be two classification systems of L. We say that the system S1 is finer than S2 and we write S1 ≤ S2 , if the partition πS1 induced by S1 refines the partition πS2 induced by S2 , i.e. if πS1 5 πS2 . Let Cls(L) denote the set of all classification systems of the above lattice L. It is easy to see that ≤ is a partial order on Cls(L) and, in view of the definition, S1 ≤ S2 (for S1 , S2 ∈ Cls(L)) implies that for any a ∈ S1 there exists an element b ∈ S2 such that a 5 b. If (G, M, I) is a row-reduced context and S1 = {(Aj , A0j ) | j ∈ J}, S2 = {(Bj , Bj0 ) | j ∈ J} are classification systems in the lattice B(G, M, I) then, in view of [4], S1 ≤ S2 ⇔ the partition π1 = {Aj | j ∈ J} refines the partition π2 = {Bk | k ∈ K}. In [4] is also proved the following Theorem 2.4. [4, Theorem 4.2] If L is a CJ-generated complete lattice, then (Cls(L), ≤) is a complete lattice. The lattice Cls(L) is called the classification lattice of the lattice L. Notice that theV0-element of the lattice Cls(L), i.e. the finest classification system of L, is S0 = {S | S ∈Cls(L)}. The 0 of a complete lattice L and any element of a classification system of L is called a box element of L. The set of the box elements of L is denoted by Box(L) and let (Box(L), 5) stand for the partially ordered set obtained by restricting the partial order of L to Box(L). In [4] it was established the following Theorem 2.5. [4, Theorem 4.5] If L is a CJ-generated complete lattice, then (Box(L), ≤) is an atomistic complete lattice whose atoms are the elements of the finest classification system S0 of L. Remark 2.6. In [4] it was shown that the 0-element and the meet operation coincide in L and in Box(L). Moreover, denoting by t the join operation in
Box(L), it was also proved that for any system bk ∈Box(L), k ∈ K, F bk .
W
bk 5
k∈K
k∈K
It is not hard to observe that the classification systems of the lattices L and Box(L) are the same. From this we can deduce the following Theorem 2.7. [4; Theorem 4.7.] For any CJ-generated complete lattice L we have Cls(L) =Cls(Box(L)). Now as a consequence of the former two results we obtain that any classification lattice can be represented as the classification lattice of an atomistic complete lattice. In view of Theorem 2.7 it is also clear, that the properties of the classification lattice of L are determined by the properties of its box lattice Box(L). For instance, if Box(L) satisfies the local Birkhoff condition (see [5]), i.e. for any atoms a, b ∈ Box(L) we have a, b ≺ a ∨ b in Box(L), then Cls(L) is an atomistic (complete) lattice; if Box(L) is a Boolean lattice, then Cls(L) is isomorphic to a partition lattice [4]. This is satisfied, for instance, for any complete CJ-generated pseudocomplemented lattice L. In [4] it was also proved that any partition lattice is isomorphic to the classification lattice of an atomistic complete Boolean lattice.
3
Classification systems in atomistic complete lattices
Our starting point is the following result of [4]: Proposition 3.1. If L is an atomistic complete lattice then its box lattice Box(L) coincides with L and the system A(L) of all atoms of L is the finest classification system S0 of L. Let L be an atomistic complete lattice and denote by A(L) the set of its atoms. For an x ∈ L let A(x) = {a ∈ A(L) | a ≤ x}. Then for any x, y ∈ L, x 5 y ⇔ A(x) j A(y). Definition 3.2. Let L be a lattice with 0. A set O = {bi | i ∈ I}, I 6= ∅ of nonzero elements of L is called an orthogonal system, if ai ∧ aj = 0, for all i 6= j. O is a maximal orthogonal system, if there is no orthogonal system O0 containing O as a proper subset. The following proposition illustrates why is easy to handle the classification systems of an atomistic lattice. Proposition 3.3. Let L be an atomistic complete lattice and S = {ai | i ∈ I}, I 6= ∅ a set of nonzero elements of L. Then the following conditions are equivalent: (i) S is a classification system in L.
(ii) S is an orthogonal system and for any a ∈ A(L) there exists an element b ∈ S such that a 5 b. (iii) S is a maximal orthogonal system. Proof. (i)⇒(iii). In view of Definition 2.1 any classification system is an orthogonal system. Assume by contradiction that S is not a maximal orthogonal system, i.e. that there exists an orthogonal system S 0 such that S j S 0 and S = S 0 . Then there is an element b ∈ S 0 such that b ∈ / S. As {ai | i W ∈ I} j S 0 we get ai ∧ b = 0, for all i ∈ I. Now using relation (2) we obtain b = (b ∧ ai ) = 0, a contradiction. i∈I
(iii)⇒(ii). Let S = {ai | i ∈ I} be a maximal orthogonal system and a ∈ A(L). As S 0 = S ∪ {a} can not be an orthogonal system, we get a ∧ ak 6= 0, for some k ∈ I, and this implies a 5 ak . (ii)⇒(i). Let S = {ai | i ∈ I} be an orthogonal system which satisfies the W condition (ii). We have to prove only x = (x ∧ ai ), for any x ∈ L. As for any i∈I
a ∈ A(x) there exists a k ∈ I such that a 5 x ∧ ak , we get A(x) j by assumption S W W A(x ∧ ai ) j A (x ∧ ai ) . However this inclusion implies x 5 (x ∧ ai ). i∈I i∈I i∈I W W Since x = (x ∧ ai ), we obtain x = (x ∧ ai ), for any x ∈ L. i∈I
i∈I
Now by using Theorem 2.7. we obtain Corollary 3.4. Let L be a CJ-generated complete lattice. A set S = {ai | i ∈ I} j L, I 6= ∅ is a classification system of L if and only if it is a maximal orthogonal system in the lattice Box(L). Notice, that in Group Technology applications we need not only classification systems, but a chain {1} > S1 > S2 > ... > S0 of more and more finer classifications. It is easy to see that the elements of this classifications form a directed tree. Definition 3.5. Let L be a complete CJ-generated lattice. A set H j L is called a classification tree if 1 ∈ H and there exists a chain {SλS| λ ∈ Λ} of some classification systems of L containing S0 and satisfying H = Sλ . λ∈Λ
Proposition 3.6. Let H be a subset of a finite lattice L such that A( Box(L)) j H and 1 ∈ H. Then H is a classification tree in L if and only if H j Box(L)\{0} and for any a, b ∈ H one of the relations a ∧ b = 0, a 5 b, b 5 a holds. Proof. Clearly, any finite lattice L is complete and CJ-generated. S Let {Sλ | λ ∈ Λ} be a chain of some classification systems of L with 1 ∈ H = Sλ . As the λ∈Λ
elements of each Sλ , λ ∈ Λ belong to Box(L) \ {0}, we get H j Box(L) \ {0}. Take a, b ∈ H. Then there exists α, β ∈ Λ such that a ∈ Sα and b ∈ Sβ . Since {Sλ | λ ∈ Λ} is a chain, without lost of generality we can assume Sα ≤ Sβ . Hence
there exists an element c ∈ Sβ with a 5 c. Suppose a ∧ b 6= 0. Then c ∧ b 6= 0 and b, c ∈ Sβ imply b = c, because Sβ is a classification system. Thus we obtain a 5 b. Conversely, assume that H satisfies the conditions of the “only if ” part. As the poset (H \ {1}, 5) is finite and nonempty, for each h ∈ H there exists a max(1) imal element m of H \ {1} such that h 5 m. Let mi ∈ H \ {1}, i ∈ I (1) denote the maximal elements of this poset. Since these elements are incomparable, we (1) get mi ∧ mj = 0 for all i 6= j. Hence S1 = {mi | i ∈ I (1) } is an orthogonal system in Box (L). As the atoms of Box(L) belong to H, for any a ∈ A( Box(L)) (1) (1) there is an element mi ∈ S1 such that a 5 mi . Hence, in view of Proposition 3.3 and Corollary 3.4, S1 j H is a classification system of L. Further, take the set H1 = (H\S1 )∪A( Box(L)). Then 1 ∈ H1 j Box(L)\{0}, A( Box(L)) j H1 and for any a, b ∈ H one of the relations a ∧ b = 0, a 5 b, b 5 a holds. Therefore, in the case H 6= H1 we can apply again the previous argument, (2) constructing a classification system S2 = {mi | i ∈ I (2) } whose elements are the the maximal elements of the poset (H1 \{1}, 5) and a set H2 = (H1 \S2 )∪A( (2) (1) Box(L)). Clearly, for each i ∈ I (2) there exists a j ∈ I (1) such that mi 5 mj , whence we get S2 ≤ S1 . This construction can be repeated whenever Hk−1 6= Hk , obtaining a chain S1 ≥ ... > Sk ≥ ... of classification systems and a chain H = H0 ⊃ ... ⊃ Hk ⊃ ... of sets, such that Sk is the set of the maximal elements of (Hk−1 \ {1}, 5) and Hk = (Hk−1 \ Sk ) ∪ A( Box(L)). As H is a finite set, the chain H = H0 ⊃ ... ⊃ Hk ⊃ ... must be finite, and hence this process ends after finite steps with Hn−1 = Hn (n = 1). In this case Hn−1 = (Hn−1 \ Sn ) ∪ A( Box(L)) implies Sn j A( Box(L)). As by Proposition 3.3 both Sn and A( Box(L)) are maximal orthogonal systems in the lattice Box(L), we obtain Sn = A( Box(L)). Since Sn is the set of the maximal elements of Hn−1 \{1} which is a subset of Box(L)\{0}, we obtain Hn−1 \{1} = A( Box(L)), whence Hn−1 = {1}∪A( Box(L)) = {1}∪Sn . As Hk−1 = Sk ∪ Hk , for each 1 5 k < n, we get S1 ∪ ... ∪ Sn−1 ∪ Sn ∪ {1} = S1 ∪...∪Sn−1 ∪Hn−1 = ... = S1 ∪H1 = H0 = H, proving that H is a classification tree in L.
4
The box elements of a concept lattice
Let (G, M, I) be a row-reduced context and B(G, M, I) its concept lattice. The aim of this section to determine the box elements of the lattice B(G, M, I) in the case when B(G, M, I) is an algebraic lattice. First, we recall some additional notions: A closure system S (G, Q) is called algebraic if for any chain {Ak | k ∈ K} in (Q, j) we have Ak ∈ Q. k∈K
It is well-known, that the lattice (Q, j) of the closed sets of a closure system (G, Q) is an algebraic lattice if and only if (G, Q) is an algebraic closure system. As the concept extents of a context (G, M, I) form a closure system (G,Ext(G, M, I)) and the lattice (Ext(G, M, I), j) is isomorphic to B(G, M, I),
we obtain that B(G, M, I) is an algebraic lattice if and only if the join of any chain {Ck | k ∈ K} in (Ext(G, M, I) j) is also a concept extent of (G, M, I), 00 S S i.e. Ck = Ck . k∈K
k∈K
Now, we shall construct the extents corresponding to the atoms of the box lattice of B(G, M, I): Definition 4.1. For any x ∈ G let A0x := {x}00 and := Ak+1 x
S
Aky | Aky Rk Akx
00
, where
Rk denotes the transitive closure of a binary relation defined on the set {Akg | g ∈ G} as follows: Akx Rk Aky ⇔ Akx ∩ Aky 6= ∅ (for any x, y ∈ G). Finally, define Ax :=
∞ S
Akx .
k=0
, for all k = 0 and Ax = Lemma 4.2. We have Akx j Ak+1 x
∞ S
Akx , for any
k=p
integer p = 0. Rk is an equivalence relation on the set {Akg | g ∈ G} and Akx Rk Akz implies Ax = Az for any x, z ∈ G. is an immediate consequence of the definition. Proof. The inclusion Akx j Ak+1 x As A0x j A1x j ... j Apx j .... is an infinite ascending chain, we obtain Ax = ∞ ∞ S S Akx = Akx , for each p = 0. Since Rk is reflexive and symmetric by its k=0
k=p
definition for all k = 0, Rk is an equivalence. Now, assume that Akx Rk Akz , for some elements x, z ∈ G and for relation a k = 0. Since Rk is an equivalence on {Akg | g ∈ G}, we obtain Aky | Aky Rk Akx = Aky | Aky Rk Akz and hence Ak+1 = Ak+1 . According to the Definition 4.1, this equality implies Anx = Anz , x z ∞ ∞ S S for all n = k + 1, and hence we obtain Ax = Anx = Any = Ay . n=k+1
n=k+1
Theorem 4.3. If K = (G, M, I) is a row-reduced context and B(G, M, I) is an algebraic lattice, then the set S ∗ = {(Ax , A0x ) | x ∈ G} is the finest classification system of the lattice B(G, M, I). Proof. First we prove that S ∗ is a classification system in B(G, M, I). For this purpose, in view of Theorem 2.2, it is enough to prove that {Ax , | x ∈ G} is a partition of G such that A00x = Ax . Clearly, for any x ∈ G and k = 0 Akx is a concept extent of the context K by its definition. Since A0x j A1x j ... j Akx j .... is an infinite chain of concept extents of (G, M, I) and since B(G, M, I) is an
algebraic lattice, we get that Ax =
∞ S
Akx is also a concept extent of (G, M, I).
k=0
As for each x ∈ G we have x ∈ {x}00 = A0x j Ax , we obtain ∪{Ax , | x ∈ G} = G. Now we show that the different elements of {Ax , | x ∈ G} are disjoint, that is Ax ∩ Ay = ∅, for any sets Ax 6= Ay : Assumeby contradiction exists an element g ∈ G with g ∈ Ax ∩Ay . ∞ that there ∞ ∞ S S l S k Then g ∈ Ax ∩ Ay = (Akx ∩ Aly ), and hence there exist some k=0
l=0
k,l=0
integers n, p = 0 such that g ∈ Anx ∩Apy . Without lost of generality we can assume n 5 p. Then g ∈ Anx ∩ Apy j Apx ∩ Apy and hence Apx Rk Apy . In view of Lemma 4.2, the latter relation implies Ax = Ay , a contradiction. Thus S ∗ = {(Ax , A0x ) | x ∈ G} is a classification system. Now let S = {(Bj , Bj0 ) | j ∈ J} be an arbitrary classification system in B(G, M, I). In order to prove S ∗ ≤ S we have to show only that the partition {Ax , | x ∈ G} of G is finer that the partition {Bj | j ∈ J}. We will prove by induction on the number k = 0 that for each x ∈ G there exists a j(x) ∈ J such that Akx j Bj(x) , S for all k = 0. Indeed, G = Bj implies that for each x ∈ G there exists a j(x) ∈ J such j∈J 00 = Bj(x) . Assume now that that x ∈ Bj(x) , whence we get A0x = {x}00 j Bj(x) n Ax j Bj(x) is true for all x ∈ G for some fixed n = 0, and take an element z ∈ G with Anx Rn Anz . Then, by the definition of Rn , must exist some elements y0 , y1 , ..., ym ∈ G such that x = y0 , z = ym and such that Anyi ∩ Anyi+1 6= ∅, for all 0 5 i 5 m − 1. As by induction hypothesis to each yi , 0 5 i 5 m − 1 corresponds an element j(yi ) ∈ J with Anyi j Bj(yi ) , we deduce Bj(yi ) ∩ Bj(yj+1 ) k Anyi ∩ Anyi+1 6= ∅, for all 0 5 i 5 m − 1. As {Bj | j ∈ J} is a partition on G we obtain Bj(x) = Bj(y0 ) = Bj(y1 ) = ... = Bj(ym ) = Bj(z) . Hence, Anz j Bj(z) = Bj(x) , and 00 S n 00 = Az | Anz Rn Anx this result implies An+1 j Bj(x) j Bj(x) for all x ∈ G. x k Thus it follows by induction that Ax j Bj(x) , for each x ∈ G and k ≥ 0. ∞ S As now Ax = Akx j Bj(x) , for all x ∈ G, the partition {Ax , | x ∈ G} is k=0
finer than {Bj | j ∈ J}, and this proves S ∗ ≤ S.
As a common consequence of Theorem, 4.3 and Theorem 2.5 we obtain Corollary 4.4. In the conditions of Theorem 4.3. the different concepts (Ax , A0x ), x ∈ G are exactly the atoms of the box lattice of the lattice B(G, M, I). Remark 4.5. If B(G, M, I) is a finite lattice, then for any x ∈ G the sequence A0x j A1x j ... j Akx j ... constructed in Definition 4.1 (and Lemma 4.2) is also n(x) finite, therefore, there exist a number n(x) = 0 such that Akx = Ax , for all ∞ S n(x) k = n(x). Now, using Lemma 4.2 we obtain Ax = Akx = Ax . Hence, in k=n(x)
view of Corollary 4.4 all the atoms of the lattice Box(B(G, M, I)) have the form n(x) n(x) (Ax , (Ax )0 ) with some suitable x ∈ G and n(x) = 0. Denote the height of the lattice B(G, M, I) by nB . Then we have obviously n(x) 5 nB , for all x ∈ G. However, this means that in the case when G and M are finite, the algorithm for the construction of the atoms of Box(B(G, M, I)) (determined by Definition 4.1) ends in finite steps. We note, that the above numbers n(x) depend also by the lattice-theoretical properties of B(G, M, I). For instance, it is implicit in [3] that in the case of a (finite) pseudocomplemented lattice B(G, M, I), we have n(x) = 1, for all x ∈ G. Let us observe also that the argument from the proof of Theorem 4.3 implies that for any y ∈ Ax we have Ay = Ax . Proposition 4.6. Let K = (G, M, I) be a row-reduced context such that B(G, M, I) is an algebraic lattice and let Ax , x ∈ G be the concept extents constructed in Definition 4.1. Then a concept (A, A0 ) of K is a box element of the lattice B(G, M, I) if and only if A = ∪{Ax | x ∈ A}. Proof. Let (A, A0 ) ∈ Box(B(G, M, I)) and take any element x ∈ A. Since x ∈ Ax ∩ A, we have (Ax , A0x ) ∧ (A, A0 ) 6= (∅, M ) = 0B , where 0B denotes the 0-element of Box(B(M, G, I)). As by the virtue of Corollary 4.4 the concept (Ax , A0x ) is an atom in the lattice Box(B(M, G, I)), we get (Ax , A0x ) 5 (A, A0 ), i.e. Ax j A. Hence ∪{Ax | x ∈ A} j A. As x ∈ Ax for all x ∈ A, we obtain A = ∪{Ax | x ∈ A}. Conversely, suppose A = ∪{Ax | x ∈ A}. As by Theorem 4.3 {Ax | x ∈ G} is a partition of the set G, it is obvious that π = {A} ∪ {Ax | x ∈ / A} = ∪{Ax | x ∈ A} ∪ {Ax | x ∈ / A} is also a partition of G. Since both A and both the sets Ax , x∈ / A are concept extents, we deduce that π is an extent partition of the elements / A} is a of G. Then, in virtue of Theorem 2.3, S = {(A, A0 )} ∪ {(Ax , A0x ) | x ∈ classification system of the lattice B(G, M, I) and hence (A, A0 ) is a box element of B(M, G, I). Remark 4.7. In view of Proposition 4.6, modifying the standard algorithm for the determination of the concepts of a context (G, M, I) (see [1, Section 2.1]), such that only the concepts (A, A0 ) with the property A = ∪{Ax | x ∈ A} are selected, we obtain an algorithm for the construction of the box lattice of B(G, M, I).
5
Algorithm for determining box elements
Based on the results presented in the previous chapter we give a possible implementation for determining the box elements of a concept lattice. First we generate the atoms of the box lattice and then using Proposition 4.6 the further box elements are obtained. In our approach the context is identified with a matrix, the sets of objects and attributes are represented by vectors and the operations mostly carried out by means of matrix operations.
5.1
Notations
Mn×k stands for the set of matrices of n × k type with integer entries. The j-th column vector of the matrix Q is denoted by qj , Qij is the i-th coordinate of qj , and vk means the k-th component of a vector v. Let K = (G, M, I) be a row-reduced context where B(G, M, I) is an algebraic lattice and the sets G and M are finite: G = {gi | i = 1, 2, ..., n} and M = {tj | j = 1, 2, ..., m}. In this case the context can be represented by a binary matrix K ∈ Mn×m where Kij = 1 if (gi, mj ) ∈ I and 0 otherwise. For describing the extents we use column vectors of 0, 1 entries: the vector a = T (a1 , a2 , ..., an ) corresponds to the set A j G with the coordinates ai = χA (gi ) i = 1, 2, ..., n where χA is the characteristic function of the set A. Similarly the sets of attributes are identified by row vectors: a set B j M is represented by the vector b = (χB (t1 ) , χB (t2 ) , ..., χB (tm )). 5.2
Determination of the common attributes and common objects
When constructing the sequence A0x j A1x j ... j Apx (see Section 4) we have to determine the set A00 for a given set A j G in every iteration. First we determine the common attributes for the objects of A, then we find the objects possessing all the attributes in A 0 . In our algorithm both steps are carried out by means of special functions which are called dca and dco (determination of common attributes and determination of common objects). The idea which has motivated the introduction of these functions is the following: let A j G be a set of objects and a is the column vector representing it. Observe that the k-th component of the product vector aT K shows that how many objects of A have the attribute mk . If this number equals card(A) the attribute mk is common for all objects belonging to A, which means mk ∈ A0 . Marking the components having this property by 1 and by 0 the others we obtain the vector representing the attribute set A 0 . Similarly, let B j M be a set of attributes and b is the vector representing it. The k-th component of the product vector KbT gives the number of attributes of B which are in relation with the object gk . If this number is equal to card(B) then gk ∈ B 0 . In this case putting 1 into the k-th position and 0 into other positions we get the binary vector representing B 0 . We define the functions dca and dco in a way that the sets A001 , A002 , ..., A00k according to some sets of objects A1 , A2 , ..., Ak can be determined at once. Instead of mathematical definition the function dca is given by its pseudo-code, where the parameters of the function are the matrices A ∈ Mn×k and K ∈ Mn×m and the result is A0 ∈ Mn×k . A0 =function dca (A, K) Q = AT K for i = 1 to k n P Aij. si = j=1
for i = 1 to k for j = 1 to m
return A0 .
if Qij = si then A0ij = 1 else A0ij = 0
The pseudo-code of the function dco can be described in a similar way. If A is the matrix which consists of the column vectors representing the object sets A1 , A2 , ..., Ak , then the lines of dca (A, K) represent the sets A01 , A02 , ..., A0k , and calculating the columns of the matrix dco (dca (A, K) , K) we obtain vectors representing the sets A001 , A002 , ..., A00k . 5.3
Determination of the atoms
We shall determine the atoms of the box lattice Box(L) using the idea suggested in Definition 4.1. For the sake of simplicity we do not generate the sets Ax for every x ∈ G, because many of these sets are the same. More precisely, at the 00 0 first we generate the sets Ax = {x} for all x ∈ G and after forming the sets S step 0 0 0 Ay | Ay R0 Ax we keep only one copy from every different union of objects. The remaining sets are denoted by A11 , A12 , ..., A1n(1) . Assume that after the k-th S k iteration we have the sets Ak1 , Ak2 , ..., Akn(k) and form the sets Aj | Akj Rk Aki for all 1 ≤ i ≤ n (k) . From these unions keeping only the different ones we obtain the sets Ak+1 , Ak+1 , ..., Ak+1 1 2 n(k+1) . In our algorithm the function disj joins the object sets having common objects and ensures that these unions are unique. The parameter of this function is a set of Mn×k representing k sets of objects and the result is a matrix representing disjoint sets of objects. The disjointness of two sets of object is examined by the scalar product of the vectors representing them and we form the union of sets by summing their vectors with the convention 1 + 1 = 1. The union is stored in the vector of greater index and the other vector is deleted. D =function disj (Q) for i = 1 to k for j = i + 1 to k if qi qj > 0 then qj = qi + qj else qi = 0 j := 1 for i = 1 to k if qi 6= 0 then Dj = qi , j = j + 1 return D. If A is the set of vectors representing the object sets A0x , then disj(A) is a matrix representing unions of objects which are disjoint and cover the set G but probably do not give a classification of it. In this case the process must be continued with forming the sets Di00 for every union Di of objects obtained from the previous iteration. The sets Di00 are not necessarily disjoint so we apply the function disj again. It is clear from Remark 4.5 that this process ends in finite steps, when two adjacent applications of disj yield the same result.
Now we give the procedure which generates the atoms of the box lattice originated from the context K ∈ Mn×m . In this pseudo-code A stores the result of the iterations, at first A is a unit matrix representing the n object separately. The matrix A0 saves the result of the previous iteration, at first it is filled by zeros. The process stops when the result of an iteration equals to the result of the previous one. A=function atom(K) A = En×n A0 = 0n×n while A0 6= A A0 = A A0 = dca(A, K) A00 = dco(A0 , K) 00 A =disj(A ) return A. At the end of the procedure the columns of the obtained matrix A represent the extents of the atoms. To see this, let us denote by Ai (1 ≤ i ≤ l) the sets corresponding to the column vectors ai of A. Since all these sets are closed and form a partition of G, the set S = {(Ai , A0i ) | 1 ≤ i ≤ l} is a classification system. We show that S is equal to the system of atoms S ∗ = {(Ax , A0x ) | x ∈ G}, as required. It follows from the algorithm that for each i ∈ {1, 2, ..., l} and any x ∈ Ai we have Ai j Ax , which implies S ≤ S ∗ . Since S ∗ is the finest classification system in B(G, M, I) we obtain S = S ∗ . 5.4
Determination of the box elements
In Proposition 4.6 we proved that the extent of any box element is the union of extents of atoms. It means that after determining the atoms of the box lattice we can select the further box elements in view of the concepts of the concept lattice. Further on, we show a modification of the standard algorithm for determination of the concepts (see [1, Section 2.1]), which algorithm generates only those concepts which are necessary for constructing the box lattice. The mentioned standard algorithm makes a list of the extents of all concepts belonging to (G, M, I) forming systematically the intersections of attribute extents. In our version a lot of these intersections are not entered into the list yielding a significant shortening of the procedure. Let Box(L) be the box lattice of the concept lattice B(G, M, I) and assume that M = {t1 , t2 , ..., tm }. Remember that A (Box(L)) denotes the set of all atoms of Box(L). If a ∈ A (Box(L)) then its extent is denoted by Ext(a) and is called an atomic extent. Let H be an arbitrary set of objects and define the set a (H) = {a ∈ A (Box(L)) | Ext (a) j H}. The set ae (H) = {Ext(a) | a ∈ a (H)} denotes the set of the atomic extents belonging to the set a (H) . The algorithm for determining the non-atomic box elements is the following: at the beginning our list contains only the extent G, then in the step i we form the set H = A ∩ t0i for each set A entered into the list in an earlier step. Contrary
to the original algorithm H is entered into the list if the following conditions hold: 1. a (H) consists of at least two elements. 2. There is no set G included in the list satisfying the equation a (H) = a (G) . The first condition excludes the extents containing only one or zero atomic extent. These extents can be deleted, because neither they nor the further intersections with them can not result greater concept than the atoms. The second condition assures that we have only one sample from those extents which contain the same atomic extents. This restriction does not mean that we lose any extent which is needed for constructing the box lattice. To see this, first we note that the equality a (H ∩ F ) = a (H) ∩ a (F ) holds for all H, F j G. Suppose that the extent H is already in the list, and for a set F, which follows in a later step, we have a (H) = a (F ) . Because of the second condition, F is not entered into the list. Deleting F from the list means that we can obtain neither of the intersections J ∩ F for those sets J which follow F. Despite of this, the system of atomic extents included in J ∩ F is not lost, since a (J ∩ F ) = a (J) ∩ a (F ) = a (J) ∩ a (H) = a (J ∩ H) and H is an element of the list. When the list is ready, we have to examine every element of it. If the extent H is the union of atomic extents, then the concept according to H is a box element. If H contains additional objects above the atomic extents we form the set A = ∪ ae (H) and test the condition A = A00 . If the equality holds, then (A, A0 ) is a concept and a box element at the same time. Figure 1 shows an example of the determination of the box elements based on the algorithms discussed in 5.2 - 5.4. Let K be the matrix representing a given context with six objects G = {g1 , g2 , g3 , g4 , g5 , g6 } and five attributes M = {m1 , m2 , m3 , m4 , m5 }. The extents of the atoms will appear as column vectors 00 of a matrix A. In the first iteration we determine the sets {gi } for every object gi ∈ G, i = 1, ..., 6.
11000 1 1 0 1 0 1 0 0 0 1 K= 0 0 1 0 1 1 0 0 1 1 01100
100000 1 1 0 0 0 0 0 0 1 0 0 0 K00 = 0 0 0 1 0 0 0 0 1 0 1 0 000001
1000 1 0 0 0 0 0 1 0 A= 0 1 0 0 0 0 1 0 0001
1000 1 0 0 0 0 0 1 0 D= 0 1 0 0 0 0 1 0 0001
11100 1 1 1 0 0 1 1 0 0 1 B= 1 0 0 1 1 1 1 0 0 1 10110
Fig. 1. Representing different steps of algorithms 5.2-5.4
We start from the unit matrix E because its i-th column represents the set {gi }. Forming dca (E, K) = K we obtain the set of the attributes for every object in G. Next we determine K00 = dco (dca (A, K) , K). The columns of K00 00 represent the sets {gi } . In matrix D the intersecting object sets are unified: D = 00 disj(K ). Since the result of the next iteration disj(dco (dca (D, K) , K)) = D, the process ends, yielding the set A containing all of the atomic extents: A = D. The obtained atoms are the following concepts: b1 = ({g1 , g2 }, {m1 , m2 }), b2 = ({g4 } , {m3 , m5 }) , b3 = ({g3 , g5 }, {m1 , m5 }), b4 = ({g6 } , {m2 , m3 }) . Using the algorithm described in this section the extents of the further box elements are determined and listed in matrix B. The non-atomic box elements are the following concepts: b5 = ({g1 , g2 , g3 , g5 }, {m1 }), b6 = ({g1 , g2 , g6 } , {m2 }) , b7 = ({g4 , g6 }, {m3 }), b8 = ({g3 , g4 , g5 } , {m5 }) , 1 = (G, ∅), (and of course 0 = (∅, M ).
Fig. 2. Box elements in a concept lattice (left) and the box lattice (right) Figure 2 shows the Hasse diagrams of the concept lattice B(G, M, I) and the box lattice Box(L), where (G, M, I) is represented by matrix K from the previous example. Remark 5.5. An other opportunity to determine the box elements in a more efficient way is using of faster algorithm for generating the concepts, for instance, we can apply the method based on the lectic order (see [1], Section 2.1, pages 66-68).
6
Conclusions
In this paper the box lattice of the concept lattice B(G, M, I) has been constructed. Using the box elements any classification system of B(G, M, I) can be generated. Based on the algorithm proposed in 5.2 - 5.4 we have elaborated a computer program which starts from a given context (G, M, I) and determines all of the box elements corresponding to the lattice B(G, M, I).
References 1. Ganter, B., Wille, R.: Formal Concept Analysis, Mathematical Foundations. Springer Verlag, Berlin Heidelberg New York (1999) 2. K¨ orei, A.: Solving Cell Formation Problems with Concept Lattices. Machine Engineering, Vol. 5 No. 3-4, (2005) 37-46 3. Radeleczki S.: Classification systems and the decomposition of a lattice into direct products. Mathematical Notes, Vol.1. No.1, (2000) 145-156 4. Radeleczki S.: Classification systems and their lattice. Discussiones Mathematicae, General Algebra and Applicationes 22 (2002) 167-181 5. Stern M.: Semimodular Lattices, Theory and Applications. Cambridge University Press (Cambridge, New York, Melbourne) (1999) 6. Wille R.: Subdirect decomposition of concept lattices. Algebra Universalis 17 (1983) 275-287