I'm messing around with this toy problem I came up with.
Say you have a yard that's 16 x 16 feet. Each square foot of the grid can either be a paving square for the path or a soil square for plants. A soil square can be either reachable or unreachable.
You can start the path from any square on the outside of the grid. That's the entrance and the exit of the yard and so you start and finish there.
From any paving square, you can reach any soil square that is north, east, south or west of the paving square; you can't reach the diagonal squares.
You can only walk on the path, not on soil squares.
You want a configuration that maximises the number of reachable soil squares with as few steps on each paving stone as possible. i.e. if you just had a spiral, you'd have to walk to the end of the spiral and back again which means every paving stone except the last gets stepped on twice.
In short, you want to go from the start square to the end square in as few moves as possible and reach as many soil squares as possible.
Here's the best solution I've found so far on paper:
In this solution, I can access 158 soil squares in only 91 steps. The score for this is 133.735. (scoring algorithm below)
Can you find a solution with either:
- more green squares and less steps, or
- more green squares and same steps, or
- same green squares and less steps?
In other words, if total steps taken is $s$ and total reachable green squares is $g$, then your score is
$\sqrt{s² + (256 - g)²}$
and the goal is the lowest score.
I've made a shared document on Google Sheets that you can copy and play with if you want to try this puzzle out. Feel free to write code to generate a solution too.