Topological sort use example