PHP 클래스 Trismegiste\Mondrian\Graph\Digraph

Digraph is a directed graph with 0 or 1 directed edge between two vertices. Therefore, there are at maximum two edges between two vertices (the two directions)
상속: implements Trismegiste\Mondrian\Graph\Graph
파일 보기 프로젝트 열기: trismegiste/mondrian 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$adjacency SplObjectStorage The adjacencies list of one vertex is a hashmap Target vertex -> Edge

공개 메소드들

메소드 설명
__construct ( )
addEdge ( Vertex $source, Vertex $target ) Add a directed edge if it does not already exist
addVertex ( Vertex $v ) Add a vertex to the graph without edge Note : Idempotent method
getEdgeIterator ( Vertex $v ) {@inheritDoc}
getEdgeSet ( ) : Edge[] Get the edges set
getPartition ( ) {@inheritDoc}
getSuccessor ( Vertex $v ) : Vertex[] Returns successor(s) of a given vertex (a.k.a all vertices targeted by edges coming from the given vertex)
getVertexSet ( ) : Vertex[] Get the vertices in the graph
searchEdge ( Vertex $source, Vertex $target ) : Edge Searches an existing directed edge between two vertices

메소드 상세

__construct() 공개 메소드

public __construct ( )

addEdge() 공개 메소드

Add a 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 Note : Idempotent method
public addVertex ( Vertex $v )
$v Vertex

getEdgeIterator() 공개 메소드

{@inheritDoc}
public getEdgeIterator ( Vertex $v )
$v Vertex

getEdgeSet() 공개 메소드

Get the edges set
public getEdgeSet ( ) : Edge[]
리턴 Edge[]

getPartition() 공개 메소드

{@inheritDoc}
public getPartition ( )

getSuccessor() 공개 메소드

Returns successor(s) of a given vertex (a.k.a all vertices targeted by edges coming from the given vertex)
public getSuccessor ( Vertex $v ) : Vertex[]
$v Vertex
리턴 Vertex[] array of successor vertex

getVertexSet() 공개 메소드

Get the vertices in the graph
public getVertexSet ( ) : Vertex[]
리턴 Vertex[]

searchEdge() 공개 메소드

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

프로퍼티 상세

$adjacency 보호되어 있는 프로퍼티

The adjacencies list of one vertex is a hashmap Target vertex -> Edge
protected SplObjectStorage $adjacency
리턴 SplObjectStorage