Parallel Computing 17 (1991) 689-693 689
North-Holland
Short communication
An efficient parallel algorithm
for multiselection
S. Olariu and Z. Wen
Department of Computer Science, OM Dominion Unioersity, Norfolk, VA 23529-0162, USA
Received March 1990
Revised January 1991
Abstract
Olariu, S. and Z. Wen, An efficient parallel algorithm for multiselection, Parallel Computing 17 (1991) 689-693.
The problem of multiselection arises frequently in databases. Here, given an unordered set S of n records and a
sequence of m integers 1 ~< ql < q2 < . - - < qm ~< n we are interested in answering queries of the type 'find the
qAh smallest elements in S', the problem is to answer all these queries as fast as possible. We propose an
efficient parallel algorithm for multiselection, running in O(n/p log2m) time using p processors with 1 ~< p ~<
In/log n log* n], in the EREW-PRAM model.
Keywords. Query processing; selection; multiselection; parallel algorithms; EREW-PRAM.
1. Introduction
One of the fundamental algorithmic problems in computer science involves selecting the k th
smallest element in a collection S of n elements. In a database context, this translates as
answering a corresponding query on the collection S of records. It is well known that, in case S
is not sorted, the classic sequential algorithm (see Aho et al. [1], page 98) runs in O(n) time.
Given the fundamental importance of the problem, it comes as no surprise that several parallel
algorithms for selection have been proposed (see Akl [2] for a discussion of recent results).
The problem of multiselection arises frequently in databases [5]: given a set Q=
(q~, q2 .... , qm }, (1 ~< m), of queries of the type 'find the qith smallest dement in S', how fast
can all these queries be answered? Clearly, a sequential solution running in O(min( ran, n log n ))
is readily available.
The purpose of this note is to propose an efficient parallel algorithm to solve the multiselec-
tion problem. The model of computation that we shall adopt is the well-known EREW-PRAM
in which all the processors have access to a common memory and run synchronously with
simultaneous reading from the same memory location as well as simultaneous writing into the
same memory location prohibited [6]. Specifically, our parallel algorithm runs in O(n/p log 2m)
time using p processors with 1 ~<p ~< [n/log n log* n], in the EREW-PRAM model.
0167-8191/91/$03.50 © 1991 - Elsevier Science Publishers B.V. All rights reserved