ViewPoint.connect#

ViewPoint.connect(other, **kwargs)#

Connect two vertices with an edge

Parameters:
  • dest (Vertex subclass) – The vertex to connect to

  • edge (Edge subclass, optional) – Use this as the edge object, otherwise a new Edge object is created from the vertices being connected, and the cost and edge parameters, defaults to None

  • cost (float, optional) – the cost to traverse this edge, defaults to None

  • data (Any, optional) – reference to arbitrary data associated with the edge, defaults to None

Raises:

TypeError – vertex types are different subclasses

Returns:

the edge connecting the vertices

Return type:

Edge

v1.connect(v2) connects vertex v1 to vertex v2.

Note

  • If the vertices subclass UVertex the edge is undirected, and if they subclass DVertex the edge is directed.

  • Vertices must both be of the same Vertex subclass

Seealso:

Edge