Many optimization problems can be solved using a greedy approach. The basic principle is that local optimal decisions may be used to build an optimal solution. But the Greedy approach may not always lead to an optimal solution overall for the problems. The key is knowing which problems will work with this approach and which will not.
A greedy algorithm always makes the choice that looks the best at the moment .
My everyday examples are :
-
Driving from Dhanmondi to Ashulia campus.
-
Playing card.
-
Invest on stocks.
Overall , Greedy algorithm are simple and straightforward.