\GraphDS\VertexUndirectedVertex

Class defining an undirected vertex object.

Summary

Methods
Properties
Constants
__construct()
getValue()
setValue()
addNeighbor()
removeNeighbor()
getNeighbors()
adjacent()
$neighbors
No constants found
No protected methods found
$value
N/A
No private methods found
No private properties found
N/A

Properties

$neighbors

$neighbors : array

Array holding references to all neighboring vertices of this vertex.

Type

array

$value

$value : mixed

Variable holding the value of this vertex.

Type

mixed

Methods

__construct()

__construct() 

Constructor for general Vertex object.

getValue()

getValue() : mixed

Gets the value associated with this vertex.

Returns

mixed —

Value associated with this vertex

setValue()

setValue(mixed  $value = null) 

Sets the value associated with this vertex.

Parameters

mixed $value

Value to be associated with this vertex

addNeighbor()

addNeighbor(string  $vertex) 

Adds a neighboring, undirected vertex to this vertex.

Parameters

string $vertex

ID of vertex

removeNeighbor()

removeNeighbor(string  $vertex) 

Removes a neighboring, undirected vertex from this vertex.

Parameters

string $vertex

ID of vertex

getNeighbors()

getNeighbors() : array

Returns an array of all neighboring vertices of this vertex.

Returns

array —

Array of all neighboring vertices of this vertex

adjacent()

adjacent(string  $vertex) : boolean

Checks if a given vertex is adjacent to this vertex.

Parameters

string $vertex

ID of vertex

Returns

boolean —

Whether given vertex is adjacent to this vertex