Package org.graph4j.shortestpath
Class AStarManhattanEstimator
java.lang.Object
org.graph4j.shortestpath.AStarManhattanEstimator
- All Implemented Interfaces:
AStarEstimator
Manhattan distance.
- Author:
- Cristian Ivan, Cristian Frăsinaru
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleestimate(int vertex, int target) Estimates the cost to reach the target from the given node.
-
Constructor Details
-
AStarManhattanEstimator
public AStarManhattanEstimator(int gridSize)
-
-
Method Details
-
estimate
public double estimate(int vertex, int target) Description copied from interface:AStarEstimatorEstimates the cost to reach the target from the given node.- Specified by:
estimatein interfaceAStarEstimator- Parameters:
vertex- The current vertex index.target- The target vertex index.- Returns:
- The estimated cost to reach the target.
-