Use the algorithm described by D. Knuth in 'The Art of %
%Computer Programming', Vol.1 3rd ed. p.265. The detection %
%of cycles is described in exercise 23 p.271 and p.548.
Gobo Eiffel Structure Library
Copyright (c) 2001, Eric Bezault and others
Eiffel Forum License v2 (see forum.txt)
$Date: 2005/07/13 17:52:51 $
$Revision: 1.8 $
-- Create a new topological sorter.
-- Set initial capacity to nb.
-- (From DS_TOPOLOGICAL_SORTER)
-- Create a new topological sorter.
-- Set initial capacity to a default value.
-- (From DS_TOPOLOGICAL_SORTER)
-- Items involved in a cycle if any
-- (Note: the items in cycle are stored in reverse order
-- and the first item is repeated at the end of the list.)
-- (From DS_TOPOLOGICAL_SORTER)
-- Equality tester to compare items to be sorted;
-- A void equality tester means that = will be
-- used as comparison criterion.
-- (From DS_TOPOLOGICAL_SORTER)
-- Index of v in the list of items to be sorted;
-- Return 'count + 1' if v is not in the list yet
-- (From DS_TOPOLOGICAL_SORTER)
-- Sorted items
-- (From DS_TOPOLOGICAL_SORTER)
-- Maximum number of items to be sorted
-- (From DS_TOPOLOGICAL_SORTER)
-- Can set_equality_tester be called with a_tester
-- as argument in current state of the sorter?
-- (From DS_TOPOLOGICAL_SORTER)
-- Is v included in the list of items to be sorted?
-- (From DS_TOPOLOGICAL_SORTER)
-- Has a cycle been detected?
-- (From DS_TOPOLOGICAL_SORTER)
-- Are there no items yet to be sorted?
-- (From DS_TOPOLOGICAL_SORTER)
-- Have items been sorted?
-- (From DS_TOPOLOGICAL_SORTER)
-- Specify that item u should appear
-- before item v in the sorted list.
-- Insert u and v in the list of items
-- to be sorted if not already done.
-- (From DS_TOPOLOGICAL_SORTER)
-- Specify that item at index i should
-- appear before item at index j in
-- the sorted list.
-- (From DS_TOPOLOGICAL_SORTER)
-- Specify that item u should appear
-- before item v in the sorted list.
-- (From DS_TOPOLOGICAL_SORTER)
-- Remove v to the list of items to be sorted.
-- Keep the order relation for the sorting though.
-- (From DS_TOPOLOGICAL_SORTER)
-- Discard result of last sort.
-- (From DS_TOPOLOGICAL_SORTER)
-- Wipe out items.
-- (From DS_TOPOLOGICAL_SORTER)
-- Set equality_tester to a_tester.
-- A void equality tester means that =
-- will be used as comparison criterion.
-- (From DS_TOPOLOGICAL_SORTER)
-- Sort items held in items according to the
-- relations which have been recorded.
-- (From DS_TOPOLOGICAL_SORTER)
Topological sorters of hashable items