# \GraphDS\AlgoFloydWarshall

Class defining the Floyd-Warshall algorithm.

## Summary

Methods
Properties
Constants
__construct()
run()
get()
$graph
$dist
$next
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/FloydWarshall.php
Package
  Default
Class hierarchy
  \GraphDS\Algo\FloydWarshall

## Tags

None found

## Properties

### $graph

    $graph : object

Reference to the graph.

#### Type

object

#

## Tags

None found

### $dist

    $dist : array

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

#### Type

array

#

## Tags

None found

### $next

    $next : array

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

#### Type

array

#

## Tags

None found

## Methods

### __construct()

    __construct(\GraphDS\Graph\Graph  $graph)

Constructor for the Floyd-Warshall algorithm.

#### Parameters

\GraphDS\Graph\Graph | $graph | The graph to which the Floyd-Warshall should be applied

#### Throws

\InvalidArgumentException

#

Inherited from
  \GraphDS\Algo\FloydWarshall

## Tags

None found

### run()

    run()

Calculates the shortest paths in the graph using the Floyd-Warshall algorithm.

#

Inherited from
  \GraphDS\Algo\FloydWarshall

## Tags

None found

### get()

    get(string  $start, string  $dest) : array

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

#### Parameters

string | $start | ID of the start vertex
string | $dest | ID of the destination vertex

#### Returns

array —

An array containing the shortest path and distance

#

Inherited from
  \GraphDS\Algo\FloydWarshall

## Tags

None found

### FloydWarshall.php