NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

An Efficient Algorithm for Mining Frequent Sequence with Constraint Programming

John O. R. Aoga, Tias Guns, Pierre Schaus

Abstract

Sequential Pattern Mining (SPM) has traditionally faced a trade-off between the raw speed of specialized, hard-coded algorithms and the modular flexibility of Constraint Programming (CP). This paper introduces a novel approach that bridges this gap by integrating data mining optimizations—specifically "last-position lists"—with CP-native backtracking techniques like trailing. The resulting system, built around a new global constraint called PrefixProjection, offers the modularity of CP while outperforming state-of-the-art specialized systems in 84% of tested cases.

Introduction

Sequential Pattern Mining (SPM) is the task of discovering common subsequences within large databases, such as recurring motifs in DNA or common navigation paths on a website. Historically, researchers have used specialized algorithms like cSPADE or PrefixSpan for their speed. However, these algorithms are "brittle"; adding a new constraint (e.g., a regular expression match) often requires rewriting the core engine.

Constraint Programming (CP) offers a modular alternative where constraints are added as independent modules to a general solver. Until now, CP-based miners were significantly slower and less scalable. This work aims to close that performance gap by introducing efficient data structures and state restoration techniques into the CP framework.

The PrefixProjection Approach

The core contribution of this paper is the PrefixProjection global constraint. The efficiency of this propagator relies on two major innovations that combine data mining heuristics with CP search mechanics.

1. Last-Position Lists

Borrowing from the LAPIN algorithm, the authors pre-compute the last occurrence of every symbol in every sequence. This information is stored in two structures: lastPosList and lastPosMap. These allow the solver to instantly determine if a symbol can still appear in a projected sequence without scanning the entire string, which drastically prunes the search space.

Example of lastPosList and lastPosMap data structures used for pruning.

2. Trailing and Reversible Vectors

In a depth-first search, solvers spend significant time "backtracking" to explore different paths. Instead of copying the entire projected database at every step (which is memory-intensive), the authors use "trailing." This CP-native technique records only the changes made to a shared data structure, allowing for near-instant state restoration. By using reversible integers and vectors, the authors eliminated the overhead of memory allocation and garbage collection that typically slows down CP implementations.

Experimental Evaluation

The algorithm was evaluated on seven diverse datasets, including large text corpora (BIBLE, Leviathan), web clickstream data (FIFA, Kosarak), and sparse biological sequences (Protein). The authors introduced three variations of their propagator:

  • PPIC (Incremental): Recomputes frequencies from scratch at each node.
  • PPDC (Decreasing): Starts with total frequencies and subtracts them as sequences are removed.
  • PPmixed: Dynamically chooses between the two based on pruning density.

Key Results and Insights

  • Performance Dominance: The proposed PPIC and PPmixed models significantly outperformed previous CP-based methods like CPSM and Gap-Seq. More importantly, the CP approach was faster than cSPADE (a gold-standard specialized algorithm) on 84% of the datasets. It was particularly effective on the "Protein" dataset, where long sequences often bog down traditional miners.
  • Modularity at No Cost: The most significant insight is that a generic CP solver can outperform specialized code if the global constraints are designed to handle state restoration efficiently.
  • Constraint Handling: Adding complex constraints, such as regular expressions, resulted in even greater performance gains compared to older CP methods, proving that these optimizations translate well to real-world "constrained" mining scenarios.

Conclusion

By integrating "trailing" and "last-position lists," the authors demonstrated that Constraint Programming can be both flexible and highly competitive in performance for Sequential Pattern Mining. While specialized algorithms like cSPADE still hold an advantage in specific cases (like the Kosarak dataset due to its lack of symbol repetition), the PrefixProjection approach provides a robust, scalable, and modular framework for future data mining research.

Summary updated

BibTeX
@inproceedings{aoga2016efficient,
  author = {John O. R. Aoga and Tias Guns and Pierre Schaus},
  title = {{An Efficient Algorithm for Mining Frequent Sequence with Constraint Programming}},
  booktitle = {ECML/PKDD},
  year = {2016},
  url = {https://openreview.net/forum?id=Sjj5Mm3ER7},
}
Figure