Implement an efficient algorithm to find the shortest path in a graph representing a warehouse layout.