pub fn find_path<H>(
graph: &Graph,
start: usize,
goal: usize,
heuristic: H,
) -> Option<(f64, Vec<usize>)>Expand description
Finds shortest path from start to goal using A* algorithm
§Arguments
graph- The input graphstart- Starting nodegoal- Goal nodeheuristic- Admissible heuristic function h(n) estimating cost from n to goal
§Returns
Option containing (cost, path) if a path exists
§Requirements
The heuristic must be admissible (never overestimate) and consistent for optimality