On Sorting an Intransitive Total Ordered Set Using Semi-Heap
Jie Wu
Department of Computer Science and Engineering
Florida Atlantic University
Boca Raton, FL 33431
jie@cse.fau.edu
Abstract
1
The problem of sorting an intransitive total ordered set,
a generalization of regular sorting, is considered. This gen-
eralized sorting is based on the fact that there exists a spe-
cial linear ordering for any intransitive total ordered set.
A new data structure called semi-heap is proposed to con-
struct an optimal
sorting algorithm. Finally, we
propose a cost-optimal parallel algorithm using semi-heap.
The run time of this algorithm is
with
pro-
cessors under the EREW PRAM model.
1. Introduction
Sorting is one of the fundamental problems in computer
science and many different solutions for sorting have been
proposed [5, 6]. Basically, given a sequence of
numbers
as an input, a sorting algorithm generates
a permutation (reordering)
of the input se-
quence such that
.
We consider a generalization of the sorting problem by
replacing
with
,whe
re
is a total order without the
transitive property, i.e., it is intransitive. That is, if
and
, it is not necessary that
. The total
order requires that for any two elements
and
, either
or
, but not both (antisymmetric).
The set
of
elements exhibiting intransitive total or-
der can be represented by a directed graph, where
represents a directed edge from vertex
to vertex
.The
underlying graph is a complete graph. This graph is also
called a
tournament
[2], representing a tournament of
players where every possible pair of players plays one game
to decide the winner (and the loser) between them. Sorting
on
corresponds to ﬁnding a Hamiltonian path in the tour-
nament.
1
This work was support in part by NSF grant CCR 9900646.
Hell and Rosenfeld [4] proved that the bound of ﬁnd-
ing a Hamiltonian path is
, the same complex-
ity as the regular sorting. They also considered bounds on
ﬁnding some generalized Hamiltonian paths. It is easy to
prove that many regular sorting algorithms can be used to
ﬁnd a Hamiltonian path in a tournament, such as bubble
sort, insertion sort, binary insertion sort, and merge sort.
Among parallel sorting algorithms, even-odd merge sort can
still be applied. However, heapsort and quicksort cannot be
used. Bar-Noy and Naor [1] studied different parallel solu-
tions based on different models and the number of proces-
sors. They showed that under the CRCW PRAM model, the
generalized sorting problem can be solved in
us-
ing
processors. Other fast parallel algorithms can be
found in [7].
In this paper, we propose a new data structure called
semi-heap
, which is an extension of a regular heap struc-
ture. We introduce an optimal
algorithm to de-
termine a Hamiltonian path in a tournament based on the
semi-heap structure. Then, we propose a cost-optimal par-
allel algorithm based on the semi-heap structure that takes
in run time using
processors in the EREW
PRAM model. An implementation of the cost-optimal par-
allel algorithm in the network model with a linear array of
processors is also shown.