graph_tool.Vertex#

class graph_tool.Vertex#

Bases: instance

Vertex descriptor.

This class represents a vertex in a Graph instance.

Vertex instances are hashable, and are convertible to integers, corresponding to its index (see vertex_index).

Raises an exception This class cannot be instantiated from Python

Methods

all_edges()

Return an iterator over all edges (both in or out).

all_neighbors()

Return an iterator over all neighbors (both in or out).

in_degree([weight])

Return the in-degree of the vertex.

in_edges

Return an iterator over the in-edges.

in_neighbors()

Return an iterator over the in-neighbors.

is_valid

Returns True if the descriptor corresponds to an existing vertex in the graph, False otherwise.

out_degree([weight])

Return the out-degree of the vertex.

out_edges

Return an iterator over the out-edges.

out_neighbors()

Return an iterator over the out-neighbors.

all_edges()#

Return an iterator over all edges (both in or out).

all_neighbors()#

Return an iterator over all neighbors (both in or out).

in_degree(weight=None)#

Return the in-degree of the vertex. If provided, weight should be a scalar edge EdgePropertyMap, and the in-degree will correspond to the sum of the weights of the in-edges.

in_edges()#

Return an iterator over the in-edges.

in_neighbors()#

Return an iterator over the in-neighbors.

is_valid()#

Returns True if the descriptor corresponds to an existing vertex in the graph, False otherwise.

out_degree(weight=None)#

Return the out-degree of the vertex. If provided, weight should be a scalar edge EdgePropertyMap, and the out-degree will correspond to the sum of the weights of the out-edges.

out_edges()#

Return an iterator over the out-edges.

out_neighbors()#

Return an iterator over the out-neighbors.