hiperwalk.Graph.neighbors#

Graph.neighbors(vertex)[source]#

Return all neighbors of the given vertex.

This method retrieves all vertices adjacent to the specified vertex. If the graph allows loops, the vertex may also be considered its own neighbor if such an edge exists.

Parameters:
vertexint

The vertex for which neighbors are to be found.

Returns:
list of int:

The neighbors of vertex. The order of the neighbors may vary based on the graph’s internal representation.

Notes

The specific order of the neighbors in the returned list is not guaranteed and may change if the underlying graph structure is modified.