Do not add edges to same node
Rewrite topsort and use graph utils