Find minimum set of vertices that are reachable from all other vertices I have a DAG and I wish to find the minimal set of vertices that have a path to all other vertices.

My solution was to simply find all the vertices that their incoming degree is 0.
However, if there are two vertices in the DAG that have an indegree of 0 and that point to a common vertex then one of the two vertices is surplus.

Any help appreciated.
Your algorithm is correct, provided that the following is a formal definition of your problem:


  Given a DAG $D = (V, A)$, find a minimum set $C \subseteq V$ such that for every vertex $v \in V$, either $v \in C$ or there exists a vertex $c \in C$ such that $v$ is reachable from $c$.


Let's call a vertex with indegree 0 a source and any vertex set that satisfies the reachability part a cover.

Claim.  The optimal solution is $C = \{v \in V \mid v \text{ is a source}\}$.

Claim 1.  $C$ is a solution.  Trivial since $D$ is a DAG.

Claim 2.  Every vertex $c \in C$ is in every cover.  Since it has indegree 0 it cannot be reached by any other vertex.