What’s The Greedy Algorithm?

Many people instinctively use a greedy algorithm to solve problems, but they should have no expectation that it will generate optimal or even good results.

Back in the depths of history, I took a course in operations research. Essentially the process of applying mathematical analysis to real world problems. One of the interesting parts was the Greedy Algorithm. It is the process where you choose the most expedient next step without consideration of other possible solutions or even how you got to where you are.

Some (even most) multistage courses of action can thus never be implemented because the correct first step is not as expedient as some other one. This flaw means that the greedy algorithm can perpetuate or even create problems.

For those with short time frames, it’s attractive. “We are going to do this now and we will deal with any problems that arise, if and when they arise.” Bias to action. Sometimes they say it even when the future problem is known and certain to occur.

Micromanaging is an indicator. You can make all the decisions if you only think one step at a time.

The algorithm can sometimes generate the unique, worst-possible, answer. The “traveling salesman” problem, where you are to find the best way to visit a list of customers, is one. Take the closest next seems obvious, but that choice system will always generate the unique worst route.

When the algorithm fails, it is because an early, right-looking step did not lead to a good final solution. Failure compounds because people tend not to go back and restart. Often that choice is unavailable. Lovers of greedy usually attack the newly observed problem in isolation and again use the greedy algorithm to solve it.

Partly solved problems thus become chronic. There are problem types where it works. (matroid, if you care.)

The worst part of this is that using the greedy algorithm denies you the ability to learn. Because the breakdown appears later, sometimes several steps later, you only learn to avoid that step and there may have been nothing wrong with it. Nothing tells you to stop using the failure inducing first step.

A mistake is your friend, but only if you learn something of value from it. In this case, Gordon Gecko was wrong. Greed is not good.

Don Shaughnessy is a retired partner in an international accounting firm and is presently with The Protectors Group, a large personal insurance, employee benefits and investment agency in Peterborough Ontario. don.s@protectorsgroup.com

4 Comments on “What’s The Greedy Algorithm?

  1. Pingback: What Is Your Idea Of The Best Question? | moneyFYI

  2. Pingback: Planning Fails When ….. | moneyFYI

  3. Pingback: Make More Mistakes | moneyFYI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: