I've built the proof of concept pre calculation mechanism.
This doesn't save anything yet and the structure the data will be saved in will probably be different.
The main idea is to prove I get sensible results.
I can then port the code to a new app.
I have a few ideas floating around about exactly how this will work.
As I explained, this thing will iterate (effectively) through the set of squares you see on a map.
It works out a good route from the centre of each square to the centre of every other square.
It records the route in terms of the squares it passes through.
And to check it's not doing stupid things I plugged this into the map editor and add a spot per square.
Here the start square is the top left one with the white spot.
Blue spots are squares the route passes through and the red spot is the target.

I kind of like this display so the final version might transmit a sample of what it's doing.
The map editor could then pick that up to visualise progress.
I've (obviously) hidden the fancy background here and places so I can see the spots easier.