In The Art Of Computer Programming, Volume 3, Chapter 5.3.1, Problem 26, Knuth asks one to construct a sorting method that achieves the minimum number of average comparisons for n=7. This means that one needs to find a sorting tree that minimises the total length of all paths from root to every leaf (also known as external path length). A leaf node represents one of the n! permutations of n elements. The average number of comparisons over all possible inputs (all n! permutations) is then simply the external path length divided by n!. The minimal external path length for n=7 is known to be 62416, due to L. Kollar, Optimal sorting of seven element sets, 1986. Kollar does not seem to construct a sorting tree that achieves this, he only shows that one cannot do better than 62416. Does anyone know whether such a sorting tree has been constructed or is it still an open problem?Secondary question. How many comparisons does the best known method achieve for n=8? The lower bound for n=8 is 619904, but it is not known if it is obtainable.
Find a sorting procedure for seven elements that minimises the average number of comparisons performed
algorithms;sorting;efficiency