HeuristicPolicyEuclidSquared()

Class for representing a heuristic for graph search algorithms based on the squared euclidean distance. The heuristic assumes that the node have a position property of type Vector3.

new HeuristicPolicyEuclidSquared()

Author:

Methods

static calculate(graph, source, target) → {Number}

Calculates the squared euclidean distance between two nodes.

Parameters:
Name Type Description
graph Graph

The graph.

source Number

The index of the source node.

target Number

The index of the target node.

Returns:
Number -

The squared euclidean distance between both nodes.