Data.Graph.Sparse.TopSort
topSort :: SparseGraph w -> Maybe (Vector Int) Source #
>>> topSort $ buildDirectedGraph 4 4 $ U.fromList [(0,1),(0,2),(1,3),(2,3)] Just [0,1,2,3] >>> topSort $ buildDirectedGraph 2 0 U.empty Just [0,1] >>> topSort $ buildDirectedGraph 2 2 $ U.fromList [(0,1),(1,0)] Nothing
>>>
topSort $ buildDirectedGraph 4 4 $ U.fromList [(0,1),(0,2),(1,3),(2,3)]
topSort $ buildDirectedGraph 2 0 U.empty
topSort $ buildDirectedGraph 2 2 $ U.fromList [(0,1),(1,0)]