PHP 인터페이스 Gliph\Graph\Graph

파일 보기 프로젝트 열기: sdboyer/gliph

공개 메소드들

메소드 설명
adjacentTo ( object $vertex ) : Generator Enumerates each vertex adjacent to the provided vertex via a generator.
degreeOf ( object $vertex ) : integer Returns the degree (number of incident edges) for the provided vertex.
edges ( ) : Generator Loops over each edge in the graph via a generator.
hasVertex ( object $vertex ) : boolean Indicates whether or not the provided vertex is present in the graph.
incidentTo ( $vertex ) : Generator Enumerates each edge incident to the provided vertex via a generator.
order ( ) : integer Returns the number of vertices in the graph.
size ( ) : integer Returns the number of edges in the graph.
vertices ( ) : Generator Returns a generator that loops through each vertex in the graph.

메소드 상세

adjacentTo() 공개 메소드

A vertex is adjacent to another vertex if they share an edge. Edge direction, if any, does not matter. The generator yields only a value: the adjacent vertex.
public adjacentTo ( object $vertex ) : Generator
$vertex object The vertex whose adjacent vertices should be visited.
리턴 Generator A generator that yields adjacent vertices as values.

degreeOf() 공개 메소드

Returns the degree (number of incident edges) for the provided vertex.
public degreeOf ( object $vertex ) : integer
$vertex object The vertex for which to retrieve degree information.
리턴 integer

edges() 공개 메소드

Different graphs may represent the edge in different ways. A graph with a simple edge concept - e.g., no edge weighting or typing, etc. - may represent the edge as a 2-tuple (an indexed array with two elements). More complex edges may be represented as an object. If no additional information is provided by the method implementation's phpdoc, a 2-tuple should be assumed.
public edges ( ) : Generator
리턴 Generator A generator that produces a single value representing an edge on each iteration.

hasVertex() 공개 메소드

Indicates whether or not the provided vertex is present in the graph.
public hasVertex ( object $vertex ) : boolean
$vertex object The vertex object to check for membership in the graph.
리턴 boolean TRUE if the vertex is present, FALSE otherwise.

incidentTo() 공개 메소드

A vertex is incident to an edge if that edge connects to it. Edge direction, if any, does not matter. Returns a generator that yields 2-tuple (array) where the first two values represent the vertex pair. Vertex order is neither guaranteed nor implied, as edges are an unordered pair. 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).
public incidentTo ( $vertex ) : Generator
$vertex The vertex whose incident edges should be visited.
리턴 Generator A generator that yields incident edges as values.

order() 공개 메소드

Returns the number of vertices in the graph.
public order ( ) : integer
리턴 integer

size() 공개 메소드

Returns the number of edges in the graph.
public size ( ) : integer
리턴 integer

vertices() 공개 메소드

Returns a generator that loops through each vertex in the graph.
public vertices ( ) : Generator
리턴 Generator A generator that yields vertices as values.