Abstract
The discovery of frequent sequential patterns in transaction databases is a fundamental task in data mining. As datasets grow in size and complexity, traditional breadth-first search algorithms face significant memory and computational bottlenecks. This paper presents SPAM (Sequential PAttern Mining), a novel algorithm that employs a vertical bitmap representation of the database and utilizes bitwise operations for rapid support counting. By traversing a lexicographic sequence tree in a depth-first manner, SPAM provides an online output of frequent sequences and achieves performance gains of up to an order of magnitude compared to state-of-the-art algorithms like SPADE and PrefixSpan.
Introduction
Sequential pattern mining is essential for analyzing time-ordered data, such as customer purchase histories or web clickstreams. The primary challenge is the exponential growth of the search space as sequence length increases. Previous approaches often relied on breadth-first searches, which require substantial memory for intermediate candidates, or complex data structures that make support counting—the process of verifying pattern frequency—a computational bottleneck. SPAM addresses these issues by prioritizing CPU efficiency and enabling "online" result generation.
Methodology
The SPAM algorithm is built upon three core technical pillars:
1. Lexicographic Sequence Tree
The search space is organized as a tree where each node represents a sequence. The algorithm explores this space using two types of expansions:
- S-step (Sequence-extension): Appending a new transaction containing a single item to the end of the current sequence.
- I-step (Itemset-extension): Adding an item to the final transaction of the current sequence.
2. Vertical Bitmap Representation and Bitwise Operations
Every item in the database is represented by a vertical bitmap, where each bit indicates the presence of the item in a specific transaction. This representation allows support counting to be performed using highly optimized bitwise AND operations. For S-steps, a transformation via a lookup table ensures that temporal constraints (items appearing after previous ones) are maintained.
3. Depth-First Search with Pruning
By employing a depth-first search (DFS) strategy, SPAM can identify and output long sequences immediately. It utilizes "Apriori" pruning to skip branches of the tree that cannot contain frequent sequences, significantly reducing the search space.
Experimental Evaluation
The researchers evaluated SPAM using synthetic datasets generated by the IBM AssocGen program. The datasets were varied across several parameters:
- D: Number of customers.
- C: Average transactions per customer.
- T: Average items per transaction.
- S/I: Average lengths of maximal sequences and transactions.
These variations allowed for testing the algorithm's performance across diverse scenarios, from high-volume customer data to complex, long-duration individual histories.
Key Results
SPAM demonstrates superior performance compared to SPADE and PrefixSpan, particularly as the minimum support threshold decreases.
As illustrated in the performance benchmarks, SPAM's bitwise approach leads to speedups of 10x or more on large datasets. The algorithm's efficiency is most pronounced when searching for long sequential patterns, where the bottleneck shifts from support counting to initial bitmap setup overhead.
Discussion and Limitations
While SPAM offers significant speed advantages, it involves a space-time tradeoff. The algorithm is memory-intensive, as it assumes the database can reside in RAM. It is estimated to be 5 to 20 times less space-efficient than SPADE. Future work may focus on bitmap compression techniques to mitigate these memory constraints and adapting the core search strategy for disk-resident data.
Conclusion
The SPAM algorithm represents a significant advancement in sequential pattern mining. By leveraging modern CPU optimizations for bitwise operations and a depth-first search strategy, it provides a high-performance, scalable solution for discovering frequent patterns in large-scale transaction databases.
Summary updated