Sunday, October 05, 2008

Once more with feeling… — A-star shortest path finder in Erlang

The same problem as in the previous post, only this time in Erlang:

Where I know that a recursion will be shallow, by construction, I've not attempted to write everything tail-recursively; that I've kept in the main A* algorithm, which should be generic enough to extract, and provide with extra function arguments.

The obvious effects of having to avoid state, with recursion rather than iteration, are more code and longer argument lists to the recursions. Still, an interesting exercise in rewriting the code, changing the way one thinks about the processing.


Of course, now I've had a comment, I can't just refactor in place, like I've done with the Python…

Post a Comment