Which of the following are limitations of Greedy algorithms? A. They always fail for NP hard problem. B. They may not give the optimal solution for all problems. C. They are faster than dynamic programming in most cases D. They make local choices without looking ahead. Choose the correct answer from the options given below:
Greedy algorithms make choices that seem best at the current moment in the hope that these local optimal choices will lead to a global optimal solution. However, this approach has inherent limitations.
This is a fundamental limitation. A locally optimal choice might prevent finding the best overall solution later. For example, in some pathfinding scenarios, taking the shortest immediate step might lead down a much longer overall path.
This describes the core nature of the greedy strategy and is directly linked to why it might fail to find the optimal solution. The algorithm doesn't consider future consequences or explore alternative paths.
This statement is too absolute. While greedy algorithms often don't guarantee optimality for NP-hard problems, they might still provide a workable, albeit suboptimal, solution. They don't necessarily 'always fail' to find any solution or even an approximate one.
This is generally considered an advantage, not a limitation. Greedy algorithms are often simpler and more efficient computationally than dynamic programming because they typically require less state management and fewer subproblems.
Based on the analysis, the core limitations of greedy algorithms among the given options are that they may not yield the optimal solution (B) because they make choices based only on immediate benefit without considering future outcomes (D).
Therefore, the correct combination identifying limitations is B and D.