PHP Class Doctrine\OrientDB\Graph\Algorithm\Dijkstra

Inheritance: implements Doctrine\OrientDB\Graph\Algorithm\AlgorithmInterface
Afficher le fichier Open project: doctrine/orientdb-odm Class Usage Examples

Protected Properties

Свойство Type Description
$endingVertex
$graph
$paths
$solution
$startingVertex

Méthodes publiques

Méthode 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 ( )

Méthodes protégées

Méthode 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 méthode

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

calculatePotentials() protected méthode

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 méthode

Returns the distance between the starting and the ending point.
public getDistance ( ) : integer
Résultat integer

getEndingVertex() public méthode

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

getGraph() protected méthode

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

getLiteralShortestPath() public méthode

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

getPaths() protected méthode

Returns the possible paths registered in the graph.
protected getPaths ( ) : Array
Résultat Array

getShortestPath() public méthode

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

getStartingVertex() public méthode

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

isSolved() protected méthode

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

setEndingVertex() public méthode

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

setStartingVertex() public méthode

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 méthode

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