diff options
| author | Andreas Grois <andi@grois.info> | 2025-10-12 18:27:10 +0200 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2025-10-12 18:27:10 +0200 |
| commit | 973225b1c5ed10f2a99374c91a9d6a957067f654 (patch) | |
| tree | 780648c7765a77ef352705ed2e15679fe582c97c /LeanAStar/Basic.lean | |
| parent | 2402a88a863e41f5bceefcdc13323ef609809a8a (diff) | |
Lean 4.19
Diffstat (limited to 'LeanAStar/Basic.lean')
| -rw-r--r-- | LeanAStar/Basic.lean | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/LeanAStar/Basic.lean b/LeanAStar/Basic.lean index a2920f1..f4b972e 100644 --- a/LeanAStar/Basic.lean +++ b/LeanAStar/Basic.lean @@ -143,7 +143,7 @@ protected instance {α : Type u} [AStarNode α Costs] [LawfulBEq α] : LawfulBEq def findLowestCosts {α : Type u} [AStarNode α Costs] [Add Costs] [LawfulBEq α] (starts : List (StartPoint (α := α))) : Option Costs := let openSet := BinaryHeap.ofList ⟨OpenSetEntry.le_trans, OpenSetEntry.le_total⟩ $ starts.map λ{start, initial_costs}↦ {node := start, accumulated_costs := initial_costs, estimated_total_costs:= AStarNode.remaining_costs_heuristic start : LeanAStar.OpenSetEntry α} - LeanAStar.findPath_Aux openSet Std.HashSet.empty + LeanAStar.findPath_Aux openSet Std.HashSet.emptyWithCapacity /-- Helper to not only get the lowest costs, but also the shortest path. Could be implemented more efficient. -/ def findShortestPath {α : Type u} [AStarNode α Costs] [Add Costs] [LawfulBEq α] (starts : List (StartPoint (α := α))) : Option (Costs × List α) := |
