PHP Class Doctrine\OrientDB\Graph\Algorithm\Dijkstra

Inheritance: implements Doctrine\OrientDB\Graph\Algorithm\AlgorithmInterface
Mostra file Open project: doctrine/orientdb-odm Class Usage Examples

Protected Properties

Property Type Description
$endingVertex
$graph
$paths
$solution
$startingVertex

Public Methods

Method Description
__construct ( Doctrine\OrientDB\Graph\GraphInterface $graph ) Instantiates a new algorithm, requiring a graph to work with.
getDistance ( ) : integer Returns the distance between the starting and the ending point.
getEndingVertex ( ) : Doctrine\OrientDB\Graph\VertexInterface Gets the vertex which we are pointing to.
getLiteralShortestPath ( ) : string Returns the solution in a human-readable style.
getShortestPath ( ) : Array Reverse-calculates the shortest path of the graph thanks the potentials stored in the vertices.
getStartingVertex ( ) : Doctrine\OrientDB\Graph\VertexInterface Retrieves the vertex which we are starting from to calculate the shortest path.
setEndingVertex ( Doctrine\OrientDB\Graph\VertexInterface $vertex ) Sets the vertex which we are pointing to.
setStartingVertex ( Doctrine\OrientDB\Graph\VertexInterface $vertex ) Sets the vertex which we are starting from to calculate the shortest path.
solve ( )

Protected Methods

Method Description
calculatePotentials ( Doctrine\OrientDB\Graph\VertexInterface $vertex ) Recursively calculates the potentials of the graph, from the starting point you specify with ->setStartingVertex(), traversing the graph due to Vertex's $connections attribute.
getGraph ( ) : Doctrine\OrientDB\Graph\GraphInterface Returns the graph associated with this algorithm instance.
getPaths ( ) : Array Returns the possible paths registered in the graph.
isSolved ( ) : boolean Checks wheter the current algorithm has been solved or not.

Method Details

__construct() public method

Instantiates a new algorithm, requiring a graph to work with.
public __construct ( Doctrine\OrientDB\Graph\GraphInterface $graph )
$graph Doctrine\OrientDB\Graph\GraphInterface

calculatePotentials() protected method

Recursively calculates the potentials of the graph, from the starting point you specify with ->setStartingVertex(), traversing the graph due to Vertex's $connections attribute.
protected calculatePotentials ( Doctrine\OrientDB\Graph\VertexInterface $vertex )
$vertex Doctrine\OrientDB\Graph\VertexInterface

getDistance() public method

Returns the distance between the starting and the ending point.
public getDistance ( ) : integer
return integer

getEndingVertex() public method

Gets the vertex which we are pointing to.
public getEndingVertex ( ) : Doctrine\OrientDB\Graph\VertexInterface
return Doctrine\OrientDB\Graph\VertexInterface

getGraph() protected method

Returns the graph associated with this algorithm instance.
protected getGraph ( ) : Doctrine\OrientDB\Graph\GraphInterface
return Doctrine\OrientDB\Graph\GraphInterface

getLiteralShortestPath() public method

Returns the solution in a human-readable style.
public getLiteralShortestPath ( ) : string
return string

getPaths() protected method

Returns the possible paths registered in the graph.
protected getPaths ( ) : Array
return Array

getShortestPath() public method

Reverse-calculates the shortest path of the graph thanks the potentials stored in the vertices.
public getShortestPath ( ) : Array
return Array

getStartingVertex() public method

Retrieves the vertex which we are starting from to calculate the shortest path.
public getStartingVertex ( ) : Doctrine\OrientDB\Graph\VertexInterface
return Doctrine\OrientDB\Graph\VertexInterface

isSolved() protected method

Checks wheter the current algorithm has been solved or not.
protected isSolved ( ) : boolean
return boolean

setEndingVertex() public method

Sets the vertex which we are pointing to.
public setEndingVertex ( Doctrine\OrientDB\Graph\VertexInterface $vertex )
$vertex Doctrine\OrientDB\Graph\VertexInterface

setStartingVertex() public method

Sets the vertex which we are starting from to calculate the shortest path.
public setStartingVertex ( Doctrine\OrientDB\Graph\VertexInterface $vertex )
$vertex Doctrine\OrientDB\Graph\VertexInterface

solve() public method

public solve ( )

Property Details

$endingVertex protected_oe property

protected $endingVertex

$graph protected_oe property

protected $graph

$paths protected_oe property

protected $paths

$solution protected_oe property

protected $solution

$startingVertex protected_oe property

protected $startingVertex