Want algorithm to find shortest path in grid which 3*3 dimension
We can easily solve this problem by using recursion. The idea is to start from the top-left cell of the matrix and recur for the next node (immediate right or immediate bottom cell) and keep on doing that for every visited cell until the destination is reached. Also maintain a path array to store the nodes in the current path and update the path array (including the current node) whenever any cell is visited. Now, whenever the destination (bottom-right corner) is reached, print the path array.
I need a help on below image I want to achieve below logic in Python and I am newbie in Python.
[![I need a help on below image I want to achieve below logic in Python and I am newbie in Python.][1]][1]
Any help is appreciated.