class Graph implements GraphInterface (View source)

Properties

protected array $vertices All the vertices in the graph

Methods

add(VertexInterface $vertex)

Adds a new vertex to the current graph.

getVertex(mixed $id)

Returns the vertex identified with the $id associated to this graph.

Array
getVertices()

Returns all the vertices that belong to this graph.

Details

GraphInterface add(VertexInterface $vertex)

Adds a new vertex to the current graph.

Parameters

VertexInterface $vertex

Return Value

GraphInterface

Exceptions

Exception

VertexInterface getVertex(mixed $id)

Returns the vertex identified with the $id associated to this graph.

Parameters

mixed $id

Return Value

VertexInterface

Exceptions

Exception

Array getVertices()

Returns all the vertices that belong to this graph.

Return Value

Array