On Sorting an Intransitive Total Ordered Set Using Semi-Heap
Department of Computer Science and Engineering
Florida Atlantic University
Boca Raton, FL 33431
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
cessors under the EREW PRAM model.
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
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
is a total order without the
transitive property, i.e., it is intransitive. That is, if
, it is not necessary that
. The total
order requires that for any two elements
, but not both (antisymmetric).
elements exhibiting intransitive total or-
der can be represented by a directed graph, where
represents a directed edge from vertex
underlying graph is a complete graph. This graph is also
, representing a tournament of
players where every possible pair of players plays one game
to decide the winner (and the loser) between them. Sorting
corresponds to ﬁnding a Hamiltonian path in the tour-
This work was support in part by NSF grant CCR 9900646.
Hell and Rosenfeld  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  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
processors. Other fast parallel algorithms can be
found in .
In this paper, we propose a new data structure called
, 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.