Fixed bug where unconnected nodes ignored.
Added find vertex with zero in-degree in DAG.