Approach to solve a problem by selecting the best option currently available
Selects the locally optimal choice at each step , hoping to acheive a global optimum
Simple , easy to implement , fast
Usually don’t provide globally optimum solution
Never reconsiders its choices
Find the maximum sum from root to node
Actual=27, Greedy=21 , Greedy lost as it picked 7 first ( locally optimum but not globally optimum)
2 conditions :
Choosing the best option at each step can lead to a global optimal solution
An optimal solution to the whole problem contains optimal solution to sub-problems
Last updated 10 months ago