Applies Dijkstra's shortest path algorithm to a snakes and ladders game.