PHP Интерфейс Trismegiste\Mondrian\Graph\Graph

A generic graph
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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