P385: Enumeration of all topological sortings of a given set in lexicographically

P385: Enumeration of all topological sortings of a given set in lexicographically
Input:
An $n$-element set $S$.
Output:
All topological sortings of $S$ in lexicographically.
Complexity:
$O(m)$ time per solution(?).
Comment:
Reference:
[Knuth1979] (Bibtex)