Mining Top-k Sequential Patterns in Database Graphs:A New Challenging Problem and a Sampling-based Approach

Mingtao Lei, Lingyang Chu, Zhefeng Wang · DOI

Abstract

In many real-world networks, a vertex is usually associated with a transaction database that comprehensively describes the behavior of the vertex. A typical example is a social network, where the behavior of every user is depicted by a transaction database that stores their daily posted contents. Every path of the network is a sequence of vertices that induces multiple sequences of transactions. The sequences of transactions induced by all of the paths in the network form an extremely large sequence database. Finding frequent sequential patterns from such a sequence database discovers interesting subsequences that frequently appear in many paths of the network. However, it is a challenging task, since the sequence database induced by a database graph is too large to be explicitly induced and stored. In this paper, we propose the novel notion of a database graph, which naturally models a wide spectrum of real-world networks by associating each vertex with a transaction database. Our goal is to find the top-k frequent sequential patterns in the sequence database induced from a database graph. We prove that this problem is #P-hard. To tackle this problem, we propose an efficient two-step sampling algorithm that approximates the top-k frequent sequential patterns with provable quality guarantees. Extensive experimental results on synthetic and real-world datasets demonstrate the effectiveness and efficiency of our method.

Introduction

Traditional graph mining often treats nodes as simple entities with basic labels or attributes. However, in modern applications like social networks or citation analysis, nodes are far more complex. A social network user doesn't just have a name; they have a history of thousands of posts, each containing multiple keywords. This paper introduces the database graph model to capture this richness.

In a database graph, each vertex $v$ is associated with a transaction database $D(v)$. A path through the graph induces a set of transaction sequences. The problem is to find the most frequent sequential patterns across all possible paths of a given length $l$.

Example of a database graph where each vertex is associated with a transaction database.

The Complexity Challenge

The primary challenge is the "combinatorial explosion." A single path of length $l$ can induce a massive number of transaction sequences. When considering every possible path in a large network, the total number of sequences becomes astronomical—far too large to store or process using standard algorithms like PrefixSpan. The authors formally prove that even counting these patterns is #P-hard, placing it in a computational complexity class generally considered intractable for exact solutions.

Methodology: A Sampling-Based Approach

To overcome the complexity barrier, the authors propose a framework that moves from exact counting to a sampling-based approximation. The core of this framework is a two-step sampling process combined with an unbiased frequency estimator.

Two-Step Sampling

  1. Path Sampling: Uniformly sample a path $p$ of a fixed length $l$ from the set of all paths $P_l$ in the graph $G$.
  2. Sequence Sampling: From the sampled path $p$, uniformly sample one transaction sequence.

Unbiased Frequency Estimator

Because different nodes have different numbers of transactions, a simple count of sampled patterns would be biased toward paths containing transaction-heavy nodes. The authors developed a weighted estimator $\hat{f}(s)$ that mathematically corrects for these differences.

Key notations used in the database graph mining framework.

Using Chernoff’s inequality, the paper provides a formula to determine the required sample size to stay within a specific error margin $\epsilon$ with a high degree of confidence $\delta$. This approach is "plug-and-play": once the sequences are sampled, any standard sequential pattern mining tool can be used to find the top-k results.

Experimental Evaluation

The authors evaluated their method on both synthetic and real-world datasets, including synthetic transaction distributions, airport networks (Open Flights), and large-scale citation networks (ArnetMiner).

Key Results

  • Efficiency: On the large citation datasets (CN2), the baseline exact method failed to finish. The sampling method processed the dataset efficiently.
  • Accuracy: Using metrics like Average Precision (AP) and Ranking Similarity (RS), the sampling method consistently achieved scores near 1.0 (perfect match to ground truth) once the sample size reached the theoretical threshold.
  • Case Study: In the citation network, the algorithm identified meaningful trends, such as the sequence (machine learning) → (social network), reflecting the rise of ML in social media analysis.

Conclusion and Future Work

This work bridges the gap between graph mining and sequence mining by introducing database graphs. While the sampling approach effectively handles the #P-hard complexity for static graphs and simple paths, future research could extend this to dynamic graphs, handle cycles, or optimize for extremely long path lengths where sample requirements grow.

Summary updated

Abstract

In many real world networks, a vertex is usually associated with a transaction database that comprehensively describes the behaviour of the vertex. A typical example is the social network, where the behaviour of every user is depicted by a transaction database that stores his daily posted contents. A transaction database is a set of transactions, where a transaction is a set of items. Every path of the network is a sequence of vertices that induces multiple sequences of transactions. The sequences of transactions induced by all of the paths in the network forms an extremely large sequence database. Finding frequent sequential patterns from such sequence database discovers interesting subsequences that frequently appear in many paths of the network. However, it is a challenging task, since the sequence database induced by a database graph is too large to be explicitly induced and stored. In this paper, we propose the novel notion of database graph, which naturally models a wide spectrum of real world networks by associating each vertex with a transaction database. Our goal is to find the top-k frequent sequential patterns in the sequence database induced from a database graph. We prove that this problem is #P-hard. To tackle this problem, we propose an efficient two-step sampling algorithm that approximates the top-k frequent sequential patterns with provable quality guarantee. Extensive experimental results on synthetic and real-world data sets demonstrate the effectiveness and efficiency of our method.
BibTeX
@misc{lei2018mining,
  author = {Mingtao Lei and Lingyang Chu and Zhefeng Wang},
  title = {{Mining Top-k Sequential Patterns in Database Graphs:A New Challenging Problem and a Sampling-based Approach}},
  year = {2018},
  eprint = {1805.03320},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.03320},
}

Loading related content...

Figure