Implementation of the Apriori algorithm.