Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TopSort
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Topological sort that returns an edge compatible ordering of the vertices.

    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.

    g

    the graph

    See also

    en.wikipedia.org/wiki/Topological_sorting