What’s the difference between Greedy and Heuristic algorithm?

Technology CommunityCategory: Greedy AlgorithmsWhat’s the difference between Greedy and Heuristic algorithm?
VietMX Staff asked 3 years ago
  • The way that Heuristics have been described to me is that they are “rules of thumb”. Their ability to produce a globally optimal solution may not be directly provable but typically, they do a good job. They’re often used when the cost of determining an optimal solution is too high. Furthermore, Heuristics often encode a degree of experience on how the problem was solved in the past. A better way to describe a Heuristic is a “Solving Strategy”.
  • Greedy algorithm is one that makes choices based on what looks best at the moment. In other words, choices are locally optimum but not necessarily globally optimum (it might be if lucky but you can’t prove it). Furthermore, a Greedy algorithm doesn’t typically refine its solution based on new information. This is but one solving strategy (a.k.a a heuristic).

Wrapping up:

  • Are all Heuristics, Greedy Algorithms – No
  • Are all Greedy Algorithms, Heuristics – In general, yes.