Shortest path in a graph with walls