Module astar

Module astar 

Source
Expand description

A* search algorithm implementation

A* is an informed search algorithm that finds the least-cost path from a given initial node to a goal node. It uses a best-first search and finds the least-cost path to the goal.

A* uses a heuristic function to estimate the cost from the current node to the goal. The algorithm maintains a priority queue of nodes to be evaluated, where the priority is determined by f(n) = g(n) + h(n), where:

  • g(n) is the cost of the path from the start node to n
  • h(n) is the heuristic estimate of the cost from n to the goal

Structs§

AStarPlanner
A* search algorithm planner
ContinuousAStarPlanner
2D continuous space A* planner with polygon obstacles
GridAStarPlanner
Grid-based A* planner for 2D grids with obstacles
HashableFloat2D
A wrapper type for f64 arrays that implements Hash and Eq This allows using f64 arrays as keys in HashMaps
Node
A node in the search graph
Path
A path found by the A* algorithm

Functions§

euclidean_distance
Euclidean distance for n-dimensional points
euclidean_distance_2d
Euclidean distance heuristic for continuous 2D space
manhattan_distance
Manhattan distance heuristic for 2D grid-based pathfinding

Type Aliases§

HeuristicFn
Function that estimates the cost from a state to the goal
NeighborFn
Function that returns neighboring states and costs