Periodic Sorting on Two-Dimensional Meshes

Abstract

We consider the following periodic sorting procedure on
two-dimensional meshes of processors:
Initially, each node contains one number.
We proceed in rounds each round
consisting of sorting the columns of the grid, and,
in the second phase, of sorting the rows according to the
snake-like ordering.
We exactly characterize the number of rounds necessary to sort on an
l×m-grid in the worst case, where l is the number
of the rows and m the number of the columns.
An upper bound of
ceil(log l)+1
was known before. This bound is tight for the case that m is not
a power of 2. Surprisingly, it turns out that far fewer rounds are
necessary if m is a power of 2
(and m«l): in this case,
exactly min{ log m + 1, ceil(log l) + 1}
rounds are needed in the worst case.