Let G=(V, E) directed graph.
Let v be a vertex in G, find the number of vertices that take part in non-simple directed paths to v.
My attempt:
Find strongly connected components , V_1,V_2...,V_i (using DFS search produces).
Perform topological sorting on the V_1,V_2...,V_i.
Suppose v in V_j. Perform DFS on V_1 to V_j and count all vertex in the strongly connected components whose size is bigger than 1.
Is my solution correct?