Metraipolis › archive › dc_0d97801080f9
Greedy algorithm — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Greedy_algorithm
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-10-06T09:24:57.088Z
- SHA-256 of the archived text
67e91c7f26a40c7d37ddaf61fe751797fd4fda653103e2ed24cfbba273bb81f0- Stable URL of this page
https://metraipolis.com/documento/dc_0d97801080f9
How to cite
Greedy algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Greedy_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_0d97801080f9 (Metraipolis archive dc_0d97801080f9, sha256 67e91c7f26a40c7d37ddaf61fe751797fd4fda653103e2ed24cfbba273bb81f0)
BibTeX
@misc{dc0d97801080f9,
title = {Greedy algorithm — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Greedy_algorithm},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_0d97801080f9; sha256 67e91c7f26a40c7d37ddaf61fe751797fd4fda653103e2ed24cfbba273bb81f0},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Greedy_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
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.
Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»).
Fonte: Wikipedia in inglese, voce «Greedy algorithm» — https://en.wikipedia.org/wiki/Greedy_algorithm
Wikidata Q504353 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q504353
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Greedy_algorithm?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1376013393, consultata il 2026-10-06T08:23:29.853Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 570a27082460e500198c93ad5f822672c911fcf063bf3d48c2241be2fc2c3a90