TITLE: Do dynamic programming and greedy algorithms solve the same type of problems?
QUESTION [18 upvotes]: I wonder if dynamic programming and greedy algorithms solve the same type of problems, either accurately or approximately? Specifically,

As far as I know, the type of problems that dynamic programming can
solve are those that have "optimal structure". Can the same type of problems always be
solved by greedy algorithms, either accurately or approximately? (I think yes)
Are there optimal problems that do not have "optimal structure" and
can be solved by greedy algorithms, either accurately or
approximately? If yes, what characterize the type of problems that
can be solved by greedy algorithms, either accurately or
approximately?

Thanks and regards!

REPLY [2 votes]: Greedy Algorithm focus on achieving the local optimal solution, while dynamic programming achieves global solution. Greedy pick the "current" best solution, while dynamic always achieves the best optimal solution.