|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
A* shortest path algorithm. More...
#include <cmath>#include <iostream>#include <ahFunction.H>#include <ah-errors.H>#include <archeap.H>#include <tpl_find_path.H>#include <tpl_agraph.H>#include <shortest_path_common.H>Go to the source code of this file.
Classes | |
| struct | Aleph::Zero_Heuristic< GT, Distance > |
| Default heuristic for A* (zero heuristic, degrades to Dijkstra). More... | |
| class | Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT > |
| A* algorithm for finding the shortest path between two nodes. More... | |
| struct | Aleph::Euclidean_Heuristic< GT, Distance > |
| Euclidean distance heuristic for A* in 2D grids. More... | |
| struct | Aleph::Manhattan_Heuristic< GT, Distance > |
| Manhattan distance heuristic for A* in grid graphs. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Macros | |
| #define | ANassert(p) (static_cast<Node_Info*>(NODE_COOKIE(p))) |
| #define | ATREENODE(p) (static_cast<Tree_Node_Info*>(NODE_COOKIE(p))->tree_node) |
| #define | AACC(p) (ANassert(p)->dist) |
| #define | AHEAPNODE(p) (ANassert(p)->heap_node) |
| #define | APARENT(p) (ANassert(p)->ret_node) |
| #define | AAassert(p) (static_cast<Arc_Info*>(ARC_COOKIE(p))) |
| #define | AARC_DIST(p) (Distance()(p)) |
| #define | ATREEARC(p) (static_cast<Tree_Arc_Info*>(ARC_COOKIE(p))->tree_arc) |
| #define | APOT(p) (AAassert(p)->pot) |
A* shortest path algorithm.
Implements the A* algorithm for finding the shortest path between two vertices in a weighted graph using a heuristic function. The algorithm uses f(n) = g(n) + h(n) where g(n) is the cost from start and h(n) is the heuristic estimate to the goal. Uses binary heap for O((V+E)log V).
The heuristic must be admissible (never overestimate) for optimal paths.
When no goal is specified (e.g., compute_min_paths_tree), the algorithm behaves like Dijkstra's algorithm (zero heuristic).
Definition in file AStar.H.
| #define AAassert | ( | p | ) | (static_cast<Arc_Info*>(ARC_COOKIE(p))) |
| #define ANassert | ( | p | ) | (static_cast<Node_Info*>(NODE_COOKIE(p))) |
| #define ATREEARC | ( | p | ) | (static_cast<Tree_Arc_Info*>(ARC_COOKIE(p))->tree_arc) |
| #define ATREENODE | ( | p | ) | (static_cast<Tree_Node_Info*>(NODE_COOKIE(p))->tree_node) |