code: def calculate_basic_cost(self, d1, d2):
          
          distance = euclidean_dist(d1.center, d2.center) / self.scale
  
          area_change = 1 - min(d1.area, d2.area) / max(d1.area, d2.area)
  
          return distance + self.parameters_cost_initial["area_weight"] * area_change
docs: Calculates assignment cost between two cells.