Improving Search Using Indexing: A Study with Temporal CSPs

Nikos Mamoulis, Dimitris Papadias

Abstract

Traditional Constraint Satisfaction Problem (CSP) solvers often struggle with large variable domains, particularly in temporal reasoning where variables represent intervals. This paper proposes "Directed Search," a technique that integrates spatial indexing—specifically R-trees—into the search process. By transforming linear domain scans into hierarchical index queries, the authors achieve speedups exceeding an order of magnitude compared to standard backtracking and forward-checking algorithms.

Introduction

In many real-world applications such as temporal databases, planning, and scheduling, CSPs involve variables with massive domains. For instance, a variable might represent a time interval that must satisfy specific Allen's temporal relations (e.g., "overlaps", "meets") against thousands of other intervals. Standard CSP algorithms typically rely on linear scans to find consistent values, which becomes computationally prohibitive as domain sizes grow. This research addresses this bottleneck by bridging the gap between database indexing and CSP search heuristics to make these problems tractable.

Methodology: Directed Search with R-trees

The core innovation is the use of 1D R-trees to index interval domains. An R-tree organizes intervals into a hierarchy of minimum bounding rectangles (MBRs), allowing the search algorithm to prune entire branches of the domain if the bounding box of a node cannot possibly satisfy the temporal constraint.

R-tree structure indexing temporal intervals across multiple levels.

Core Components

  • Directed Backtracking (dirBT): Instead of iterating through a list, the algorithm queries the R-tree using the constraints imposed by previously instantiated variables to retrieve only potentially valid candidates.
  • Directed Forward Checking (dirFC): This version uses a "double index" strategy. It maintains a linear index of values that survived previous prunings while using the static R-tree to further prune the domain based on the current variable's assignment, avoiding the cost of rebuilding the index.
  • Path Consistency (PC) Pre-processing: Before searching, the authors apply Allen’s temporal network maintenance to infer and tighten constraints, significantly reducing the search space.
  • Variable Ordering: The authors utilize a weight-based heuristic where variables with tighter constraints (calculated as the inverse of the probability of satisfaction) are instantiated first.

Experimental Evaluation

The authors evaluated their approach using randomly generated temporal CSPs characterized by four parameters: number of variables ($n$), domain size ($m$), constraint density ($p_1$), and constraint tightness ($p_2$). The intervals were uniformly distributed with sizes averaging 1.5% of the total workspace, with domain sizes tested up to $m=2,000$.

Key Results and Insights

The experiments demonstrated that directed search significantly outperforms traditional methods across various scenarios.

Performance comparison (log scale) between standard search (BT, FC) and directed search (dirBT, dirFC) across varying constraint tightness.
  • Order of Magnitude Speedup: Directed search versions (dirBT and dirFC) consistently outperformed their "plain" counterparts by more than a factor of 10 in most tested scenarios.
  • Scalability with Domain Size: As the domain size ($m$) increases, the performance gain of directed search grows. For $m=2,000$, dirFC was significantly faster than standard FC.
  • Pruning Efficiency: The "aha moment" is that temporal relations (like starts, during, or overlaps) can be translated into bounding conditions for intermediate R-tree nodes. If a node's bounds don't satisfy the condition, none of its children will, allowing for massive pruning at the node level.
  • Phase Transition Performance: In the "hard region" (where problems are on the edge of solubility), the combination of Path Consistency and Directed Search proved most robust.

Limitations and Future Work

While highly effective, the current approach assumes a static R-tree and does not account for highly dynamic environments where intervals are frequently added or deleted during the search process. Additionally, while R-trees save time, they require additional memory overhead that wasn't deeply explored for extremely large datasets. Future work may involve applying CSP algorithms hierarchically at each R-tree level or extending the focus to multi-dimensional spatial and multimedia databases.

Summary updated

BibTeX
@inproceedings{mamoulis1999improving,
  author = {Nikos Mamoulis and Dimitris Papadias},
  title = {{Improving Search Using Indexing: A Study with Temporal CSPs}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1999},
}
Figure