So How do we find the best Path?  Computer Science at last.
A Curve is a path through the grid.
Cost depends on each step of the path.
We want to minimize cost.