\Trismegiste\Mondrian\GraphDigraph

Design pattern: Decorator Component : Concrete Component

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)

Summary

Methods
Properties
Constants
__construct()
addVertex()
addEdge()
searchEdge()
getVertexSet()
getEdgeSet()
getSuccessor()
getEdgeIterator()
getPartition()
No public properties found
No constants found
No protected methods found
$adjacency
N/A
No private methods found
No private properties found
N/A

Properties

$adjacency

$adjacency : \SplObjectStorage

This is a hashmap Source Vertex -> \SplObjectStorage (the adjacencies list of one vertex)

The adjacencies list of one vertex is a hashmap Target vertex -> Edge

Type

\SplObjectStorage

Methods

__construct()

__construct() 

addVertex()

addVertex(\Trismegiste\Mondrian\Graph\Vertex  $v) 

Add a vertex to the graph without edge Note : Idempotent method

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

getSuccessor()

getSuccessor(\Trismegiste\Mondrian\Graph\Vertex  $v) : array<mixed,\Trismegiste\Mondrian\Graph\Vertex>

Returns successor(s) of a given vertex (a.k.a all vertices targeted by edges coming from the given vertex)

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

array<mixed,\Trismegiste\Mondrian\Graph\Vertex> —

array of successor vertex

getEdgeIterator()

getEdgeIterator(\Trismegiste\Mondrian\Graph\Vertex  $v) : \Trismegiste\Mondrian\Graph\Iterator

Get an iterator on edges for one vertex

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

\Trismegiste\Mondrian\Graph\Iterator

getPartition()

getPartition() 

Returns a list of subgraph