All Exams Test series for 1 year @ ₹349 only
Question

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:

The correct answer is
B, D Only

Understanding Greedy Algorithm Limitations

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.

Analyzing Greedy Algorithm Statements

  • Statement B: They may not give the optimal solution for all problems.

    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.

  • Statement D: They make local choices without looking ahead.

    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.

  • Statement A: They always fail for NP hard problem.

    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.

  • Statement C: They are faster than dynamic programming in most cases.

    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.

Conclusion on Limitations

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.

Was this answer helpful?

Important Questions from Greedy Algorithms

  1. Which of the following algorithms use Greedy strategy?
    A. Dijkstra's algorithm
    B. Kruskal's algorithm
    C. Huffman coding
    D. Bellman-Ford algorithm
    Choose the correct answer from the options given below:
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App