# \GraphDS\AlgoBFS

Class defining the breadth-dirst search.

## Summary

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

## Tags

None found

## Properties

### $graph

    $graph : object

Reference to the graph.

#### Type

object

#

## Tags

None found

### $dist

    $dist : array

Distances for each node to root in hops.

#### Type

array

#

## Tags

None found

### $parent

    $parent : array

Parents for each vertex.

#### Type

array

#

## Tags

None found

### $discovered

    $discovered : array

Discovered vertices, in BFS order.

#### Type

array

#

## Tags

None found

## Methods

### __construct()

    __construct(object  $graph)

Constructor for the BFS algorithm.

#### Parameters

object | $graph | The graph to which the BFS algorithm should be applied

#

Inherited from
  \GraphDS\Algo\BFS

## Tags

None found

### run()

    run(mixed  $root)

Runs the BFS from a given vertex $vertex on the graph.

#### Parameters

mixed | $root | ID of the vertex from which the BFS should begin

#

Inherited from
  \GraphDS\Algo\BFS

## Tags

None found

### get()

    get() : array

Returns the result of the BFS.

#### Returns

array —

Array of vertex distance to root, parents and vertices in BFS order

#

Inherited from
  \GraphDS\Algo\BFS

## Tags

None found

### BFS.php