Ask the Algorithm
An advice column answered by an algorithm: depth-first vs. breadth-first dating, simulated annealing for choosing where to live, and cut-and-choose for child custody.









Content note: Dating/hookups; divorce and custody (satirical).
Use this cartoon
Free for classrooms, worksheets, slides and other non-commercial use under CC BY-NC 4.0, with credit to Ben Orlin.
Cartoon by Ben Orlin, Math with Bad Drawings. https://cartoons.mathwithbaddrawings.com/2025-07-29-ask-the-algorithm/ (CC BY-NC 4.0)Transcript
[Title] "ASK THE ALGORITHM: Life Advice from the Source of All Wisdom"
[1] "Dear Algo, I really like the guy I'm dating, but we're only 20. Is it okay if my first real relationship becomes my forever relationship? –Inexperienced in Illinois" / "Dear Ms. Inexperienced: No, it's not okay. Depth-first search is notoriously inefficient. Instead, begin by dating all possible mates {Mᵢ} simultaneously. Prune the least promising until only the highest-quality option M* remains. P.S. Depending on the level of noise in your evaluation function, it may help to randomly reintroduce previously pruned options. Humans often refer to this as 'hooking up with your exes.'"
[2] "Dear Algo, I'm itching to leave the little town where I grew up… but how do I decide where to go? –Stuck in Smalltown" / "Two words for you, Stuck: simulated annealing. Move continents five times in the next decade. After that, try random countries on the continent that suited you best… At this point, you will be 73 years old and living in the optimal residence on Earth. Enjoy!"
[3] "Dear Algo, My ex and I share four kids. Three years after the divorce, we're still bickering over the custody arrangement. Is it time to get lawyers involved again? –Divorced in Delaware" / "Dear Divorced: No need for lawyers. There is an easy fair sharing algorithm: 'I cut, you choose.' First, one of you should partition the children into two sets that they deem equally valuable; then the other parent chooses whichever set they prefer. This should eliminate all acrimony." [Set 1 (single high-value child) · Set 2 (several lower-value children)]