If there exist optimal solutions that are not achieved by greedy algorithm, then the greedy algorithm does not work.
Added by Amy M.
Step 1
Step 1: Define precisely what "greedy algorithm works" means: the greedy algorithm "works" if for every problem instance I the solution produced by the greedy algorithm, G(I), is an optimal solution. Show more…
Show all steps
Your feedback will help us improve your experience
Haricharan Gupta and 55 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Does a greedy algorithm always find an optimal solution? Justify your answer.
Haricharan G.
Madhur L.
Circle True or False for each of the following statements. 1) True False A greedy algorithm always makes the choice that looks best at the moment. 2) True False A greedy algorithm makes a globally optimal choice in the hope that this choice will lead to a locally optimal solution. 3) True False Greedy algorithms always yield optimal solutions. 4) True False GREEDY-ACTIVITY-SELECTOR sometimes finds an optimal solution to an instance of the activity-selection problem. 5) True False Two ingredients that are exhibited by most problems that lend themselves to a greedy strategy: the overlapping subproblems and optimal substructure. 6) True False Greedy-choice property: a globally optimal solution can be arrived at by making a locally optimal (greedy) choice. 7) True False A problem exhibits optimal substructure if an optimal solution to the problem contains within it optimal solutions to subproblems. 8) True False The 0-1 knapsack problem is solvable by a greedy strategy, whereas the fractional knapsack problem is not.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD