We deal with a directed graph which may contain or not cycles and may be or not be connected. We want to find the minimum set of vertex such that every other vertex in the graph is accessible from them.
For example, given: https://i.stack.imgur.com/wtRYB.png (SO won't let me post images :/ )
A solution could be (A, E) or (A, F).
My first approach was to look for nodes without parents (indegree = 0), but this fails to take into account the aforementioned cycles.
After a quick search, I have found relatively little regarding non-acyclic digraphs in SO. So, what is the lowest complexity algorithm you can suggest me?