Home > Optimization, Programming, Uncategorized > Project Euler 607

Project Euler 607

If you like solving Project Euler problems you should try Problem number 607. It’s not very hard, as it can be reduced to a small optimization problem. The idea is to find a path which minimizes time, knowing that certain regions correspond to different speeds. A precise statement of the result can be found on the official page. Here’s an image of the path which realizes the shortest time:



  1. Harshit
    June 16, 2017 at 8:46 pm


    Could you please give me a hint or any kind of advise on how to approach this?

    Would have been easy if there were only two type of regions, but 6 different regions give 6
    variables and i don’t think solving those giant partial differential equations is the way to go.


    • June 16, 2017 at 11:52 pm

      There is no giant PDE involved. There are indeed six variables and you can find the partial derivatives of the time needed to go from A to B with respect to any of them. This is called the gradient of the function. Then you use any gradient descent algorithm to find the path which gives minimal time.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: