Sorry about the last blog, i didn't prepared well for the question . I was wondering how to count the numbers of vertices in components, and now i knew 2 algo to do that is, Kosaraju algorithm and Tarjan algorithm, i want to ask what is the difference between this 2, when Korasaju is better and when Tarjan is better. Thanks a lot !!

Your question is so unclear. A directed graph can have multiple cycles. Is it guaranteed that there is only one cycle? Do you want to count total number of vertices belonging to any cycle, or the sum of sizes of simple cycles? Consider yourself reading this blog, wanting to help. Would you understand this question? Add more details, if you want to get an answer.

Auto comment: topic has been updated by _DarkNess (previous revision, new revision, compare).