Options
2013
Conference Paper
Titel
An explicit formula for sorting and its application to sorting in lattices
Abstract
In a totally ordered set the notion of sorting a finite sequence is defined through the existence of a suitable permutation of the sequence's indices. A drawback of this definition is that it only implicitly expresses how the elements of a sequence are related to those of its sorted counterpart. To alleviate this situation we prove a simple formula that explicitly describes how the kth element of a sorted sequence can be computed from the elements of the original sequence. As this formula relies only on the minimum and maximum operations we use it to define the notion of sorting for lattices. A major difference of sorting in lattices is that it does not guarantee that sequence elements are only rearranged. To the contrary, sorting in general lattices may introduce new values into a sequence or completely remove values from it. We can show, however, that other fundamental properties that are associated with sorting are preserved. Furthermore, we address the problem that the direct application of our explicit formula for sorting leads to an algorithm with exponential complexity. We present therefore for distributive lattices a recursive formulation to compute the sort of a sequence. This alternative formulation, which is inspired by the identity (n k) = (n-1 k-1)+(n-1 k) that underlies Pascal's triangle, allows for sorting in lattices with quadratic complexity and is in fact a generalization of insertion sort for lattices.