When candidates trade quality for cost, a single ranking can discard useful options. Candidate A dominates B if A is at least as good on every objective and strictly better on at least one; B can then be dropped without sacrificing a trade-off. section 4.2.3
Remove every dominated candidate and the survivors form the Pareto front: the undominated options, each best for some trade-off. Keeping the front preserves choices that a single ranked winner would lose. section 4.2.3
Quality versus cost
Among five candidates, A, B, and C remain on the front; D and E are dominated and dropped. The survivors form a staircase of trade-offs between quality and cost. section 4.2.3
Listing 4.4 The domination test and the front (02_pareto_demo.py)
# (name, quality: higher is better, cost: lower is better)
CANDIDATES = [("A", 0.90, 9), ("B", 0.80, 4), ("C", 0.60, 2),
("D", 0.70, 9), ("E", 0.50, 5)]
def dominates(x, y) -> bool: #A
at_least_as_good = x[1] >= y[1] and x[2] <= y[2]
strictly_better = x[1] > y[1] or x[2] < y[2]
return at_least_as_good and strictly_better
def pareto_front(candidates): #B
return [c for c in candidates
if not any(dominates(o, c) for o in candidates
if o is not c)]The code implements the two-part test—at least as good on both objectives, strictly better on one—and keeps candidates that no other candidate dominates. section 4.2.3
