P16: Enumeration of all pitches

P16: Enumeration of all pitches
Input:
A directed graph $G = (V, E, S, T)$ that has the set of source vertices $S$ and the set of target vertices of $T$.
Output:
All pitches in $G$.
Complexity:
$O(|V| + |E|)$ delay with $O(|V| + |E|)$ space.
Comment:
A pitch $P$ of $G$ is a set of arcs $E' \subseteq E$, such that the subgraph $G' =(V', E')$ of $G$, where $V' \subseteq V$ is the set of vertices of G having at least one out-going or in-coming arc in $E'$, is acyclic and for each vertex $w \in V' \setminus S$, $w$ is not a source in $G'$, and for each vertex $w \in V' \setminus T$ ,$w$ is not a target in $G'$. Enumeration of all stories (maximal pitches) is still open.
Reference:
[Borassi2013] (Bibtex)