code: function estimateCost(from, endPoints) {
  
          var min = Infinity;
  
          for (var i = 0, len = endPoints.length; i < len; i++) {
              var cost = from.manhattanDistance(endPoints[i]);
              if (cost < min) min = cost;
          }
  
          return min;
      }
docs: heuristic method to determine the distance between two points