dag:topological sort using kahn's method