I found an article with algorithms as problems and this one particular problem seemed to intrigue me but I'm not sure how I would solve it. My first initial thought was to use Dijkstra's algorithm to solve it but I don't even know where to begin even with using that. Can anyone guide me through the problem so I can see how these types of problems are solved?

Thank you very much.

Here's the problem:
Name:  4.jpg
Views: 1070
Size:  52.4 KB