Computer scienceAlgorithms and Data StructuresAlgorithmsGraph algorithmsShortest path algorithms

Shortest path problem

Maze runner

Report a typo

John is trying to reach the finish line as fast as possible. However, he rarely exercises, therefore it is impossible for him to jump over the barriers. Assume that, for some reason, John can go only up, down, left, or right. The length of a path from start to finish is the number of cells in this route, including the source and target cells.

Shortest path problem illustration

What is the length of the shortest route from start to finish?

Enter a number
___

Create a free account to access the full topic