From: AAAI Technical Report WS-94-03. Compilation copyright © 1994, AAAI (www.aaai.org). All rights reserved. Efficient Algorithms for Discovering Association Rules Heikki Mannila Hannu Toivonen* A. Inkeri Verkamo University of Helsinki, Department of Computer Science P.O. Box 26 (Teollisuuskatu 23), FIN-00014 Helsinki, Finland e-marl: {mannila, htoivone, verkamo)@cs.helsinki.fi Abstract Associationrules are statementsof the form"for 90 %of the rowsof the relation, if the rowhas value 1 in the columnsin set W, then it has 1 also in columnB". Agrawal,Imielinski, and Swamiintroduced the problemof mining association rules fromlarge collections of data, and gave a methodbased on successivepasses over the database. Wegive an improved algorithm for the problem. The methodis based on careful combinatorial analysis of the information obtained in previous passes; this makesit possible to eliminate unnecessary candidate rules. Experimentson a university course enrollment database indicate that the methodoutperforms the previous one by a factor of 5. Wealso showthat sampling is in general a very efficient wayof finding such rules. Keywords:association rules, covering sets, algorithms, sampling. 1 Introduction Data mining (database mining, knowledgediscovery in databases) has recently been recognizedas a promisingnewfield in the intersection of databases, artificial intelligence, and machinelearning (see, e.g., [11]). The area can be loosely defined as finding interesting rules or exceptions from large collections of data. Recently, Agrawal, Imielinski, and Swamiintroduced a class of regularities, association rules, and gave an algorithm for finding such rules from a database with binary data [1]. An association rule is an expression W=~ B, where Wis a set of attributes and B a single attribute. The intuitive meaningof such a rule is that in the rows of the database where the attributes in Whave value true, also the attribute B tends to have value true. For instance, a rule might state that students taking courses CS101and CS120, often also take the course CS130.This sort of information can be used, e.g., in assigning classrooms for the courses. Applications of association rules include customer behavior * Onleave fromNokiaResearchCenter. KDD-94 AAAI-94 Workshop on Knowledge Discovery in Databases Page 181 analysis for examplein a supermarket or banking environment, and telecommunications alarm diagnosis and prediction. In this paper we study the properties of association rule discovery in relations. We give a newalgorithm for the problemthat outperformsthe methodin [1] by a factor of 5. Thealgorithm is based on the samebasic idea of repeated passes over the database as the methodin [1]. The difference is that our algorithm makescareful use of the combinatorial information obtained from previous passes and in this wayavoids considering manyunnecessary sets in the process of finding the association rules. Ourexperimentaldata consists of two databases, namely university course enrollment data and the fault management database of a switching network. The empirical results showa good, solid performance for our method. A sametype of improvementhas independently been suggested in [2]. Wealso study the theoretical properties of the problemof finding the association rules that hold in a relation. Wegive a probabilistic analysis of two aspects of the problem, showingthat samplingis an efficient wayof finding association rules, and that in random relations almostall association rules are small. Wealso give a simpleinformation-theoretic lower bound for finding one rule, and showthat an algorithm suggested by Lovelandin [7] in a different frameworkactually meetsthis lower bound. Therest of this paper is organizedas follows. Section 2 introduces the problemand the notations. Section 3 describes our algorithmfor finding association rules. Theanalysis of samplingis givenin Section 4. Empiricalresults and a comparisonto the results of [1] are given in Section 5. Section 6 is a short conclusion. AppendixA contains the probabilistic analyses of randomrelations and the lower boundresult. AppendixB gives an overview of the implementation. Werefer to [1] for references about related work. 2. Problem First we introduce somebasic concepts, using the formalism presented in [1]. Let R = {11, I2,..., I,~} be a set of attributes, also called items, over the binary domain{0, 1}. The input r = {tl,... ,t,~} for the data miningmethodis a relation over the relation schema{I1, I2,..., Ira}, i.e., a set of binary vectors of size rn. Eachrowcan be considered as a set of propertiesor items(that is, t[i] = 1 ¢, I~ E t). Let WC_R be a set of attributes and t E r a rowof the relation. If t[A] = 1 for all A E W, we write t[W] = i. Anassociation rule over r is an expression W=~ B, where WC_. R and B E R \ W. Given real numbers7 (confidence threshold) and a (support threshold), wesay that r satisfies W=~ B with respect to 7 and a, if I{ilt,[wB]= i}l _>an and I{ilti[wB] = i}t > I{i l t,[w]=i}l - That is, at least a fraction a of the rowsof r havel’s in all the attributes of WB,and at least a fraction -y of the rowshaving a 1 in all attributes of Walso have a 1 in B. Given Page 182 AAAI.94 Workshopon Knowledge Discovery in Databases KDD-94 a set of attributes X, we say that X is coveringa (with respect to the database and the given support threshold a), if That is, at least a fraction a of the rows in the relation have l’s in all the attributes of X. As an example, suppose support threshold a = 0:3 and confidence threshold 7 = 0.9, and consider the example database ABCD, ABEFG, ABHIJ, BK. Now,three of four rows contain the set { AB}, so the support is I{i I ti[AB] = i } I/4 - 0.75; supports of A, B, and C are 0.75, 1, and 0.25, correspondingly. Thus, {A}, {B}, and {AB} have supports larger than the threshold a = 0.3 and are covering, but {C} is not. Further on, the database satisfies {A}=~ B, as {AB} is covering, and the confidence 0.7s 0.75 is larger than 7 = 0.9. The database does not satisfy {B} =~ A because the confidence 0.75 is less than the threshold 7. 1 The coverage is monotonewith respect to contraction of the set: if X is covering and B C X, then ti[B] = i for any i E {i I ti[X] = i}, and therefore B is also covering. On the other hand, association rules do not have monotonicity properties with respect to expansion or contraction of the left-hand side: if W=~ B holds, then WA=~ B does not necessarily hold, and if WA=t, B holds, then W=~ B does not necessarily hold. In the first case the rule WA=~ B does not necessarily have sufficient support, and in the second case the rule W=~ B does not necessarily hold with sufficient confidence. 3. Finding association rules 3.1 Basicalgorithm The approach in [1] to finding association rules is to first find all covering attribute sets X, and then separately test whether the rule X \ {B} =~ B holds with sufficient confidence. 2 Wefollow this approach and concentrate on the algorithms that search for covering subsets. To knowif a subset X _ R is not covering, one has to read at least a fraction 1 - a of the rows of the relation, that is, for small values of support threshold a almost all of the relation has to be considered. During one pass through the database we can, of course, check for several subsets whether they are covering or not. If the database is large, it is important to make as few passes over the data as possible. The extreme method would be to do just one pass and check for each of the 2m subsets of R whether they are covering or not. This is infeasible for all but the smallest values of m. 1Agrawalet al. use the term large [1]. sit is easy to see that this approach is in a sense optimal: the problem of finding of R can be reduced to the problem of finding all association rules that hold with Namely, if we are given a relation r, we can find the covering sets by adding an all l’s to r and then finding the association rules that have B on the right-hand certainty 1. KDD-94 AAAI-94 Workshop on Knowledge Discovery in Databases all covering subsets a given confidence. extra column B with side and hold with Page 183 The method of [1] makes multiple passes over the database. During a database pass, new candidates for covering sets are generated, and support information is collected to evaluate which of the candidates actually are covering. The candidates are derived from the database tuples by extending previously found covering sets in the frontier. For each database pass, the frontier consists of those covering sets that have not yet been extended. Each set in the frontier is extended up to the point where the extension is no longer expected to be covering. If such a candidate unexpectedly turns but to be covering, it is included in the frontier for the next database pass. The expected support required for this decision is derived from the frequency information of the items of the set. Originally the frontier contains only the empty set. An essential property of the method of [1] is that both candidate generation and evaluation are performed during the database pass. The method of [1] further uses two techniques to prune the candidate space during the database pass. These are briefly described in Appendix B. Wetake a slightly different approach. Our methodtries to use all available information from previous passes to prune candidate sets between the database passes; the passes are kept as simple as possible. The methodis as follows. Weproduce a set Ls as the collection of all covering sets of size 8. The collection Cs+l will contain the candidates for Ls+l: those sets of size s + 1 that can possibly be in L~+I, given the covering sets of L,. 1. 2. 3. 4. 5. 6. 7.. C1 :- {{A} I A E R}; 8 := 1; while C~ ~ 0 do database pass: let L~ be the elements of Cs that are covering; candidate generation: compute C~+1from L~; s := s + 1; od; The implementation of the database pass on line 4 is simple: one just uses a counter for each element of C,. In candidate generation we have to compute a collection Cs+l that is certain to include all possible elements of L~+I, but which does not contain any unnecessary elements. The crucial observation is the following. Recall that L~ denotes the collection of all covering subsets X of R with IXI = s. If Y ¯ L~+~and e :> 0, then Y includes (8 +8 e’) sets from Ls. This claim follows immediately from the fact that all \ / subsets of a covering set are covering. The same observation has been madeindependently in [2]. Despite its triviality, this observation is powerful. For example, if we knowthat :L2 = {AB, BC, AC, AE, BE, AF, CG}, we can conclude that ABC and ABE are the only possible membersof L3, since they are the only sets of size 3 whoseall subsets of size 2 are included in L2. This further means that L4 must be empty. In particular, if X ¯ L,+I, then X must contain s + 1 sets from L~. Thus a specification for the computationof C~+1is to take all sets with this property: G÷I= Page184 {x R I lxl = s + 1 and X includes 8 + 1 members of L,} AAAI.94Workshopon KnowledgeDiscoveryin Databases (1) KDD-94 This is, in fact, the smallest possible candidate collection C~+Iin general. For any La, there are relations such that the collection of covering sets of size s is La, and the 3collection of coverings sets of size s + 1 is C8+1,as specified above. The computationof the collection Cs+l so that (1) holds is an interesting combinatorial problem. A trivial solution would be to inspect all Subsets of size s + 1, but this is obviously wasteful. Onepossibility is the following. First computea collection C~’+1by forming pairwise unions of such covering sets of size 8 that have all but one attribute in common: C~+1= {XUX’]X,X’ EL~,]XF’IX’]=s--1}. Then C,+1 c C~’+1, and Cs+l can be computed by checking for each set in C~’+1 whether the defining condition of C~+1holds. The time complexity is further, [C’+1[ - O([L~I2), but this bound is very rough. Analternative method is to form unions of sets from L, and LI: C"+x= {X U X’ ] X E L.,X’E L,,X’ g X}, and then compute C,+1 by checking the inclusion condition. (Note that the work done in generating C~+1does not depend on the size of the database, but only on the size of the collection L,.) Instead of computing C,+1 from L~, one can compute several families C~+1,..., C,+~ for somee > 1 directly from L~. The computational complexity of the algorithms can be analyzed in terms of the quantities [L~[, ICal, [C~’I, and the size n of the database. The running time is linear in n ~nd exponential in the size of the largest covering set. For reasons of space we omit here the more detailed analysis. The database passes dominate the running time of the methods, and for very large values of n the algorithms can be quite slow. However,in the next section we shall see that by analyzing only small samples of the data~base we obtain a good approximation of the covering sets. 4 Analysis of sampling Wenowconsider the use of sampling in finding covering sets. Weshow that small samples are usually quite goodfor finding covering sets. Let r be the support of a given set X of attributes. Consider a random sample with replacement of size h from the relation. Then the number of rows in the sample that contain X is a randomvariable x distributed according to B(h,r), i.e., binomial distribution of h trials, each having success probability r. The Chernoff bounds [3, 6] state that for all a we have -2"2/h. Pr[x > hr + a] < e SResults on the possible relative sizes of Ls and Cs+l can be found in [4]. KDD-94 AAAI-94 Workshop on Knowledge Discovery in Databases Page 185 That is, the probability that the estimated support is off by at least a is Pr[x > h(r + a)] e- 2~*h*/h= e-2~2h, i.e., boundedby a quantity exponential in h. For example, if a = 0.02, then for h = 3000 the probability is e-2"4 ~ 0.09. (Similar results could be even more easily obtained by using the standard normal approximation.) This meansthat sampling is a powerful wayof finding association rules. Evenfor fairly low values of support threshold a, a sample consisting of 3000 rows gives an extremely good approximation of the coverage of an attribute set. Therefore algorithms working in main memoryare quite useful for the problem of finding association rules. Appendix A contains an analysis of covering sets in random relations and a lower boundresult for the problemof finding association rules. 5 Experiments To evaluate the efficiency of our methods, we compare the original algorithm in [1] to our algorithm. Candidate generation is performed by extending sets in L, with other sets in L~ to achieve (at most) e-extensions. Wecompare a less aggressive extending strategy with e = 1 and a more aggressive strategy with e = s, where the size of the candidate sets is doubled during each iteration step. (Werefer to our algorithm as offline candidate determination; the variants are noted in the following as OCD1 and OCD,.) In addition to the original algorithm of [1] (noted in the following by AISoris), we also implementeda minor modification of it that refrains from extending any set with an item that is not a covering set by itself (noted in the following by AISmod). Details about the implementations can be found in Appendix B. 5.1 Data Wehave used two datasets to evaluate the algorithms. The first is a course enrollment database, including registration information of 4734 students (one tuple per student). Each row contains the courses that a student has registered for, with a total of 127 possible courses. Onthe average, each row contains 4 courses. A simplified version of the database includes only the students with at least 2 courses (to be interesting for generating rules); this database consists of 2836 tuples, with an average of 6.5 items per tuple. The figures and tables in this paper represent this latter course enrollment data. The second database is a telephone companyfault managementdatabase, containing some 30,000 records of switching network notifications. The total numberof attributes is 210. The database is basically a string of events, and we mapit to relational form by considering it in terms of overlapping windows. The experiments on this data support the conclusions achieved with the course database. The database sizes we have used are representative for sampling which would result in very good approximations, as was concluded in Section 4. "Page 186 AAAI-94 Workshop on Knowledge Discovery in Databases KDD-94 Size 1 2 3 4 5 6 7 0.40 0.20 2 11 10 4 1 2 26 0.18 13 17 5 1 36 Support a 0.16 0.14 0.12 0.10 0.08 14 14 14 16 18 53 68 79 26 35 12 22 52 102 192 1 5 19 69 171 1 19 76 1 29 3 53 76 139 275 568 Table h Numberof covering sets. count Maxsize Support a 0.40 0.20 0.18 0.16 0.14 0.12 0.10 0.08 0 26 30 48 81 196 544 1426 0 4 4 4 4 5 6 7 Table 2: Numberand maximal size of rules (7 = 0.7). 5.2 Results Each algorithm finds, of course, the same covering sets and the same rules. The number of covering sets found with different support thresholds is presented in Table 1. Corresp?ndingly, the numberof association rules is presented in Table 2; we used a confidence threshold 7 of 0.7 during all the experiments. The tables show that the numberof covering sets (and rules) increases very fast with a decreasing support threshold. Figure la presents the total time (in seconds) as a function of the inverse of the support threshold a; we prefer to use the inverse of a since it corresponds to the commonsense idea of the "rarity" of the items. Figure la shows clearly that OCDis much more time efficient than AIS. The time requirement of OCDis typically 10-20 % of the time requirement of AIS, and the advantage of OCDincreases as we lower a. However, the difference between the algorithms is notable even with a large a. The difference between the two variants of OCDis not large, and the modification we implementedin AIS did not affect its performance significantly. Whenwe look at the total time as a function of ILl, the numberof covering sets (presented in Figure lb), we observe that both algorithms behave more or less linearly with respect to ILl, but the time requirements of OCDincrease muchmore slowly. As an abstract measure of the amount of database processing we examine the effective volume of the candidates, denoted by V,,. It is the total volume of candidates that are evaluated, weighted by the numberof database tuples that must be examined to evaluate them. This measure is representative of the amount of processing needed during the database passes, independent of implementation details. KDD-94 AAAI-94 Workshop on Knowledge Discovery in Databases Page 187 ~ 6000 I I I I 0 I 5000 4000 I I i ,,, ,’*’ - O0 Tim? 3000 2000 i000 Tin~o0 t 2000~ 1000 /0 I 6000 5000 2 4 6 8 I0 12 Inverse o~:)upport (7 14 0o ,,q~l _ i ’ I I I I 100 200 300 400 500 Number of covering sets 600 (b) Figure 1: Total time in seconds (a) as a function of the inverse of support and (b) function of the number of covering sets. 6000 ...... 6000 AI~ 5000 4000 V~. 3000 5000 4000 V~. 3000 2000 2000 I000 1000 0 2 4 6 8 10 12 Inverse of support (7 14 0o (a) i i ..’".... i i i .*"" OCD1 100 200 300 400 500 Numberof covering sets 600 (b) Figure 2: Effective volume of candidates (a) as a function of the inverse of support and (b) as a function of the number of covering sets. The principal reason for the performance difference of AIS and OCDcan be seen in Figures 2a and b. They present the behavior of V,, as the support threshold (7 decreases and ILl, the number of covering sets, increases. The number of candidate sets (and their volume) considered by OCDis always smaller than that of AIS and the difference increases as more sets are found. These figures also explain why the more aggressively extending variant OCD. does not perform better than the basic OCD,: even though a more aggressive strategy can reduce the number of passes, it also results in so many more candidates that the reduction in time is offset. Table 3 presents the number of candidates considered by each method. The numbers for AIS are much higher, as it may generate the same candidates over and over again during the database pass. On the other hand, OCDonly generates any candidate once (during the generation time) and checks that its subsets are covering before evaluating it against the database. While the number of potential candidates generated by OCDis much smaller than that for AIS, still fewer candidates need to be evaluated during the database pass. If sampling is not used or the samples are large, the data does not remain in the Page 188 AAAI-94 Workshop on Knowledge Discovery in Databases KDD-94 Support a 0.40 0.20 0.18 0.16 0.14 0.12 0.10 0.08 242 OCD1 128 196 289 362 552 950 1756 OCD, 128 217 300 434 625. 1084 1799 4137 8517 37320 42175 48304 52415 65199 95537 118369’ AISorls AIS,,od 9106 38068 42983 48708 53359 66704 96992 120749 Table 3: Generated candidates. 100o t t i ¯ 800 600 4OO 200 0 0 1 2 3 4 5 Iteration pass 6 Figure 3: Effective volumeof candidates during each iteration pass. main memorybetween passes, but it has to be reloaded for each pass. Thus it would be important to minimize the numberof data passes. Also, if we want to overlap the database reads and the processing, the amount of processing performed during each database pass should be small. Figure 3 presents a typical profile of V~ during the passes of one run (with a = 0.1). While the area beneath the curve corresponds to the total volume, the height of the curve at each point describes how muchprocessing is needed during that pass. High peaks correspond to passes where the overlapping of I/O and processing may be endangered if the database is large. Since the confidence threshold 9’ affects only the numberof rules generated from the covering sets, we have not varied it in our experiments. Onthe other hand, suitable values for the support threshold a depend very muchon the database. 6 Concluding remarks Association rules are a simple and natural class of database regularities, useful in various analysis or prediction tasks. Wehave considered the problem of finding the association rules that hold in a given relation. Following the workof [1], we have given an algorithm that uses all existing information between database passes to avoid checking the coverage of redundant sets. The algorithm gives clear empirical improvement when compared against the previous results, and it is simple to implement. See also [2] for similar resuits. The algorithm can be extended to handle nonbinary attributes by introducing new KDD-94 A,4AI-94 Workshop on Knowledge Discovery in Databases Page 189 indicator variables and using their special properties in the candidate generation process. Wehave also analyzed the theoretical properties of the problemof finding association rules. Weshowedthat sampling is an efficient technique for finding rules of this type, and that algorithms working in main memorycan give extremely good approximations. In Appendix A we give some additional theoretical results: Wealso give a simple lower bound for a special case of the problem, and note that an algorithm from the different framework of [7] actually matches this bound. Wehave considered finding association rules from sequential data in [8]. Several problems remain open. Someof the pruning ideas in [1] are probably quite useful in certain situations; recognizing whento use such methodswould help in practice. Analgorithmic problem is howto find out as efficiently as possible what candidate sets occur in a given database row. Currently we simply check each candidate separately, i.e., if AB and AC are two candidates, the A entry of each row is checked twice. On certain stages of the search the candidates are heavily overlapping, and it could be useful to utilize this information. A general problem in data mining is how to choose the interesting rules amongthe large collection of all rules. The use of support and confidence thresholds is one way of pruning uninteresting rules, but some other methods are still needed. In the course enrollment database manyof the discovered rules correspond to normal process in the studies. This could be eliminated by considering a partial ordering amongcourses and by saying that a rule W=~ B is not interesting if B is greater than all elements of Wwith respect to this ordering. References [1] R. Agrawal, T. Imielinski, and A. Swami. Mining association rules between sets of ¯ items in large databases. In Proceedings of the 1993 International Conference on Management of Data (SIGMOD93), pages 207 - 216, May 1993. [2]R. Agrawal and R. Srikant. Fast algorithms for mining association rules in large databases. In VLDB’94, Sept. 1994. [3] N. Alon and J. It. Spencer. The Probabilistic 1992. Method. John Wiley Inc., NewYork, [4] B. Bollob~. Combinatorics. Cambridge University Press, Cambridge, 1986. [5] M. Ellis and B. Stroustrup. 1990. The Annotated C++Reference Manual. Addison-Wesley, [6] T. Hagerup and C. Rfib. A guided tour of Chernoff bounds. Information Processing Letters, 33:305-308, 1989/90. [7] D. W. Loveland. Finding critical sets. Journal of Algorithms, 8:362 - 371, 1987. [8] H. Mannila, H. Toivonen, and A. I. Verkamo.Association rules in sequential data. Manuscript, 1994. Page 190 AAAI-94 Workshop on Knowledge Discovery in Databases KDD-94 [9] K. Mehlhorn. Data Structures and Algorithms, Volumes 1-3. Springer-Verlag, Berlin, 1984. [10] S. Nhher. LEDAuser manual, version 3.0. Technical report, Max-Planck-Institut ffir Informatik, Im Stadtwald, D-6600Saarbrficken, 1992. [11] G. Piatetsky-Shapiro and W. J. Frawley, editors. KnowledgeDiscovery in Databases. AAAIPress / The MITPress, Menlo Park, CA, 1991. A Probabilistic analysis and a lower bound In this appendix, we present some results describing the theoretical properties problemof finding association rules. Wefirst first show that in one model of randomrelations all covering sets are Consider a randomrelation r = {tl,..., t,~} over attributes R - {I1,/2,..., Ira}; that each entry ti[Aj] of the relation is 1 with probability q and 0 with probability and assume that the entries are independent. Then the probability that ti[X] = i where h - IX[. The number x of such rows is distributed according to B(n, qh), can again use the Chernoff bounds to obtain of the small. assume 1 - q, is qh, and we Pr[x > an] = Pr[z > nqh + n(s - qh)] < e-2,~(,-qh)~. This is furthermore bounded by e-~n, if a > 2qh. (For a = 0.01 and q = 0.5, this means h > 8, and for a = 0.01 and q = 0.1 it meansh > 3.) Nowthe expected numberof covering sets of size h is bounded by mhe-~. This is less than 0.5, provided an > h In m + In 2. Thus a randomrelation typically has only very few covering sets. Of course, relations occurring in practice are not random. ..Next we describe some lower bound observations. Note first that a relation with one row consisting of all l’s satisfies all association rules. Thus the output of an algorithm that produces all association rules holding in a relation can be of exponential size in the numberof attributes in the relation. Wenowgive an information-theoretic lower bound for finding one association rule in a restricted model of computation. Weconsider a model of computation where the only way of getting information from relation r is by asking questions of the form "is the set X covering". This model is realistic in the case the relation r is large and stored using a database system, and the model is also quite close to the one underlying the design of the algorithm in [1]. Assumethe relation r has n attributes. In the worst case one needs at least log k log(n/k) questions of the form "is the set X covering" to locate one maximalcovering set, where k is the size of the covering set. The proof of this claim / isX simple. Consider relations with exactly 1 maximalcovering set of size k. There are (n/ different KDD-94 possible answers to the problem of finding the AAA1-94 Workshop on Knowledge Discovery in Databases Page 191 maximalcovering set. Each question of the form "is the set X covering" provides at most 1 bit of information. Loveland [7] has considered the problem of finding "critical sets". Given a function f : P(R) ~ {0,1} that is downwards monotone (i.e., if f(X) = 1 and Y C X, then f(Y) = 1), a set X is critical if f(X) = 1, but f(Z) = 0 for all supersets Z of X. Thus maximalcovering sets are critical sets of the function f(X) = 1, if X is covering, and f(X) = 0, otherwise. The lower bound above matches exactly the upper bound provided by one of Loveland’s algorithms. The lower bound above can easily be extended to the case where the task is to find k maximal covering sets. An interesting open problem is whether Loveland’s algorithm can be extended to meet the generalized lower bound. B Pruning methods and implementations The method of [1] uses two techniques to prune the candidate space during the database pass. In the "remaining tuples optimization", the occurrences of each frontier set are counted. A candidate is pruned by the optimization method, whenthere are less occurfences of the frontier set left than are needed for the candidate to be covering. Remember that the total numberof occurrences of a frontier set has been evaluated in earlier passes. In the "pruning function optimization", items are assigned weights based on their rarity, and tuples are assigned weights from their items with synthesized functions. This method prunes a candidate, if--based on its weight--it is so rare that it can not be covering. To knowthe weight threshold for each set in the frontier, for each candidate set that is not expected to be covering--and thus could be in the frontier in the next database pass--an highest total weights of database rows containing the set are maintained. The lowest of these values is then stored, and the weights of candidates are comparedagainst this weight threshold of the corresponding frontier set. The success of this method depends on’the distributional properties of items. The implementations of the algorithms have been kept reasonably straightforward. Attention was paid to the realization of the ideas rather than to optimizations of time or space. Wewrote the algorithms in C++ [5], and used data structures from LEDA library [10]. Implementations of both algorithms use the same basic data structures and algorithms for representing and manipulating sets of attributes. This ensures that timing comparisonsare fair. Attributes are represented by their namesas strings. Attribute sets axe implementedas sorted sequences of strings, and collections of attribute sets, i.e. Ci and Lj, as sorted sequences of attribute sets. The sorted sequences are implemented as (2,4)-trees [9]. The above mentioned pruning methods of [1] require additional data structures. "Remaining tuples optimization" only needs a counter for each frontier set, plus checking of the pruning condition when the support count for a candidate is being increased. For "pruning function optimization ~, the weights of items are stored in a randomizedsearch tree during the first database pass. The weight thresholds are stored in another randomized search tree each database pass, to be utilized in the next iteration. The candidates are pruned by this method as soon as they are created. Wehave not implemented any memorysaving techniques referred to in [1] that might decrease the precision of the pruning. Page 192 AAAI-94 Workshop on Knowledge Discovery in Databases KDD-94