Landmark.edges#

Landmark.edges() → list[Edge]#

The edges at the vertex, in the order they were connected

Returns:

the edges at this vertex

Return type:

list of Edge

For a directed graph these are the edges leaving this vertex. For an undirected graph they are the edges incident on it, whichever end it is. A self-loop in an undirected graph is listed twice, once for each end.

The list is a new one on every call, in the order the edges were connected, so changing it does not change the graph, and edges can be removed from the graph while iterating over it. Use Graph.remove_edge to remove one.

>>> 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)
Edge{[v1] -- [v2], cost=1.414}
>>> print(v1.edges())
[Edge{[v1] -- [v2], cost=1.414}]
Seealso:

out_edges in_edges adjacent incidences edges_to degree Graph.edges