Algorithms
Related Guides

# What are Greedy Algorithms?

, updated on
Greedy algorithms are a category of algorithm that make locally optimal choices in hopes of coming close to a globally optimal solution. For example, an algorithm that needs to make 12 decisions may make one at a time as opposed to looking at all possible combinations of decisions.

## Problem Spaces

The effectiveness of greedy algorithms depends on the problem space. If there is some risk that an early decision will paint the algorithm into a corner, they may perform poorly. Greedy algorithms are known to perform poorly in a game such as chess where players commonly consider strategy many moves ahead.
An example of a greedy algorithm that may work is a tourist restaurant with no repeat customers that aggressively tries to upsell food items. If the restaurant depended on regular customers such annoying tactics could drive them out of business. However, since all the customers are new it makes sense for the restaurant to try to maximize each sale without regard to the future relationship with the customer. This strategy soon collapses if customers are able to share their opinions with technology such as reputation systems.

## Why Go Greedy?

Greedy algorithms are often selected when global data is uncertain, making globally optimized solutions impossible or expensive to develop. It is also common to select greedy algorithms for their simplicity and speed. In many problem spaces, calculating globally optimized solutions is prohibitively complex and resource intensive.
 Overview: Greedy Algorithms Type Algorithms Definition A category of algorithm that makes locally optimal choices in hopes that these will come close to a globally optimized solution. Value Typically cheaper to develop, faster and less resource intensive than a globally optimized algorithm. In some cases, globally optimized solutions are impossible due to factors such as uncertainty. Risks Greedy algorithms are typically sub-optimal.In some problem spaces, such as chess, they are extremely sub-optimal to the point of being useless. Related Concepts
Next: Brute Force
Backward Induction
Brute Force
Decision Trees
Forward Chaining
Input Is Error
IT Examples
Proof Of Work
Reluctant Algorithms
Reverse Algorithms
Soft Computing
More ...

## Algorithms

A few types of algorithms.

## Algorithms vs Code

The difference between algorithms and code.

## Deep Magic

An overview of deep magic, a technology term.

## Edit Distance

An overview of edit distance.

## Random Seed

The definition of random seed with examples.

## Soft Computing

The definition of soft computing with examples.

## Algorithmic Accountability

The definition of algorithmic accountability with examples.

## Input Is Error

An overview of input is error.

## IT Bias

An overview of IT biases with examples.

## Technology Change

An overview of technology change with examples.

## Technology Culture Examples

Examples of technology cultures.

## Words To Describe Technology

A vocabulary for describing technology.
The most popular articles on Simplicable in the past day.

## New Articles

Recent posts or updates on Simplicable.
Site Map