$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
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)
addVertex(\Trismegiste\Mondrian\Graph\Vertex $v)
Add a vertex to the graph without edge Note : Idempotent method
\Trismegiste\Mondrian\Graph\Vertex | $v |
addEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target)
Add a directed edge if it does not already exist
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
if source and target are the same
searchEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target) : \Trismegiste\Mondrian\Graph\Edge
Searches an existing directed edge between two vertices
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
the edge or null
getVertexSet() : array<mixed,\Trismegiste\Mondrian\Graph\Vertex>
Get the vertices in the graph
getEdgeSet() : array<mixed,\Trismegiste\Mondrian\Graph\Edge>
Get the edges set
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)
\Trismegiste\Mondrian\Graph\Vertex | $v |
array of successor vertex
getEdgeIterator(\Trismegiste\Mondrian\Graph\Vertex $v) : \Trismegiste\Mondrian\Graph\Iterator
Get an iterator on edges for one vertex
\Trismegiste\Mondrian\Graph\Vertex | $v |