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 (seevertex_index
).Raises an exception This class cannot be instantiated from Python
Methods
Return an iterator over all edges (both in or out).
Return an iterator over all neighbors (both in or out).
in_degree
([weight])Return the in-degree of the vertex.
Return an iterator over the in-edges.
Return an iterator over the in-neighbors.
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.
Return an iterator over the out-edges.
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 edgeEdgePropertyMap
, 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 edgeEdgePropertyMap
, 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.