yog/pathfinding/utils
Shared types and utilities for pathfinding algorithms.
Types
Values
pub fn compare_a_star_frontier(
a: #(e, e, List(Int)),
b: #(e, e, List(Int)),
cmp: fn(e, e) -> order.Order,
) -> order.Order
pub fn compare_distance_frontier(
a: #(e, Int),
b: #(e, Int),
cmp: fn(e, e) -> order.Order,
) -> order.Order
pub fn compare_frontier(
a: #(e, List(Int)),
b: #(e, List(Int)),
cmp: fn(e, e) -> order.Order,
) -> order.Order
pub fn should_explore_node(
visited: dict.Dict(k, e),
node: k,
new_dist: e,
compare: fn(e, e) -> order.Order,
) -> Bool
Helper to determine if a node should be explored based on distance comparison. Returns True if the node hasn’t been visited or if the new distance is shorter.