Global variables for grid , minDistance and visited array
minDistance = [ [ 0 for i in range ( col + 1 ) ] for i in range ( row + 1 ) ] NEW_LINE visited = [ [ 0 for i in range ( col + 1 ) ] for i in range ( row + 1 ) ] NEW_LINE