PHP 인터페이스 Trismegiste\Mondrian\Graph\Graph

A generic graph
파일 보기 프로젝트 열기: trismegiste/mondrian 0 사용 예제들

공개 메소드들

메소드 설명
addEdge ( Vertex $source, Vertex $target ) Add a (un)directed edge if it does not already exist
addVertex ( Vertex $v ) Add a vertex to the graph without edge
getEdgeIterator ( Vertex $v ) : Iterator Get an iterator on edges for one vertex
getEdgeSet ( ) : array Get the edges set
getPartition ( ) Returns a list of subgraph
getSuccessor ( Vertex $v ) : null | array Get successors of a vertex
getVertexSet ( ) : array Get the vertices in the graph
searchEdge ( Vertex $source, Vertex $target ) : Edge Searches an existing (directed or not) edge between two vertices

메소드 상세

addEdge() 공개 메소드

Add a (un)directed edge if it does not already exist
public addEdge ( Vertex $source, Vertex $target )
$source Vertex
$target Vertex

addVertex() 공개 메소드

Add a vertex to the graph without edge
public addVertex ( Vertex $v )
$v Vertex

getEdgeIterator() 공개 메소드

Get an iterator on edges for one vertex
public getEdgeIterator ( Vertex $v ) : Iterator
$v Vertex
리턴 Iterator

getEdgeSet() 공개 메소드

Get the edges set
public getEdgeSet ( ) : array
리턴 array

getPartition() 공개 메소드

Returns a list of subgraph
public getPartition ( )

getSuccessor() 공개 메소드

Get successors of a vertex
public getSuccessor ( Vertex $v ) : null | array
$v Vertex
리턴 null | array null if the vertex is not in this graph or an array of vertices

getVertexSet() 공개 메소드

Get the vertices in the graph
public getVertexSet ( ) : array
리턴 array

searchEdge() 공개 메소드

Searches an existing (directed or not) edge between two vertices
public searchEdge ( Vertex $source, Vertex $target ) : Edge
$source Vertex
$target Vertex
리턴 Edge