Solving a maze with Bellman's equation

Bellman's equation

Value iteration

Maze

Matrices

i_goal=?, j_goal=?

Outputs