graph_tool.Edge#

class graph_tool.Edge#

Bases: instance

Edge descriptor.

This class represents an edge in a Graph.

Edge instances are hashable, iterable and thus are convertible to a tuple, which contains the source and target vertices.

Raises an exception This class cannot be instantiated from Python

Methods

is_valid

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

source

Returns the source of the edge (a Vertex instance).

target

Returns the target of the edge (a Vertex instance).

is_valid()#

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

source()#

Returns the source of the edge (a Vertex instance).

target()#

Returns the target of the edge (a Vertex instance).