#NEWLINE# def topological_sorting( graph ) : #NEWLINE# #INDENT# '\n    Topological sorting.\n\n    @attention: Topological sorting is meaningful only for directed acyclic graphs.\n\n    @type  graph: digraph\n    @param graph: Graph.\n\n    @rtype:  list\n    @return: Topological sorting for the graph.\n    ' #NEWLINE# order = depth_first_search ( graph ) [ 2 ] #NEWLINE# order . reverse ( ) #NEWLINE# return graph