SearcharxivSearch

arXiv subjects

Elahe Ghasemi

Publications and source records attributed to Elahe Ghasemi.

2 recordsLinked to original sources

Galloping in fast-growth natural merge sorts

We study the impact of merging routines in merge-based sorting algorithms. More precisely, we focus on the galloping routine that TimSort uses to merge monotonic sub-arrays, hereafter called runs, and on the impact on the number of element comparisons performed if one uses this routine instead of a naïve merging routine. This routine was introduced in order to make TimSort more efficient on arrays with few distinct values. Alas, we prove that, although it makes TimSort sort array with two values in linear time, it does not prevent TimSort from requiring up to $Θ(n \log(n))$ element comparisons to sort arrays of length~$n$ with three distinct values. However, we also prove that slightly modifying TimSort's galloping routine results in requiring only $\mathcal{O}(n + n \log(σ))$ element comparisons in the worst case, when sorting arrays of length $n$ with $σ$ distinct values. We do so by focusing on the notion of dual runs, which was introduced in the 1990s, and on the associated dual run-length entropy. This notion is both related to the number of distinct values and to the number of runs in an array, which came with its own run-length entropy that was used to explain TimSort's otherwise "supernatural" efficiency. We also introduce new notions of fast- and middle-growth for natural merge sorts (i.e., algorithms based on merging runs), which are found in several merge sorting algorithms similar to TimSort. We prove that algorithms with the fast- or middle-growth property, provided that they use our variant of TimSort's galloping routine for merging runs, are as efficient as possible at sorting arrays with low run-induced or dual-run-induced complexities.

cs.DS

Entropic Weighted Rank Function

It is known that the entropy function over a set of jointly distributed random variables is a submodular set function. However, not any submodular function is of this form. In this paper, we consider a family of submodular set functions, called weighted rank functions of matroids, and study the necessary or sufficient conditions under which they are entropic. We prove that weighted rank functions are located on the boundary of the submodularity cone. For the representable matroids over a characteristic 2 field, we show that the integer valued weighted rank functions are entropic. We derive a necessary condition for constant weight rank functions to be entropic and show that for the case of graphic matroids, this condition is indeed sufficient. Since these functions generalize the rank of a matroid, our findings generalize some of the results of Abbe et. al. about entropic properties of the rank function of matroids.

cs.IT