shortest-path
Version:
A TypeScript library that implements the A* (A-star) pathfinding algorithm to find the shortest path on a grid.
10 lines • 492 B
TypeScript
import { Grid, Position } from './types';
/**
* Find the shortest path between two points in a grid using the A* algorithm.
* @param grid The grid to search. Numbers represent walkable cells, null represents obstacles.
* @param start The starting position.
* @param end The ending position.
* @returns The shortest path as an array of positions.
*/
export declare function shortestPath(grid: Grid, start: Position, end: Position): Position[];
//# sourceMappingURL=shortest-path.d.ts.map