Skip to main content

Module dijkstra

Module dijkstra 

Source
Expand description

Weighted-grid Dijkstra baseline. Static-grid [Pathfinder]: weighted 4-connected Dijkstra.

Each search is independent and returns the standard invalid/found/no-path outcome. Cost sums per-cell traversal_cost with no heuristic, making this the weighted correctness baseline. Prefer [super::astar::AStar] for the normal one-shot weighted entrypoint.

§Examples

use condor_grid::{Dijkstra, Grid, Pathfinder, Point, SearchRequest};

let grid = Grid::new(5, 1).expect("grid dimensions are valid");
let request = SearchRequest::new(Point::new(0, 0), Point::new(4, 0));
let result = Dijkstra.search(&grid, request).expect("endpoints are walkable");
assert!(result.is_found());
assert_eq!(result.cost(), Some(4));

Structs§

Dijkstra
Weighted-grid Pathfinder: uniform-priority Dijkstra.