\GraphDS\VertexDirectedVertex

Class defining a directed vertex object.

Summary

Methods
Properties
Constants
__construct()
getValue()
setValue()
addInNeighbor()
removeInNeighbor()
getInNeighbors()
addOutNeighbor()
removeOutNeighbor()
getOutNeighbors()
getNeighbors()
getIndegree()
getOutdegree()
inAdjacent()
outAdjacent()
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 DirectedVertex 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

addInNeighbor()

addInNeighbor(string  $vertex) 

Adds a neighboring, incoming, directed vertex to this vertex.

Parameters

string $vertex

ID of the vertex

removeInNeighbor()

removeInNeighbor(string  $vertex) 

Removes a neighboring, incoming, directed vertex from this vertex.

Parameters

string $vertex

ID of the vertex

getInNeighbors()

getInNeighbors() : array

Returns an array of all incoming neighbor vertices.

Returns

array —

Array of all incoming neighbor vertices

addOutNeighbor()

addOutNeighbor(string  $vertex) 

Adds a neighboring, outgoing, directed vertex to this vertex.

Parameters

string $vertex

ID of the vertex

removeOutNeighbor()

removeOutNeighbor(string  $vertex) 

Removes a neighboring, outgoing, directed vertex from this vertex.

Parameters

string $vertex

ID of the vertex

getOutNeighbors()

getOutNeighbors() : array

Returns an array of all outgoing neighbor vertices.

Returns

array —

Array of all outgoing neighbor vertices

getNeighbors()

getNeighbors() : array

Returns an array of all neighboring vertices.

Returns

array —

Array of all neighboring vertices

getIndegree()

getIndegree() : integer

Returns the number of incoming neighbor vertices (indegree).

Returns

integer —

Number of incoming vertices

getOutdegree()

getOutdegree() : integer

Returns the number of outgoing neighbor vertices (outdegree).

Returns

integer —

Number of outgoing vertices

inAdjacent()

inAdjacent(string  $vertex) : boolean

Checks if a given vertex is an incoming neighbor of this vertex.

Parameters

string $vertex

ID of vertex

Returns

boolean —

Whether given vertex is an incoming neighbor of this vertex

outAdjacent()

outAdjacent(string  $vertex) : boolean

Checks if a given vertex is an outgoing neighbor of this vertex.

Parameters

string $vertex

ID of vertex

Returns

boolean —

Whether given vertex is an outgoing neighbor 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