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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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