PHP Интерфейс Gliph\Graph\Digraph

Наследование: extends Gliph\Graph\Graph
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
arcsFrom ( $vertex ) : Generator Enumerates each out-arc from the provided vertex via a generator.
arcsTo ( $vertex ) : Generator Enumerates each in-arc from the provided vertex via a generator.
getCycles ( ) : array Returns the cycles in this graph, if any.
inDegreeOf ( object $vertex ) : integer Returns the in-degree (number of incoming edges) for the provided vertex.
isAcyclic ( ) : boolean Indicates whether or not this graph is acyclic.
outDegreeOf ( object $vertex ) : integer Returns the out-degree (count of outgoing edges) for the provided vertex.
predecessorsOf ( object $vertex ) : Generator Enumerates each predecessor vertex to the provided vertex via a generator.
successorsOf ( object $vertex ) : Generator Enumerates each successor vertex to the provided vertex via a generator.
transpose ( ) : Gliph\Graph\Digraph Returns the transpose of this graph.

Описание методов

arcsFrom() публичный Метод

An arc is outbound from a vertex if that vertex is the 'tail' of the arc. Returns a generator that yields 2-tuple (array) where the first two values represent the vertex pair. Vertex order is guaranteed: the first vertex is the tail, and the second vertex is the head. If the graph has additional edge data (e.g., weight), additional elements are appended to the edge array as needed. (See implementation-specific documentation for more detail).
См. также: Digraph::arcsTo()
См. также: Digraph::successorsOf()
См. также: Graph::incidentTo() Note that, in set terms, g.incidentTo(x) == g.arcsFrom(x) ∪ g.arcsTo(x)
public arcsFrom ( $vertex ) : Generator
$vertex The vertex whose out-arcs should be visited.
Результат Generator A generator that yields out-arcs as values.

arcsTo() публичный Метод

An arc is inbound to a vertex if that vertex is the 'head' of the arc. Returns a generator that yields 2-tuple (array) where the first two values represent the vertex pair. Vertex order is guaranteed: the first vertex is the tail, and the second vertex is the head. If the graph has additional edge data (e.g., weight), additional elements are appended to the edge array as needed. (See implementation-specific documentation for more detail).
См. также: Digraph::arcsFrom()
См. также: Digraph::predecessorsOf()
См. также: Graph::incidentTo() Note that, in set terms, g.incidentTo(x) == g.arcsFrom(x) ∪ g.arcsTo(x)
public arcsTo ( $vertex ) : Generator
$vertex The vertex whose in-arcs should be visited.
Результат Generator A generator that yields in-arcs as values.

getCycles() публичный Метод

Returns the cycles in this graph, if any.
public getCycles ( ) : array
Результат array An array of arrays, each subarray representing a full cycle in the graph. If the array is empty, the graph is acyclic.

inDegreeOf() публичный Метод

In undirected graphs, in-degree and out-degree are the same.
public inDegreeOf ( object $vertex ) : integer
$vertex object The vertex for which to retrieve in-degree information.
Результат integer

isAcyclic() публичный Метод

Indicates whether or not this graph is acyclic.
public isAcyclic ( ) : boolean
Результат boolean

outDegreeOf() публичный Метод

In undirected graphs, in-degree and out-degree are the same.
public outDegreeOf ( object $vertex ) : integer
$vertex object The vertex for which to retrieve out-degree information.
Результат integer

predecessorsOf() публичный Метод

A vertex (B) is a predecessor to another vertex (A) if an arc points from B to A. In such an arc, B is considered the 'tail', A is considered the 'head', as it would be visually represented with an arrow: B -> A Note that, in set terms, g.adjacentTo(x) == g.successorsOf(x) ∪ g.predecessorsOf(x)
public predecessorsOf ( object $vertex ) : Generator
$vertex object The vertex whose predecessor vertices should be enumerated.
Результат Generator A generator that yields predecessor vertices as values.

successorsOf() публичный Метод

A vertex (B) is a successor to another vertex (A) if an arc points from A to B. In such an arc, A is considered the 'tail', B is considered the 'head', as it would be visually represented with an arrow: A -> B Note that, in set terms, g.adjacentTo(x) == g.successorsOf(x) ∪ g.predecessorsOf(x)
public successorsOf ( object $vertex ) : Generator
$vertex object The vertex whose successor vertices should be enumerated.
Результат Generator A generator that yields successor vertices as values.

transpose() публичный Метод

A transpose is identical to the current graph, except that its edges have had their directionality reversed. Transposed graphs are sometimes called the 'reverse' or 'converse'.
public transpose ( ) : Gliph\Graph\Digraph
Результат Gliph\Graph\Digraph