Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ManhattanHeuristic Struct Reference

Manhattan distance heuristic. More...

Public Types

using Distance_Type = double
 

Public Member Functions

Distance_Type operator() (GridGraph::Node *from, GridGraph::Node *to) const
 

Detailed Description

Manhattan distance heuristic.

Computes taxi-cab distance (only horizontal/vertical moves). Optimal for 4-connected grids where diagonal movement is not allowed. h(n) = |x2-x1| + |y2-y1|

Definition at line 192 of file astar_example.cc.

Member Typedef Documentation

◆ Distance_Type

Member Function Documentation

◆ operator()()

Distance_Type ManhattanHeuristic::operator() ( GridGraph::Node from,
GridGraph::Node to 
) const
inline

Definition at line 196 of file astar_example.cc.

References abs(), and Aleph::maps().


The documentation for this struct was generated from the following file: