Don't Get Greedy
Except when you have to
I liked the sound of “greedy algorithms” right away. Rather than recursively build up a delicate tower or tirelessly shuffle through endless combinations, greedy algorithms go for the biggest slice of cake without pause or apology.
Greedy algorithms are characterized by a pattern of selecting the best option immediately available, without taking into account what might be best overall. So if you’re writing an algorithm to help a burglar optimally fill his bag with loot, the greedy approach would be to grab the most expensive item first, then the next most expensive and so on until the bag is full (this is a classic CS problem).
In algorithms theory and in my personal experience the greedy solution doesn’t always cut it. If the expensive items are big and bulky there might be a more optimal solution that involves grabbing a bunch of smaller items of lesser value. Dumping garbage into landfills is cost effective right now but we’re going to pay for it eventually. The same goes for eating a whole carton of ice cream or ordering a fishbowl at a college bar. You might have the most possible fun for an hour, but the average fun over 24 hours is going to tank.
But when making some of our most consequential decisions we don’t have enough data (or computing power) to predict long term outcomes. It would be great to scan every potential life partner and run a simulation to test the mettle of the relationship through better or worse, sickness and health, for richer and for poorer. But most of us marry that guy we sat next to in freshman Calc or the cute girl on Tinder who was 0.7 miles away. The same goes for deciding whether to go back to school or take a job.
In cases where time or information is limited, the greedy solution may be the best option available. Greedy algorithms are typically used in computer science because they’re fast and because for certain problems they produce a “good enough” solution, e.g. a solution that is guaranteed to be at least half or two thirds as good as the optimum.
So if you have a ten year plan, more power to you. But if you can’t quite figure out how all of the puzzle pieces fit together you may as well go with what will make you happy tomorrow, or this week, or this year. I think that’s the philosophy Stephen Stills had in mind when he sang, “If you can’t be with the one you love / love the one you’re with.” Algorithmically speaking, that’s greedy as hell.