linearizeStrictPartialOrder

gapt.utils.linearizeStrictPartialOrder

Attributes

Source
posets.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[T](set: Iterable[T], relation: Iterable[(T, T)]): Either[Vector[T], Vector[T]]

Linearizes a strict partial order.

Linearizes a strict partial order.

Type parameters

T

The type of the elements.

Value parameters

relation

The relation to be linearized.

set

The set of elements on which the relation is defined.

Attributes

Returns

Either (right) a sequence of elements e1,...,en containing all the input elements such that ei relation ej implies i < j, for 1 <= i,j <= n, if the input relation is a strict partial order. Otherwise, a cycle (left) is returned.

Source
posets.scala
def apply[T](set: Iterable[T], relation: T => Iterable[T]): Either[Vector[T], Vector[T]]

Attributes

Source
posets.scala