Detecting a cycle in a path between 2 vertices
<p>I'm interested in finding if there's a cycle in some path between two given vertices, S and T in a directed graph G.</p>

<p>i.e return "true" if there <strong>exists</strong> at least one path between S and T where there is a cycle, in a time complexity of <code>O(|V|+|E|)</code>. I just want some algorithm in pseudo-code. </p>

<p>I wanted to use Kosaraju-Sharir's algorithm, the problem is that even if S and T are in the same strongly connected component the answer is not necessarily "true", in case the cycle only starts from T and the path from S to T is simple.</p>

<p>Thank you.</p>