return is_efficient

def is_pareto_efficient(costs):
    """
    :param costs: An (n_points, n_costs) array
    :return: A (n_points, ) boolean array, indicating whether each point is Pareto efficient
    """
is_efficient = np.ones(costs.shape[0], dtype=bool)
for i, c in enumerate(costs):
    if is_efficient[i]:
        is_efficient[is_efficient] = np.any(costs[is_efficient] <= c, axis=1)
return is_efficient
Fast calculation of Pareto front in Python