Given directed graph, find the minimum set of vertices that can traverse all the vertices in the graph.
E.g:
5 -> 4
4 -> 6
6 -> 7
5 -> 8
In the above example, the minimum set of vertices will be "5", as you can visit all other vertices from vertex 5.
Is this doable using BFS or DFS?I think Kosaraju's algorithm might work, but checking if there is a easy way to do this.