pub fn astar<H>(
store: &LpgStore,
source: NodeId,
target: NodeId,
weight_property: Option<&str>,
heuristic: H,
) -> Option<(f64, Vec<NodeId>)>Expand description
Runs A* algorithm with a heuristic function.
§Arguments
store- The graph storesource- Starting node IDtarget- Target node IDweight_property- Optional property name for edge weightsheuristic- Function estimating cost from node to target (must be admissible)
§Returns
The shortest path distance and path, or None if unreachable.
§Complexity
O(E) in the best case with a good heuristic, O((V + E) log V) in the worst case.