Open In App

Greedy Algorithms

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

Greedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. In these algorithms, decisions are made based on the information available at the current moment without considering the consequences of these decisions in the future. The key idea is to select the best possible choice at each step, leading to a solution that may not always be the most optimal but is often good enough for many problems.

For example: consider the Fractional Knapsack Problem. The local optimal strategy is to choose the item that has maximum value vs weight ratio. This strategy also leads to a globally optimal solution because we are allowed to take fractions of an item.

Fractional Knapsack

Introduction to Greedy Algorithm:

Standard Greedy Algorithms:

Greedy Problems on Array:

Greedy Problems on Operating System:

Greedy Problems on Graph:

Approximate Greedy Algorithm for NP Complete:

Greedy for Special cases of DP:

Easy Problems on Greedy:

Medium Problems on Greedy:

Hard Problems on Greedy:

Quick Links:



Last Updated : 22 Feb, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads