Search 搜索启发式:位置列表中所有下一个最近位置的总和。容许的

Search 搜索启发式:位置列表中所有下一个最近位置的总和。容许的,search,heuristics,Search,Heuristics,让我们以一个问题为例,它涉及一个起始位置和一个其他位置的列表。目标是到达所有这些地点 所有其他位置均可访问所有位置 搜索启发式: total_distance while locations.has_next(): find distance to nearest location new_location = location_chosen total_distance += distance 这是不允许的,对吗?只是检查一下我对这个术语的理解 例如: start =

让我们以一个问题为例,它涉及一个起始位置和一个其他位置的列表。目标是到达所有这些地点

所有其他位置均可访问所有位置

搜索启发式:

total_distance
while locations.has_next():
    find distance to nearest location
    new_location = location_chosen
    total_distance += distance
这是不允许的,对吗?只是检查一下我对这个术语的理解

例如:

start = (0,0)
nodeA = (0,2)
nodeB = (0,4)
nodeC = (0,-3)
所以这会导致

start > nodeA > nodeB > nodeC = 2 + 2 + 7 = 11,
而不是

start > nodeC > nodeA > nodeB = 3 + 5 + 2 = 10