Live Greedily

Applying the greedy algorithm to real life

HengHong Lee

--

People want to optimize their lives and live effectively or efficiently. They have a huge bucket list of things to do for the day but often they cannot decide which item to do to start ticking off.

This seemingly complicated exercise of choosing the right activity actually entails a scientific and useful solution. Known as the Greedy Algorithm in programming, it is a strategy used to optimise selection of constraints and can be usefully cross applied to many situations in life.

The collection of local maxima always leads to a global maximum” - Greedy Algorithm

Lets say I want to do as many things as possible in a week, they overlap each other and each item has a different duration and start time.

Since there is technically no penalty in ending early, doing the next possible task that has the shortest completion time will ensure maximum number of tasks completed.

Gantt Chart

Doing these tasks will make you feel the most accomplished

Gantt Chart 2

Another Example

“I want to choose the strongest set of atheletes for the upcoming competition”

However I have a relationship table (like an excel sheet ) consisting of who hates who in the team. ( extremely complicated social stuff ).

Its actually much easier to decide who to choose than you think.

  1. Get the strongest person in your team
  2. Remove those that he/she doesn’t like in the candidate list
  3. Get the next strongest person
  4. Repeat until party is full.

This will ensure your party is the strongest possible one!

So go on an apply greedy on your everyday life and simplify things!

- My first post on Medium

--

--