def METHOD_NAME(self, f_name, e, n, *args, **kwargs):
    exact_used, solutions = self._do_call(f_name, e, n + 1, exact=False, *args, **kwargs)
    if exact_used is False and len(solutions) > n:
        if any(getattr(c, "variables", set()) & e.variables for c in self.constraints):
            _, _solutions = self._do_call(f_name, e, n + 1, exact=True, *args, **kwargs)
            return _solutions[:n] if len(_solutions) < len(solutions) else solutions[:n]
    return solutions[:n]