def METHOD_NAME(y, return_mask=True):
    """Find the set of non-dominated points. If there are multiple duplicate non-dominated points, then only one will be included. The function assumes minimization and is adapted from https://stackoverflow.com/a/40239615 by adding a sorting step to improve efficiency.
    Args:
        y (array or list): Array or list of size (n_points, n_objectives)
        return_mask (bool, optional): Whether to return a mask or the actual indices of the non-dominated set. Defaults to True.
    Returns:
        array: If return_mask is True, this will be an (n_points, ) boolean array. Else it will be a 1-d integer array of indices indicating which points are non-dominated.
    """
    if np.ndim(y) == 1:
        y = np.asarray_chkfinite(y)[:, np.newaxis]
    elif np.ndim(y) == 2:
        y = np.asarray_chkfinite(y)
    else:
        raise ValueError("Expected y to be an array of size (n_points, n_objectives)")
    order = np.argsort(y.sum(axis=1))
    costs = y[order]
    n_points = y.shape[0]
    is_efficient = np.arange(n_points)
    idx = 0
    while idx < len(costs):
        nondominated_point_mask = np.any(costs < costs[idx], axis=1)
        nondominated_point_mask[idx] = True
        is_efficient = is_efficient[nondominated_point_mask]  # Remove dominated points
        costs = costs[nondominated_point_mask]
        idx = np.sum(nondominated_point_mask[:idx], dtype=int) + 1
    if return_mask:
        is_efficient_mask = np.zeros(n_points, dtype=bool)
        is_efficient_mask[is_efficient] = True
        is_efficient_mask[order] = is_efficient_mask.copy()
        return is_efficient_mask
    return order[is_efficient]