For Development HEAD DRAFTSearch (procedure/syntax/module):

12.95 util.toposort - Topological sort

Module: util.toposort

Implements topological sort algorithm.

SRFI-234 now defines a superset of the functionalities this module provides. New code should use it instead of this module (see srfi.234 - Topological sorting).

Function: topological-sort graph :optional eqproc

{util.toposort} Returns a topologically sorted list of nodes, when the node dependencies are specified by graph. See srfi.234 - Topological sorting, for the details.

This procedure differs from SRFI-234’s topological-sort in the following ways:

  • When graph contains cycles, this one raises an error, while SRFI-234’s returns #f.
  • The default of node comparison predicate eqproc is eqv?, while in SRFI-234 it is equal?
  • This one does not take the third argument.


For Development HEAD DRAFTSearch (procedure/syntax/module):
DRAFT