Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. Real-world decisions often involve conflicting objectives, like boosting sales while avoiding overstock. In this episode, we explore how multi-objective optimization (using NSGA-II with the pymoo library) can model and solve such dilemmas. You'll learn: * Why traditional dispatch strategies fall short * How Pareto fronts reveal optimal trade-offs * How to apply ASF and Pseudo-Weights to guide final decisions If you’d rather read than listen, the full article (with code, charts, and detailed examples) is available on Substack: 👉 Like this kind of content? Subscribe to get future articles and episodes delivered straight to your inbox as soon as they’re published. Get full access to The AI Practitioner at aipractitioner.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_00Welcome to the deep dive. Ever get stuck trying to hit two targets that just won't align? Think about retail dispatch. You want more sales, obviously, but you also really need to keep overstock down. Often people try to, you know, mash these into one goal with fixed weights, but that feels, well, a bit too simple sometimes, doesn't it?
SPEAKER_01It really does. It glosses over the real tradeoffs. And that's exactly where multi-objective optimization comes in, offering a much more sophisticated way.
SPEAKER_00Sophisticated how? Well, instead of forcing everything into one number, it looks at each goal separately.
SPEAKER_01So you don't get just one answer. You get a whole map of possibilities, these optimal tradeoffs. We call it the Pareto front.
SPEAKER_00The Pareto front. And this map, it empowers you, the decision maker, to see the real costs and benefits. You can pick the strategy that fits your current priorities, whatever they might be, Okay, a map of choices sounds way better than just one fixed point. But how do we actually find this Pareto front, especially when things get complicated? Today, we're going to dive into exactly that modeling and solving these problems using PyMOO, a Python library, and we'll focus on NSGA2. Is that right?
SPEAKER_01That's right, NSGA2, Non-Dominated Sorting Genetic Algorithm to Second. It's a popular one.
SPEAKER_00So why do those simpler dispatch methods often miss the mark?
SPEAKER_01Well, a few big reasons. First, they tend to ignore uncertainty. I mean, demand forecasts, they're never perfect. You often see errors of, what, 10, 20 percent? Easily.
SPEAKER_00Right. Like a sudden heat wave boosting ice cream sales or a storm hitting raincoat demand.
SPEAKER_01Exactly. A rigid plan just can't adapt. And second, they ignore the really critical tradeoffs. Say you're short on stock. A simple plan might send it all to the highest forecast store, but maybe you need some stock in your flagship store for visibility, even if its forecast is lower.
SPEAKER_00So the fixed plan lacks flexibility.
SPEAKER_01Totally. And just sticking objectives together with random weights. You get one solution and you have no real clue how much you sacrificed one goal to get a bit more of the other.
SPEAKER_00OK, so let's embrace the multi-objective way. How do we set up the problem then, especially with that demand uncertainty you mentioned?
SPEAKER_01Good question. For retail dispatch, the main goals are usually maximizing expected sales and minimizing expected overstock. Notice the word expected.
SPEAKER_00Because demand isn't fixed.
SPEAKER_01Precisely. We treat demand as probabilistic. So it becomes a stochastic optimization problem. You run simulations, maybe say 100 different demand scenarios, each reflecting potential variations, maybe with a 35% relative error, just as an example.
SPEAKER_00100 scenarios.
SPEAKER_01Yeah. And then you average the outcomes, the sales, the overstock across all those scenarios. This gives you decisions that are much more robust, ones that hold up better, even when things don't go exactly as planned.
SPEAKER_00Okay, that makes sense for handling the uncertainty. But now the big question. How does this NSGA2 algorithm actually find the Pareto front, those optimal tray-offs, across all these simulations? It sounds computationally heavy.
SPEAKER_01It is clever, actually. NSGA2 is an evolutionary algorithm. Think of it like natural selection for solutions. It starts with the population of potential dispatch plans and evolves them over generations. But crucially, it's not looking for a single winner. It wants that set of non-dominated solutions, the Pareto front approximations. Non-dominated meaning you can't improve sales without increasing overstock or vice versa. Exactly. Any improvement in one objective must come at a cost to another. NSGA 2 has some key tricks up its sleeve.
SPEAKER_01First, it uses fast non-dominated sorting. It efficiently ranks solutions into layers or fronts, finding the best trade-offs quickly, much faster than older methods.
SPEAKER_00Okay, so it finds the good ones fast. What else?
SPEAKER_01Second, it uses something called crowding distance. This is really important for getting a diverse set of solutions. It prefers solutions that are in less crowded regions of the Pareto front.
SPEAKER_00So it spreads the solutions out. It doesn't just give you a bunch of very similar options.
SPEAKER_01Right. Imagine three potential strategies, A, B, and C on the front. Maybe A and B are very similar, but C offers a really different balance. Clouding distance helps ensure C isn't lost. And third, there's elitism. It makes sure that the best solutions found in one generation are always carried over to the next. This guarantees the algorithm keeps getting closer to the true Pareto front.
SPEAKER_00Fascinating. So it's efficient, finds diverse options, and guarantees progress. But okay, now you have this beautiful Pareto front chart with lots of optimal points. How do you actually pick one to put into action?
SPEAKER_01Ah, the final step. That's where multi-criteria decision-making MCDM techniques come into play. And Paimu helps here too. Two common methods are ASF and pseudo weights.
SPEAKER_00ASF and pseudo weights. Okay, break those down.
SPEAKER_01Sure. ASF, or augmented scalarization function, basically picks the solution on the front that's geometrically closest to some ideal point. Like, you know, 100% sales, zero overstock, which is usually impossible, but it serves as a target. You guide it with weights, say I care 70% about sales, 30% about overstock.
SPEAKER_00So ASF is like aiming for perfection based on my weights.
SPEAKER_01Kind of, yeah. It looks for the closest point in that weighted direction. Then there's pseudo-weights. This is a bit different. It looks at the implicit trade-off within each solution on the front. It calculates the direction of the trade-off that solution represents, and then you pick the solution whose trade-off direction best matches the direction you prefer.
SPEAKER_00Hmm, okay. So ASF pulls towards an ideal point, while pseudo-weights looks for the solution whose inherent compromise best matches my desired compromise direction.
SPEAKER_01You've got it. Let's use that example. Solution A, 90 sales, 8 overstock. B, 88 sales, 5 overstock. C, 85 sales, 3 overstock. If your ideal point is high sales, ASF might lean towards A. But maybe your preferred trade-off is a more balanced reduction in overstock for a slight dip in sales. Pseud awaits might then highlight solution B as best matching that preference, even though A has higher absolute sales.
SPEAKER_00So neither is wrong. They just give different perspectives on best.
SPEAKER_01Exactly. They reflect different decision philosophies. And that's why visualizing the Pareto front, maybe scaled so you can see the percentages clearly, is so important. It helps you understand why a certain solution is being suggested.
SPEAKER_00Right. It makes the choice transparent. So to wrap up, using multi-objective optimization, especially with algorithms like NSGHS, it really seems like a much more powerful way to handle these real-world conflicts, like in dispatch.
SPEAKER_01Absolutely. It finds you a whole set of genuinely good, diverse, non-dominated options efficiently without you having to guess weights beforehand. And then tools like ASF and pseudo weights give you structured ways to pick the one
SPEAKER_00plan from that set that truly fits your strategy at that moment.
SPEAKER_01Correct. They offer distinct but equally valuable lenses for making that final crucial decision based on the tradeoffs discovered.
SPEAKER_00So perhaps the final thought for you, our listeners, in these complex situations full of uncertainty, maybe the goal isn't finding the single perfect answer. Maybe it's about understanding the spectrum of smart compromises and then making an informed, deliberate choice from that spectrum. It's about finding the right compromise, not just a compromise.
Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could learn from every interaction...
Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could continuously improve their...
Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could improve their own prompts...
Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if the key to better AI agents isn’t writing...
Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if improving an AI agent’s performance had less...