$graph
$graph :
BreadthFirstSearch is a decorator for digraph to find a directed path between two vertices.
Uses the breadth first search method : shortest path and avoid cycle
Note : this is my own algorithm, I find it ugly and not DRY
__construct(\Trismegiste\Mondrian\Graph\Graph $g)
Decorates the graph
\Trismegiste\Mondrian\Graph\Graph | $g |
addEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target)
Add a (un)directed edge if it does not already exist
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
addVertex(\Trismegiste\Mondrian\Graph\Vertex $v)
Add a vertex to the graph without edge
\Trismegiste\Mondrian\Graph\Vertex | $v |
searchEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target) : \Trismegiste\Mondrian\Graph\Edge
Searches an existing (directed or not) edge between two vertices
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
getSuccessor(\Trismegiste\Mondrian\Graph\Vertex $v) : null|array
Get successors of a vertex
\Trismegiste\Mondrian\Graph\Vertex | $v |
null if the vertex is not in this graph
or an array of vertices
getEdgeIterator(\Trismegiste\Mondrian\Graph\Vertex $v) : \Trismegiste\Mondrian\Graph\Iterator
Get an iterator on edges for one vertex
\Trismegiste\Mondrian\Graph\Vertex | $v |
searchPath(\Trismegiste\Mondrian\Graph\Vertex $src, \Trismegiste\Mondrian\Graph\Vertex $dst)
\Trismegiste\Mondrian\Graph\Vertex | $src | |
\Trismegiste\Mondrian\Graph\Vertex | $dst |
recursivSearchPath(\SplObjectStorage $step, \Trismegiste\Mondrian\Graph\Vertex $dst)
\SplObjectStorage | $step | |
\Trismegiste\Mondrian\Graph\Vertex | $dst |