4 ms·
Not to be pedantic, but where's the recursion? Seems like an instance of a common metaphor: while queue.hasElements(): element = queue.pop() e
by orijing 16y ago
Not to be pedantic, but where's the recursion?
Seems like an instance of a common metaphor:
while queue.hasElements():
element = queue.pop()
explore element if we haven't already
put element's successors into queue using some priority
- dminor 16y agoThere are two separate algorithms - the first one is recursive.
- endtime 16y agoA correct implementation of A* might look simple, and indeed it's not the most complicated algorithm out there, but I wouldn't dismiss it until you've read and understand the proof of its optimality.
- orijing 16y agoOf course, I've dealt with many search problems using A* (in particular, in the context of machine translation). I understand the algorithm and the proof of optimality. And I agree, the algorithm is very simple (not much different than uniform-cost search)--the complex part (in more general applications) is the heuristic function. I don't see where I dismissed A*.
- endtime 16y agoMaybe I misunderstood this: >Seems like an instance of a common metaphor That gave me the impression that A) it was new to you (due to the "seems to be") and that B) you weren't impressed ("common").