سؤال

I was reading some literature regarding the Greedy Best First Search I encountered many times the road map of Romania as an example application (see here on slide 5) .

It is often stated, that the greedy best-first search algorithm can get stuck in loops. This seems logical to me. However, as an example the loop Iasi -> Neamt -> Iasi ... is given (slide 11). I don't see why, because the used heuristic (straight line distance) yields a larger value for Iasi then for the other neighbor of Neamt.

First I thought this is an error, but I found multiple sources giving this loop as example. What am I getting wrong?

EDIT: The goal in these examples is usually to get to Bucharest

هل كانت مفيدة؟

المحلول

It depends on where you are going. The loop would occur if you were going e.g. to Arad. If you are in Iasi, the Neamt is the node which is (heuristicaly) closest out of Iasi's neighbors. Neamt has only one neighbor (and it is not arad), so you always get back to Iasi.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top