PHP Class 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)
Inheritance: implements Trismegiste\Mondrian\Graph\Graph
Afficher le fichier Open project: trismegiste/mondrian Class Usage Examples

Protected Properties

Свойство Type Description
$adjacency SplObjectStorage The adjacencies list of one vertex is a hashmap Target vertex -> Edge

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

public __construct ( )

addEdge() public méthode

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

addVertex() public méthode

Add a vertex to the graph without edge Note : Idempotent method
public addVertex ( Vertex $v )
$v Vertex

getEdgeIterator() public méthode

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

getEdgeSet() public méthode

Get the edges set
public getEdgeSet ( ) : Edge[]
Résultat Edge[]

getPartition() public méthode

{@inheritDoc}
public getPartition ( )

getSuccessor() public méthode

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
Résultat Vertex[] array of successor vertex

getVertexSet() public méthode

Get the vertices in the graph
public getVertexSet ( ) : Vertex[]
Résultat Vertex[]

searchEdge() public méthode

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

Property Details

$adjacency protected_oe property

The adjacencies list of one vertex is a hashmap Target vertex -> Edge
protected SplObjectStorage $adjacency
Résultat SplObjectStorage