\Trismegiste\Mondrian\GraphBreadthFirstSearch

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

Summary

Methods
Properties
Constants
__construct()
addEdge()
addVertex()
getEdgeSet()
getVertexSet()
searchEdge()
getSuccessor()
getEdgeIterator()
getPartition()
searchPath()
No public properties found
No constants found
recursivSearchPath()
resetVisited()
$graph
$stack
N/A
No private methods found
No private properties found
N/A

Properties

$graph

$graph : 

Type

$stack

$stack : 

Type

Methods

getEdgeSet()

getEdgeSet() : array

Get the edges set

Returns

array

getVertexSet()

getVertexSet() : array

Get the vertices in the graph

Returns

array

getSuccessor()

getSuccessor(\Trismegiste\Mondrian\Graph\Vertex  $v) : null|array

Get successors of a vertex

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

null|array —

null if the vertex is not in this graph

                    or an array of vertices

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

recursivSearchPath()

recursivSearchPath(\SplObjectStorage  $step, \Trismegiste\Mondrian\Graph\Vertex  $dst) 

Parameters

\SplObjectStorage $step
\Trismegiste\Mondrian\Graph\Vertex $dst

resetVisited()

resetVisited() 

Reset visited state of edges