welcome guest
login or register

Add new reply

Speaking of details; the exact scenario was like this: I was working with this kind of a map, but it had a ford in the river branch after ford A. So I was able to approach ford E from south-west. After crossing ford E, my algorithm went onwards until hitting the next branch of river. And from that point the algorithm went following the river both up and down - looking for a closest ford. Well, going upwards, following every curve of the river the algorithm found ford D and decided to cross it...

Actually, to be sure, I wrote a small area recognition algorithm, West from fords D and E is area X, and to the east there is area Y, and behind ford F there is area Z. Now, when picking a ford to cross, I can use heuristic rule: "does this ford take me back to the area I was before, or does this take me to a new area?" and this way avoid going into a loop.

But reading your description I think I could drop the area recognition and use a loop detection instead. If the algorith finds that it is crossing a same ford it has already crossed, it would mark the route as dead end and take steps back, going to test the next alternatives. Let's see =)

CAPTCHA
Please reply with a single word.
Fill in the blank.