code: def apply_heuristic(self, node_a, node_b, heuristic=None):
          
          if not heuristic:
              heuristic = self.heuristic
          return heuristic(
              abs(node_a.x - node_b.x),
              abs(node_a.y - node_b.y))
docs: helper function to apply heuristic