Add topological sort problem