Get a toporder of graph