today Patrick wait visit friend Spongebob to prepare visit Patrick need buy goody store locate near house there d1 meter long road house shop d2 meter long road house second shop also road length d3 directly connect shop help Patrick calculate minimum distance need walk order shop return house Patrick start house he visit shop move exist road return house he do not mind visit shop pass road multiple time the goal minimize total distance travel