Greedy algorithm
Algorithm that makes locally optimal choices in a sequence of steps with the goal of reaching a global optimum
A greedy algorithm is an algorithm which, at each step, makes the choice that is locally optimal, and subsequently does not reconsider past choices. Greedy algorithms are often used to solve combinatorial optimization problems.
Nº Q504353 ★★★
Rare · History
Greedy algorithm
Algorithm that makes locally optimal choices in a sequence of steps with the goal of reaching a global optimum
A greedy algorithm is an algorithm which, at each step, makes the choice that is locally optimal, and subsequently does not reconsider past choices. Greedy algorithms are often used to solve combinatorial optimization problems.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
A greedy algorithm is an algorithm which, at each step, makes the choice that is locally optimal, and subsequently does not reconsider past choices. Greedy algorithms are often used to solve combinatorial optimization problems. If an optimization problem only depends on the partial solution of solving it for one subproblem, we can solve this problem by "greedily" considering only the locally optimal subproblem. In this sense, a greedy algorithm is a special case of a dynamic programming algorithm. Uriel Feige notes that: [Greedy algorithms] may be viewed as the ultimate form of dynamic programming, in which only one partial solution is maintained. The problem needs to have much more structure for this approach to work. In many cases, a greedy algorithm does not produce an exact solution, but can yield solutions that approximate an exact solution in a reasonable amount of time. An example of a problem which admits an exact greedy solution, the activity selection problem. Given a collection of tasks which can be done between allotted time intervals, the problem is to determine the maximum number of tasks that can be done. A greedy algorithm in O ( n log ( n ) ) {\displaystyle O(n\log(n))} which solves this problem sorts the tasks by the end time and then repeatedly chooses the first task that begins after the last task ended. Many classic algorithms in computer science such as the Huffman coding algorithm, Prim's algorithm, Kruskal's algorithm, and Dijkstra's algorithm all use greedy properties in their design. Mathematicians frequently use greedy strategies in proofs as well. A classic example is what Raphael Yuster refers to as the greedy proof that every tournament contains a Hamiltonian path.
Text: Wikipédia, CC BY-SA 4.0. ·
Related cards
Prim's algorithm
Algorithm for finding the minimum spanning tree for weighted undirected graphs
Nº Q470813 ★★
Dynamic programming
Problem optimization method that simplifies a complicated problem by decomposing it into simpler subproblems recursively
Nº Q380679 ★★★
Gradient descent
Optimization algorithm
Nº Q1199743 ★★★
Ant colony optimization algorithms
Probabilistic techniques for solving computational problems that can be reduced to finding good paths through graphs
Nº Q460851 ★★
Bellman equation
Necessary condition for optimality associated with dynamic programming
Nº Q1430750 ★★
Euclidean algorithm
Algorithm for computing greatest common divisors
Nº Q230848 ★★★