# Sorting algorithm for set of elements, when I have comparison of just some pairs not all of them

Is there some kind of algorithm for sorting of set, when there is comparison of just some pairs?

Example 1: set(a, b, c, d, e) pairs(a>b, ce)

Example 2: set(a, b, c, d, e) pairs(a>b, d>b, c>d, d>e)

Kahn and Saks showed that partially sorted lists can be sorted in $$O(\log M)$$, where $$M$$ is the number of possible orderings consistent with the partial order. I'm not sure that their algorithm is efficient, though. The best constant in the big O is the subject of the 1/3–2/3 conjecture.