Optimal Preprocessing for Answering On-Line Product Queries

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, ). Let s1 ,…, sn be elements of S. We want to answer on-line queries of the form, ``What is the product si si+1 ·s sj-1 sj?'' for any given 1 i j 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,·) is the inverse of a certain function at the k/2-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( 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.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…