Class RGL::TopsortIterator
In: lib/rgl/topsort.rb
Parent: Object

Topological Sort Iterator

The topological sort algorithm creates a linear ordering of the vertices such that if edge (u,v) appears in the graph, then u comes before v in the ordering. The graph must be a directed acyclic graph (DAG).

The iterator can also be applied to undirected graph or to a DG graph which contains a cycle. In this case, the Iterator does not reach all vertices. The implementation of acyclic? uses this fact.

Methods

at_beginning?   at_end?   new  

Included Modules

GraphIterator

Public Class methods

Public Instance methods

[Validate]