shortest path implementation
merge conflict