Tractable Gap-Constraint Languages for Complex Event Recognition

📅 2026-06-17
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the NP-complete problem of subsequence matching with arbitrary-gap constraints in complex event recognition. Focusing on gap-constrained languages satisfying left-convexity, the authors propose an efficient algorithm with time complexity $O(|D|(|u| + |C|))$, achieving theoretically optimal linear-time matching and enumeration of all valid embeddings under the Strong Exponential Time Hypothesis (SETH). By integrating formal language theory, subsequence embedding models, and dynamic programming—and leveraging the structural properties of left-convex regular languages—the work establishes, for the first time, that left-convexity alone is sufficient to overcome the computational hardness induced by arbitrary gaps. Conversely, it shows that non-left-convex languages retain NP-completeness. The method enables efficient recognition of complex events incorporating practical constraints such as length bounds.
📝 Abstract
For strings $u, D \in Σ^*$, a subsequence embedding of $u$ in $D$ is a function $e \colon \{1, 2, \ldots, |u|\} \to \{1, 2, \ldots, |D|\}$ with $e(i) < e(i+1)$ for every $i \in \{1, 2, \ldots, |u|-1\}$ and the $i$-th symbol of $u$ equals the $e(i)$-th symbol of $D$. A gap-constraint for $u$ is a triple $(i, j, L)$ with $1 \leq i < j \leq |u|$ and $L$ is a regular language over $Σ$. An embedding $e$ satisfies a gap-constraint $(i, j, L)$ if the factor of $D$ strictly between positions $e(i)$ and $e(j)$ is a word from $L$. We investigate the subsequence matching problem with gap-constraints, which is relevant in the context of complex event recognition (CER): given $u, D \in Σ^*$ and a set $C$ of gap-constraints, find an embedding of $u$ in $D$ that satisfies all gap-constraints from $C$. In general, subsequence matching is NP-complete and the only known tractable variants restrict the interval structure of the gap-constraints. In this work, we show that we can solve subsequence matching with gap-constraints with an arbitrary interval structure rather efficiently (in fact, optimally under SETH) in time $O(|D| (|u| + |C|))$ if the gap-constraint languages satisfy a property which we dub left-convexity: whenever $u v w \in L$ and $v \in L$, then also $uv \in L$. Left-convex languages are sufficiently expressive to model interesting real-world scenarios considered in CER, e.g., length constraints $L = \{w \mid a \leq |w| \leq b\}$ for $a, b \in \mathbb{N}$. We also show how our algorithm can be used in order to efficiently enumerate all satisfying embeddings, which is particularly relevant for possible applications in CER. Finally, we show how non-left-convex languages can lead to intractability, i.e., if in addition to length constraints we allow $\{aa, ε\}$ as the only non-left-convex constraint language, then the problem is NP-complete again.
Problem

Research questions and friction points this paper is trying to address.

subsequence matching
gap-constraints
complex event recognition
left-convexity
tractability
Innovation

Methods, ideas, or system contributions that make the work stand out.

gap-constraint
left-convexity
subsequence matching
complex event recognition
tractability
🔎 Similar Papers
No similar papers found.