Metraipolis › archive › dc_b342b6b1b6cf
Cycle detection — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Cycle_detection
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-10-07T21:41:45.299Z
- SHA-256 of the archived text
4864c529342049188f0d8b3f618d0933841956ace13d4e78c14321254104e45f- Stable URL of this page
https://metraipolis.com/documento/dc_b342b6b1b6cf
How to cite
Cycle detection — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Cycle_detection (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_b342b6b1b6cf (Metraipolis archive dc_b342b6b1b6cf, sha256 4864c529342049188f0d8b3f618d0933841956ace13d4e78c14321254104e45f)
BibTeX
@misc{dcb342b6b1b6cf,
title = {Cycle detection — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Cycle_detection},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_b342b6b1b6cf; sha256 4864c529342049188f0d8b3f618d0933841956ace13d4e78c14321254104e45f},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Cycle_detection. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In computer science, cycle detection or cycle finding is the algorithmic problem of finding a cycle in a sequence of iterated function values. For any function f that maps a finite set S to itself, and any initial value x0 in S, the sequence of iterated function values x 0 , x 1 = f ( x 0 ) , x 2 = f ( x 1 ) , … , x i = f ( x i − 1 ) , … {\displaystyle x_{0},\ x_{1}=f(x_{0}),\ x_{2}=f(x_{1}),\ \dots ,\ x_{i}=f(x_{i-1}),\ \dots } must eventually use the same value twice: there must be some pair of distinct indices i and j such that xi = xj. Once this happens, the sequence must continue periodically, by repeating the same sequence of values from xi to xj − 1. Cycle detection is the problem of finding i and j, given f and x0. Several algorithms are known for finding cycles quickly and with little memory. Robert W. Floyd's tortoise and hare algorithm moves two pointers at different speeds through the sequence of values until they both point to equal values. Alternatively, Brent's algorithm is based on the idea of exponential search. Both Floyd's and Brent's algorithms use only a constant number of memory cells, and take a number of function evaluations that is proportional to the distance from the start of the sequence to the first repetition. Several other algorithms trade off larger amounts of memory for fewer function evaluations. The applications of cycle detection include testing the quality of pseudorandom number generators and cryptographic hash functions, computational number theory algorithms, detection of infinite loops in computer programs and periodic configurations in cellular automata, automated shape analysis of linked list data structures, and detection of deadlocks for transactions management in DBMS.
Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»).
Fonte: Wikipedia in inglese, voce «Cycle detection» — https://en.wikipedia.org/wiki/Cycle_detection
Wikidata Q60614789 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q60614789
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Cycle_detection?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 1346428669, consultata il 2026-10-07T21:16:25.977Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 5513010df51d5a3e7c6694c62f7f66fe8598c338fb0101ab939a8d763ffcd263