def aStarSearch(problem, heuristic=nullHeuristic):
"Search the node that has the lowest combined cost and heuristic first."
# Use the genericSearch method, with the fringe maintained with a
# PriorityQueue. The cost is calculated using the provided heuristic.
# If no heuristic is given (such as UCS), then default to the given
# nullHeuristic
return genericSearch(problem, util.PriorityQueue(), heuristic)
# Abbreviations
评论列表
文章目录