P325: Enumeration of all topological sortings of an acyclic directed graph

P325: Enumeration of all topological sortings of an acyclic directed graph
Input:
An acyclic directed graph $G = (V, E)$.
Output:
All topological sortings of $G$.
Complexity:
$O(|V|N)$ total time and $O(|V||E|)$ space.
Comment:
$N$ is the number of solutions.
Reference:
[Avis1996] (Bibtex)