shortest walks script_re.gh (26.1 KB)
Instead of what I said, I’m copying Laurent’s idea from here: Shortest walk and straight going possible in grid? A*-algorithm : moving the building center up in Z+, it will artificially increase the path length, making it unsuitable for any other solution.