I need to find the longest cycle in a directed graph using DFS.
I once saw this Wikipedia article describing the way of doing this, and I think it approached the pro
I think that longest elementary cycle (or circuit) is better terminology than longest cycle.
Anyway, this pdf may be helpful: Finding All the Elementary Circuits of a Directed Graph
This one year old stackoverflow question has also many links to related problems and algorithms: Finding all cycles in a directed graph