Add topological sorting to graphs.