An improvement of FP-Growth association rule mining algorithm based on adjacency table

Minghao Yin, Wenjie Wang, Yang Liu, Dan JiangMATEC 2018

Abstract

The FP-Growth algorithm is a popular association rule mining method based on the frequent pattern tree (FP-Tree), which avoids generating large candidate sets. However, it requires two scans of the transaction database and recursive mining, which can be inefficient, especially for dense datasets. This paper proposes an improved algorithm that utilizes an adjacency table stored in a hash table to streamline the process. By reducing database scans to one and optimizing lookup times, the improved algorithm significantly enhances performance and memory efficiency. Experimental results demonstrate its superiority, particularly in mining frequent itemsets from dense data.

Introduction: The Bottlenecks of FP-Growth

Association rule mining—identifying significant relationships between items in large datasets—is a fundamental task in data science. The FP-Growth algorithm has long been preferred over older methods like Apriori because it eliminates the need for candidate generation. However, FP-Growth faces three primary challenges:

  1. Multiple Database Scans: It must scan the entire transaction database twice to construct the FP-Tree.
  2. Memory Intensity: In dense datasets, where many items frequently co-occur, the FP-Tree can grow excessively large, consuming significant memory.
  3. Recursive Complexity: The recursive mining process required to extract rules from the tree is computationally expensive.

This research introduces a more efficient alternative that addresses these "Achilles' heels" by replacing the tree structure with a graph-inspired adjacency table.

Methods: Adjacency Tables and Hash Maps

The core innovation of this paper is the transition from a tree-based representation to a graph-based one. Instead of building a complex FP-Tree, the algorithm treats items as vertices in a graph.

Graph-Based Representation

When two items appear in the same transaction, an edge is established between them. The weight of this edge corresponds to their co-occurrence frequency. This relationship is stored in an Adjacency Table.

Graph-based representation and corresponding adjacency table structure.

Efficiency Gains

  • Single Database Scan: The proposed method only requires one pass through the database. As transactions are read, the adjacency table is updated in real-time.
  • Hash Table Optimization: To ensure rapid access, the adjacency table is implemented using a nested hash map structure (HashMap<String, HashMap<String, Integer>>). This allows for near-constant time lookups.
  • Elimination of Sorting: Standard FP-Growth requires sorting items by frequency before tree construction. This new approach skips that step, further reducing CPU overhead.

Experimental Setup

The authors evaluated the algorithm using two simulated transaction environments:

  • Sparse Dataset: Averaging 10 items per transaction, scaling up to 600,000 transactions to test handling of "wide but thin" data.
  • Dense Dataset: Averaging 23 items per transaction, scaling up to 300,000 transactions. This serves as a "torture test" due to the exponential growth of potential item combinations.

Key Results and Performance

The experimental results indicate a substantial performance advantage for the adjacency table approach.

Comparison of run time between standard FP-Growth and the improved algorithm as database size increases.
  • Sparse Data Performance: At 0.6 million transactions, standard FP-Growth required approximately 184 seconds, whereas the improved algorithm completed the task in just 33.5 seconds.
  • Dense Data Superiority: The gap widened in dense environments. At 0.3 million transactions, the improved algorithm was nearly 3.5 times faster than the original (~18s vs. ~65s).
  • Stability Under Low Support: As the "minimum support" threshold decreases, standard FP-Growth’s runtime typically spikes. The improved algorithm maintained a much flatter and more stable performance curve.

Conclusion and Future Work

By bypassing the recursive path discovery of FP-Trees and reducing I/O operations, the adjacency table method offers a significant leap in efficiency for association rule mining. While the current implementation is sequential, future work will focus on:

  • Parallelization: Adapting the adjacency table model for distributed environments like Spark or Flink.
  • Scalability: Investigating the memory "breaking point" for datasets with millions of unique items.
  • Real-World Application: Testing the algorithm on complex, non-simulated industrial datasets.

Summary updated

BibTeX
@inproceedings{yin2018improvement,
  author = {Minghao Yin and Wenjie Wang and Yang Liu and Dan Jiang},
  title = {{An improvement of FP-Growth association rule mining algorithm based on adjacency table}},
  booktitle = {MATEC},
  year = {2018},
  doi = {10.1051/matecconf/201818910012},
}
Figure