shortest path by road using foldl