PHP 인터페이스 Gliph\Graph\Digraph

상속: extends Gliph\Graph\Graph
파일 보기 프로젝트 열기: sdboyer/gliph 0 사용 예제들

공개 메소드들

메소드 설명
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