結果 : topological sort python implementation