P7: Enumeration of all cycles in a directed graph

P7: Enumeration of all cycles in a directed graph
Input:
A directed graph $G=(V, E)$.
Output:
All cycles in $G$.
Complexity:
$O((|V|+ |E|)(C+1))$ total time and $O(|V| + |E|)$ space.
Comment:
$C$ is the number of cycles included in $G$.
Reference:
[Johnson1975] (Bibtex)