Skip to main content
QUICK REVIEW

[Paper Review] Optimal Preprocessing for Answering On-Line Product Queries

Ilan Alon, Baruch Schieber|arXiv (Cornell University)|Jun 10, 2024
Semantic Web and OntologiesComputer Science28 citations
TL;DR

The paper derives tight preprocessing-time/space bounds to answer on-line linear and tree product queries in semigroups, achieving fast query times (using inverse Ackermann/related functions) and optimal parallel algorithms on CREW/CRCW PRAM.

ABSTRACT

We examine the amount of preprocessing needed for answering certain on-line queries as fast as possible. We start with the following basic problem. Suppose we are given a semigroup $(S,\circ )$. Let $s_1 ,\ldots, s_n$ be elements of $S$. We want to answer on-line queries of the form, ``What is the product $s_i \circ s_{i+1} \circ \cdots \circ s_{j-1} \circ s_j$?'' for any given $1\le i\le j\le n$. We show that a preprocessing of $Θ(n λ(k,n))$ time and space is both necessary and sufficient to answer each such query in at most $k$ steps, for any fixed $k$. The function $λ(k,\cdot)$ is the inverse of a certain function at the $\lfloor {k/2} floor$-th level of the primitive recursive hierarchy. In case linear preprocessing is desired, we show that one can answer each such query in $O( α(n))$ steps and that this is best possible. The function $α(n)$ is the inverse Ackermann function. We also consider the following extended problem. Let $T$ be a tree with an element of $S$ associated with each of its vertices. We want to answer on-line queries of the form, ``What is the product of the elements associated with the vertices along the path from $u$ to $v$?'' for any pair of vertices $u$ and $v$ in $T$. We derive results that are similar to the above, for the preprocessing needed for answering such queries. All our sequential preprocessing algorithms can be parallelized efficiently to give optimal parallel algorithms which run in $O(\log n)$ time on a CREW PRAM. These parallel algorithms are optimal in both running time and total number of operations. Our algorithms, especially for the semigroup of the real numbers with the minimum or maximum operations, have various applications in certain graph algorithms, in the utilization of communication networks and in Database retrieval.

Motivation & Objective

  • Determine the preprocessing time and space needed to answer Linear Product queries in at most k steps for fixed k.
  • Determine the preprocessing time and space needed to answer Tree Product queries in at most 2k steps for fixed k.
  • Identify trade-offs between query time and preprocessing effort under realistic computational models.
  • Show that linear preprocessing enables near-constant-time queries (via inverse Ackermann) and prove corresponding lower bounds.
  • Extend results to parallel algorithms achieving optimal time and processor usage on CREW/CRCW PRAM.

Proposed method

  • Define Linear Product and Tree Product queries on semigroups.
  • Develop recursive, divide-and-conquer preprocessing schemes achieving O(n lambda(k,n)) time/space for Linear Product with k steps.
  • Introduce and use lambda(k,n) as inverse of hierarchical functions A and B from the primitive recursive hierarchy.
  • Derive a linear-time, O(alpha(n))-step preprocessing method for Linear Product queries.
  • Adapt the approach to Tree Product queries by partitioning the tree with separators and building augmented structures at multiple levels.
  • Prove lower bounds showing Omega(n lambda(k,n)) preprocessing is necessary for k-step query answering.

Experimental results

Research questions

  • RQ1What preprocessing is necessary and sufficient to answer Linear Product queries in at most k steps?
  • RQ2What preprocessing is necessary and sufficient to answer Tree Product queries in at most 2k steps?
  • RQ3How do these bounds compare when aiming for linear-time preprocessing and sublogarithmic query times?
  • RQ4Can the sequential preprocessing schemes be efficiently parallelized to optimal CREW/CRCW PRAM algorithms?
  • RQ5What are the practical implications for semigroups like real numbers under min/max in graph/network problems?

Key findings

  • Preprocessing of Theta(n lambda(k,n)) time and space is necessary and sufficient to answer Linear Product queries in at most k steps for fixed k.
  • A linear-time preprocessing scheme enables answering Linear Product queries in O(alpha(n)) steps, with alpha(n) the inverse Ackermann function.
  • For Tree Product queries, preprocessing Theta(n lambda(k,n)) suffices to answer in at most 2k steps, and linear preprocessing yields O(alpha(n)) per query.
  • Linear preprocessing is optimal up to constant factors; Omega(alpha(n)) lower bound applies for achieving linear preprocessing with O(alpha(n)) query time.
  • Parallel algorithms achieve O(log n) time with n lambda(k,n)/log n processors on CREW PRAM for Linear Product queries, and similar optimality on CRCW PRAM for certain cases (e.g., max/min).
  • The results apply to semigroups such as real numbers under min/max, with practical applications in graph algorithms, networks, and database retrieval.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.