Additional Work, 6/27/2017
Worked on speeding up the pathfinding algorithm. When the board reaches a few hundred squares, the algorithm bogs down. I tested the final part of the algorithm first: turning the best path into a track for the creeps to follow, which is highly iterative, but it took up a minuscule proportion of the time. Then, I tried to improve the time though the sort in the insert function (because the pathfinding algorithm keeps a sorted list of partial paths to work from), and although the algorithm significantly reduced the time it took to sort a random list of about the same size as the final path, when incorporated into the actual pathfinding algorithm, the time savings was nonexistent.
By observing the behavior of the best paths in randomly-generated boards, I can think of some ways to improve on the algorithm by reducing the amount of recursion, but that would limit how I set up the board.
Just for fun, here's a path on a 1000 square random test board.
Recursion depth: 691 :size: (50, 20) X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : X X X X : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X X X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X : : : : : : : : : : : : : : : : : : : X : : : : : : : : : : : : : : : : : : : X X X X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X X X : : : : : : : : : : : : : : : : : : : X X 78 - 79