This article shows how to use Dijkstra's algorithm to solve the tridimensional problem stated below.
Dijkstra's algorithm - Wikipedia
Actually, this is a generic solution where the speed inside the holes is a variable. The original problem is a particular case where this speed goes to...