Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a data type for determining a topological order of a directed acyclic graph (DAG). Recall, a digraph has a topological order if and only if it is a DAG. The hasOrder operation determines whether the digraph has a topological order, and if so, the order operation returns one.

For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

Type parameters

  • V

Hierarchy

  • TopologicalOrder

Implemented by

Index

Methods

Methods

hasOrder

  • hasOrder(): boolean
  • Does the digraph have a topological order?

    Returns boolean

    true if the digraph has a topological order (or equivalently, if the digraph is a DAG), and false otherwise.

order

  • Returns a topological order if the digraph has a topologial order, and empty collection otherwise.

    Returns Collection<Vertex<V>>

    a topological order of the vertices (as an interable) if the digraph has a topological order (or equivalently, if the digraph is a DAG), and empty collection otherwise.

rank

  • The the rank of given vertex in the topological order; -1 if the digraph is not a DAG.

    Parameters

    Returns number

    the position of the vertex in a topological order of the digraph; -1 if the digraph is not a DAG.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc