# \GraphDS\AlgoDijkstra

Class defining Dijkstra's shortest path algorithm.

## Summary

Methods
Properties
Constants
__construct()
run()
get()
$graph
$dist
$prev
$unvisitedVertices
$start
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  Algo/Dijkstra.php
Package
  Default
Class hierarchy
  \GraphDS\Algo\Dijkstra

## Tags

None found

## Properties

### $graph

    $graph : \GraphDS\Graph\Graph

Reference to the graph.

#### Type

\GraphDS\Graph\Graph

#

## Tags

None found

### $dist

    $dist : array

Array holding the shortest distances to each vertex from the source.

#### Type

array

#

## Tags

None found

### $prev

    $prev : array

Array holding the previous vertices for each vertex for the shortest path.

#### Type

array

#

## Tags

None found

### $unvisitedVertices

    $unvisitedVertices : array

Array holding the unvisited vertices in the graph.

#### Type

array

#

## Tags

None found

### $start

    $start : array

ID of the start vertex.

#### Type

array

#

## Tags

None found

## Methods

### __construct()

    __construct(\GraphDS\Graph\Graph  $graph)

Constructor for the Dijkstra algorithm.

#### Parameters

\GraphDS\Graph\Graph | $graph | The graph to which the Dijkstra algorithm should be applied

#### Throws

\InvalidArgumentException

#

Inherited from
  \GraphDS\Algo\Dijkstra

## Tags

None found

### run()

    run(mixed  $start) : void

Calculates the shortest path to every vertex from vertex $start.

#### Parameters

mixed | $start | ID of the starting vertex for Dijkstra's algorithm

#### Throws

\InvalidArgumentException

#

Inherited from
  \GraphDS\Algo\Dijkstra

## Tags

None found

### get()

    get(string  $dest) : array

Returns the shortest path to $dest from the origin vertex in the graph.

#### Parameters

string | $dest | ID of the destination vertex

#### Returns

array —

An array containing the shortest path and distance

#

Inherited from
  \GraphDS\Algo\Dijkstra

## Tags

None found

### Dijkstra.php