TopSort

scalation.database.graph_pm.TopSort
object TopSort

The TopSort object provides the topSort method for creating a topological sort of the vertices in a directed graph. It also perform cycle detection.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TopSort.type

Members list

Value members

Concrete methods

def topSort(g: Graph): Array[Int]

Topological sort that returns an edge compatible ordering of the vertices. Translated from pseudo-code and implements Tarjan's algorithm. The topological sort will contain NEGATIVE values, if there is a CYCLE.

Topological sort that returns an edge compatible ordering of the vertices. Translated from pseudo-code and implements Tarjan's algorithm. The topological sort will contain NEGATIVE values, if there is a CYCLE.

Value parameters

g

the directed graph

Attributes

See also

en.wikipedia.org/wiki/Topological_sorting