code: def shortest_path_length(grid, start, finish):
      if start == finish:
          return 0
  
      path_grid = np.zeros(grid.shape, dtype=int)
      path_grid[start] = 1
      positions = [start]
  
      while positions:
          current = positions.pop(0)
          current_value = path_grid[current]
  
          for action in actions:
              next_coord = action(*current)
  
              if invalid_coordinate(grid, next_coord):
                  continue
  
              not_obstacle = grid[next_coord] != 1
              not_observed = path_grid[next_coord] == 0
  
              if not_obstacle and not_observed:
                  if next_coord == finish:
                      return current_value
  
                  path_grid[next_coord] = current_value + 1
                  positions.append(next_coord)
  
      # Impossible to generate path between two points
      return None
  
file_path: neupy/examples/reinforcement_learning/vin/evaluation.py
imports: from __future__ import division
  import numpy
  from tqdm import tqdm
  from neupy.utils import asfloat
label_desc: Use image node_id 2 for calling a global function with example usage: shortest_path_length(grid, start, finish) and returns: None, int, current_value