Landmark.heuristic_distance#

Landmark.heuristic_distance(v2: Vertex) → float#

Heuristic distance to another vertex

Parameters:

v2 (Vertex subclass) – the other vertex

Returns:

heuristic distance between this vertex and v2

Return type:

float

Distance is computed according to the graph’s heuristic, see Graph.heuristic. The vertex must belong to a graph, since the heuristic is a property of the graph, not the vertex.

>>> from pgraph import UGraph
>>> g = UGraph()
>>> v1 = g.add_vertex(coord=[1, 2], name='v1')
>>> v2 = g.add_vertex(coord=[4, 3], name='v2')
>>> print(v1.heuristic_distance(v2))
3.1622776601683795
Seealso:

distance Graph.heuristic