# Vertex

class
**Vertex** implements
VertexInterface (View source)

## Properties

protected | $id | ||

protected | $potential | ||

protected | $potentialFrom | ||

protected | $connections | ||

protected | $passed |

## Methods

Instantiates a new vertex, requiring a ID to avoid collisions.

Returns the connections of the current vertex.

Returns the identifier of this vertex.

Returns vertex's potential.

Returns the vertex which gave to the current vertex its potential.

Returns whether the vertex has passed or not.

Marks this vertex as passed, meaning that, in the scope of a graph, he has already been processed in order to calculate its potential.

Sets the potential for the vertex, if the vertex has no potential or the one it has is higher than the new one.

## Details

###
at line 35
```
```**__construct**(mixed $id)

**__construct**(mixed $id)

Instantiates a new vertex, requiring a ID to avoid collisions.

###
at line 47
```
```**connect**(VertexInterface $vertex, integer $distance = 1)

**connect**(VertexInterface $vertex, integer $distance = 1)

Connects the vertex to another $vertex.

A $distance, to balance the connection, can be specified.

###
at line 57
```
Array
```**getConnections**()

**getConnections**()

Returns the connections of the current vertex.

###
at line 67
```
mixed
```**getId**()

**getId**()

Returns the identifier of this vertex.

###
at line 77
```
integer
```**getPotential**()

**getPotential**()

Returns vertex's potential.

###
at line 87
```
Vertex
```**getPotentialFrom**()

**getPotentialFrom**()

Returns the vertex which gave to the current vertex its potential.

###
at line 97
```
boolean
```**isPassed**()

**isPassed**()

Returns whether the vertex has passed or not.

###
at line 106
```
```**markPassed**()

**markPassed**()

Marks this vertex as passed, meaning that, in the scope of a graph, he has already been processed in order to calculate its potential.

###
at line 119
```
boolean
```**setPotential**(integer $potential, VertexInterface $from)

**setPotential**(integer $potential, VertexInterface $from)

Sets the potential for the vertex, if the vertex has no potential or the one it has is higher than the new one.