⏱️ Lectura: 12 min

Bowser looks like the obvious choice in Mario Kart 8: he has more speed than almost any other character. But a fast driver who’s slow to recover after getting hit loses more races than he wins, and that’s exactly where intuition fails when choosing among thousands of possible combinations.

📑 En este artículo
  1. TL;DR
  2. Introduction
  3. What happened
  4. Background and history: what the Pareto frontier is
  5. Technical details and performance
  6. How to try it
  7. Impact and analysis
  8. What’s next
  9. Frequently Asked Questions
    1. What does it mean for an option to be Pareto-efficient?
    2. Does the Pareto frontier tell me which option is the best?
    3. How is it calculated with more than two metrics?
    4. Does it work for non-technical decisions?
    5. What’s the difference with a utility function?
    6. What happens if two options have exactly the same values?
  10. References

Developer Antoine Mayerowitz explained in a recent article how to apply the Pareto frontier, an early 20th-century concept, to solve this kind of decision involving multiple conflicting variables. The same logic works for choosing an AI model, a database architecture, or any technical trade-off.

TL;DR

  • The Pareto frontier identifies the options that no other point dominates across two or more metrics at once.
  • In Mario Kart 8, each driver, kart, tire set, and glider contributes its own stats for speed, acceleration, handling, weight, off-road, and mini-turbo.
  • A build is dominated when another one exists with an equal or better value across all metrics and a better value in at least one.
  • The concept was formalized by Italian economist Vilfredo Pareto in the early 20th century while studying resource allocation.
  • Calculating the frontier with two metrics costs O(n log n) by sorting along one axis, compared to O(n²) for comparing everything against everything.
  • The same algorithm works for choosing language models by cost and latency, or cloud instances by price and memory.
  • Libraries like DEAP implement NSGA-II for cases with more than three or four metrics in play.

Introduction

Choosing a character in Mario Kart 8 isn’t just about looks. Each driver, body, tire set, and glider contributes its own values for speed, acceleration, handling, weight, off-road traction, and mini-turbo. Multiply the dozens of options in each category and the number of possible combinations runs into the thousands.

Most of those combinations are noise: two different builds can share exactly the same stats and differ only in visual design. But even after removing those duplicates, there’s a real decision problem left with multiple variables competing against each other. Going faster almost always costs handling or acceleration. There’s no single correct answer, there’s a family of reasonable answers, and finding it by hand is impossible.

What happened

The article “Mario meets Pareto”, published by developer Antoine Mayerowitz on his personal blog, uses the game as an excuse to explain a concept every programmer should have in their toolbox: the Pareto frontier.

The example he uses is straightforward. Comparing only speed and acceleration, Koopa Troopa is ruled out without ambiguity: Cat Peach has more speed with the same acceleration, and Toadette has more acceleration with the same speed. There’s no scenario where choosing Koopa beats choosing either of the other two. In optimization terms, Koopa is dominated.

That reasoning, repeated character by character and kart by kart, makes it possible to automatically discard every objectively worse option without needing to decide beforehand how much speed should weigh against acceleration.

Background and history: what the Pareto frontier is

The concept is named after Italian economist Vilfredo Pareto, who in the early 20th century studied how to allocate resources among multiple parties without improving one party’s situation necessarily worsening another’s. An allocation is Pareto-efficient when no alternative exists that improves things for someone without harming someone else.

Outside economics, the same idea describes any situation where two or more conflicting goals must be optimized at the same time: a dish that’s cheap and tasty, a job that pays well and has flexible hours, a portfolio with low risk and high returns. In software engineering the pattern shows up constantly: a language model that’s fast and cheap, a database with fast reads and consistent writes, a container image that’s lightweight and has few vulnerabilities.

When you know beforehand the exact weight you’re giving each variable, the problem collapses into a single combined metric (a utility function) and you don’t need Pareto: you compare the final number and that’s it. The interesting case, and the one the Pareto frontier solves, is when those weights aren’t defined or change depending on context.

Technical details and performance

Formally, a point A dominates a point B if A is equal to or better than B across all metrics and strictly better in at least one. The Pareto frontier is the set of points that no other point dominates.

Calculating it by brute force, comparing every option against all the others, costs O(n²), which starts to hurt for a catalog of thousands of Mario Kart 8 builds, thousands of cloud instances, or hundreds of model checkpoints. For two dimensions there’s a shortcut: sort by one metric and walk the list once, keeping every point that improves on the best value seen so far in the second metric. That brings the cost down to O(n log n), dominated by the initial sort.

def pareto_front(options, key_x, key_y):
    ordenadas = sorted(options, key=lambda o: o[key_x], reverse=True)
    frontera = []
    mejor_y = float("-inf")
    for opcion in ordenadas:
        if opcion[key_y] > mejor_y:
            frontera.append(opcion)
            mejor_y = opcion[key_y]
    return frontera

builds = [
    {"nombre": "Koopa Troopa", "velocidad": 3, "aceleracion": 4},
    {"nombre": "Cat Peach", "velocidad": 4, "aceleracion": 4},
    {"nombre": "Toadette", "velocidad": 3, "aceleracion": 5},
    {"nombre": "Bowser", "velocidad": 6, "aceleracion": 2},
]

for build in pareto_front(builds, "velocidad", "aceleracion"):
    print(build["nombre"])

With this example dataset, the function discards Koopa Troopa (dominated by Cat Peach and Toadette) and returns Bowser, Cat Peach, and Toadette as the efficient frontier. None of the three is objectively better than the others: it depends on whether you prefer speed or recovery after getting hit.

With three metrics or more (speed, acceleration, handling, weight, off-road, and mini-turbo, as in Mario Kart 8), the sort-and-walk shortcut stops being enough, and you need to compare every pair of points, or turn to heuristics like those in DEAP, designed to explore large search spaces without full brute force.

Scatter plot showing the Pareto frontier between speed and acceleration
Dominated points fall below and to the left of the frontier. Foto de National Cancer Institute en Unsplash

ApproachWhen to use itAdvantageLimitation
Utility function (weighted sum)When you already know how much each metric weighsReturns a single best optionRequires defining the weights beforehand
Pareto frontier (sort and walk)Two metrics, unknown weightsO(n log n), no commitment to a weightDoesn’t pick a winner, only filters
Brute force (compare everything against everything)Few options or more than two metricsSimple to implement and verifyO(n²), doesn’t scale to large catalogs
NSGA-II and evolutionary heuristicsMany metrics and huge search spacesScales to high dimensionalityApproximate, more complex to tune

flowchart TD
A["Sort options by metric X descending"] --> B["Take the next option from the list"]
B --> C{"Does its metric Y beat the max seen so far?"}
C -->|"yes"| D["Add it to the frontier and update the max"]
C -->|"no"| E["Discard it, it is dominated"]
D --> F{"Options remaining?"}
E --> F
F -->|"yes"| B
F -->|"no"| G["Pareto frontier ready"]
💡 Tip: if your problem has more than three metrics, filter by Pareto first to shrink the catalog, and only then apply weights or manual judgment to the remaining subset.

How to try it

You don’t need to install anything to reproduce the example: the pareto_front function above is pure Python, no dependencies. Save it in a file called pareto.py and run it with whatever interpreter you already have installed.

# Windows (PowerShell)
python pareto.py

# macOS / Linux
python3 pareto.py

For a case closer to a software team’s day-to-day work, the same pattern works for filtering infrastructure options before deciding. This second example compares hypothetical instances by monthly cost (to minimize) and available memory (to maximize); flip the sign of the cost so the function keeps looking for “higher is better” on both axes:

instancias = [
    {"nombre": "t3.medium", "costo": 30, "memoria_gb": 4},
    {"nombre": "t3.large", "costo": 60, "memoria_gb": 8},
    {"nombre": "m5.large", "costo": 70, "memoria_gb": 8},
    {"nombre": "t3.xlarge", "costo": 120, "memoria_gb": 16},
]

for i in instancias:
    i["costo_invertido"] = -i["costo"]

frontera = pareto_front(instancias, "memoria_gb", "costo_invertido")
print([i["nombre"] for i in frontera])

m5.large falls outside the frontier in this example dataset because t3.large offers the same memory at a lower cost: it’s dominated. To confirm the filter didn’t drop anything by mistake, run the O(n²) brute-force version in parallel (comparing every instance against all the others with two nested loops) on the same dataset and verify with an assert that both resulting sets are identical.

Impact and analysis

Person comparing metrics of different technical options on a screen
Filtering by Pareto shrinks the catalog before deciding with judgment. Foto de Ousa Chea en Unsplash

The Pareto frontier doesn’t choose for you. It eliminates the objectively worse options and leaves you with a set where improving one metric necessarily means giving up another. Choosing within that set is still a human decision, informed by context: a team with a tight budget prioritizes cost, one with a strict SLA prioritizes latency.

The practical advantage over fixing weights beforehand is that you don’t have to commit to a formula before seeing the data. You can calculate the frontier, look at the three or four options that survived, and only then discuss with the team which one makes sense given the current priority. It’s easier to defend “we chose among these three efficient alternatives” than “we chose the one that scored highest on a formula we made up yesterday.”

There’s a real limitation worth knowing before applying this blindly: as the number of dimensions grows (more than three or four simultaneous metrics), the fraction of points that remain in the frontier tends to grow too. It’s the curse of dimensionality applied to multi-objective optimization: with too many metrics, almost no option dominates another across the board, and the filter loses its power to discard. In those cases it helps to group related metrics into a composite score before calculating the frontier, or to accept that human judgment is needed for the final two or three options.

⚠️ Careful: with more than three or four metrics at once, the Pareto frontier can end up including almost the entire catalog and lose its usefulness as a filter.

What’s next

Comparing options across more than one metric at once is already common in dashboards that evaluate language models by cost and quality simultaneously, instead of a single ranking. The same approach can be applied to any team’s internal catalog: library versions, build configurations, index types in a database. The Pareto frontier doesn’t require new infrastructure or a specific tool: it’s a function under ten lines long that any team can run on its own comparison table before the next technical decision.

📖 Summary on Telegram: View summary

Try it yourself: copy the pareto_front function from this article, plug in the cost and latency of the options you’re evaluating this week, and see how many survive the filter.

Frequently Asked Questions

What does it mean for an option to be Pareto-efficient?

That no other option in the set is equal to or better across all metrics and strictly better in at least one. If such an option exists, the first one is dominated and gets discarded.

Does the Pareto frontier tell me which option is the best?

No. It narrows the set down to the options worth considering, but choosing one of them depends on how much each metric matters for your case, something only you or your team can define.

How is it calculated with more than two metrics?

The single sort-and-walk shortcut only works with two dimensions. With three or more, you need to compare every option against all the others, or use heuristics like NSGA-II when the catalog is very large.

Does it work for non-technical decisions?

Yes. Antoine Mayerowitz’s original article also applies it to choosing food, a job, or an investment portfolio: any decision with two or more conflicting goals is a candidate.

What’s the difference with a utility function?

A utility function combines the metrics into a single number using predefined weights and directly gives you a winner. The Pareto frontier doesn’t require those weights: it just eliminates the objectively worse options and leaves the rest for you to decide.

What happens if two options have exactly the same values?

Neither dominates the other because neither is strictly better at anything, so both remain within the frontier. The choice between them then comes down to another criterion, like personal preference or availability.

References

  • Mario meets Pareto: the original article by Antoine Mayerowitz that inspired this piece, featuring an interactive visualization of Mario Kart 8 builds.
  • Pareto efficiency, Wikipedia: formal definition and examples of the concept of Pareto efficiency in economics.
  • Multi-objective optimization, Wikipedia: overview of algorithms and applications of optimization with multiple objectives.
  • DEAP: a Python framework with implementations of NSGA-II and other multi-objective evolutionary algorithms.

📱 Do you like this content? Follow @programacion on Telegram for daily tech content in Spanish: quick summaries, fresh content every day.

Imagen destacada: Foto de Trnava University en Unsplash

Categories: Noticias Tech

Andrés Morales

Developer and AI researcher. Writes about language models, frameworks, developer tooling, and open source releases. Covers ML papers, the tech startup ecosystem, and programming trends.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.