Finished shortest path problem in erlang.