Landmark.edgeto#

Landmark.edgeto(dest: Vertex) → Edge#

The edge from this vertex to an adjacent vertex

Parameters:

dest (Vertex subclass) – an adjacent vertex

Raises:

ValueError – dest is not adjacent to this vertex

Returns:

the edge from this vertex to dest

Return type:

Edge

Note

  • For a directed graph dest must be at the arrow end of the edge

  • If there are parallel edges to dest the cheapest is returned (the first, if none of them has a cost)

>>> from pgraph import UGraph
>>> g = UGraph()
>>> v1 = g.add_vertex(coord=[0,0], name='v1')
>>> v2 = g.add_vertex(coord=[1,1], name='v2')
>>> g.add_edge(v1, v2, cost=1.414)
Edge{[v1] -- [v2], cost=1.414}
>>> print(v1.edgeto(v2))
Edge{[v1] -- [v2], cost=1.414}
Seealso:

edges_to incidences adjacent