def first_failing(conflict_set_size, crs, continuous: false, max_iterations: nil)
      min_idx = conflict_set_size
      max_idx = crs.nb_constraints - 1

      loop do
        unless max_iterations.nil?
          return min_idx..max_idx if max_iterations <= 0
          max_iterations -= 1
        end
        half_constraint_idx = (max_idx + min_idx) / 2
        # puts "Refining: [#{min_idx}:#{max_idx}] -> #{half_constraint_idx}"
        crs2 = crs.restrict_to_n_constraints(half_constraint_idx + 1)
        problem = Problem.from_compressed_row_storage(crs2, continuous: continuous)
        if infeasible?(problem)
          max_idx = half_constraint_idx
          # puts "                                INFEAS"
        else
          min_idx = half_constraint_idx + 1
          # puts "                                FEAS"
        end
        next if max_idx != min_idx
        return nil if max_idx > crs.nb_constraints
        return min_idx..max_idx
      end
      # Shouldn't come here if the whole problem is infeasible
      nil
    end
def first_failing(conflict_set_size, crs, continuous: false, max_iterations: nil)
      min_idx = conflict_set_size
      max_idx = crs.nb_constraints - 1

      loop do
        unless max_iterations.nil?
          return min_idx..max_idx if max_iterations <= 0
          max_iterations -= 1
        end
        half_constraint_idx = (max_idx + min_idx) / 2
        # puts "Refining: [#{min_idx}:#{max_idx}] -> #{half_constraint_idx}"
        crs2 = crs.restrict_to_n_constraints(half_constraint_idx + 1)
        problem = Problem.from_compressed_row_storage(crs2, continuous: continuous)
        if infeasible?(problem)
          max_idx = half_constraint_idx
          # puts "                                INFEAS"
        else
          min_idx = half_constraint_idx + 1
          # puts "                                FEAS"
        end
        next if max_idx != min_idx
        return nil if max_idx > crs.nb_constraints
        return min_idx..max_idx
      end
      # Shouldn't come here if the whole problem is infeasible
      nil
    end
finds the first constraint from constraints that makes the problem infeasible