Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cycle detection
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Definitions== Let {{mvar|S}} be any finite set, {{mvar|f}} be any [[Endofunction#Endofunctions|endofunction]] from {{mvar|S}} to itself, and {{math|''x''<sub>0</sub>}} be any element of {{mvar|S}}. For any {{math|''i'' > 0}}, let {{math|1=''x<sub>i</sub>'' = ''f''(''x''<sub>''i'' − 1</sub>)}}. Let {{mvar|渭}} be the smallest index such that the value {{mvar|x<sub>渭</sub>}} reappears infinitely often within the sequence of values {{mvar|x<sub>i</sub>}}, and let {{mvar|位}} (the loop length) be the smallest positive integer such that {{math|1=''x<sub>渭</sub>'' = ''x''<sub>''位'' + ''渭''</sub>}}. The cycle detection problem is the task of finding {{mvar|位}} and {{mvar|渭}}.<ref name=Joux>{{citation|title=Algorithmic Cryptanalysis|chapter=7. Birthday-based algorithms for functions|first=Antoine|last=Joux|author-link=Antoine Joux|publisher=CRC Press|year=2009|isbn=978-1-420-07003-3|page=223|url=https://books.google.com/books?id=buQajqt-_iUC&pg=PA223}}.</ref> One can view the same problem [[graph theory|graph-theoretically]], by constructing a [[functional graph]] (that is, a [[directed graph]] in which each vertex has a single outgoing edge) the vertices of which are the elements of {{mvar|S}} and the edges of which map an element to the corresponding function value, as shown in the figure. The set of vertices [[Reachability|reachable]] from starting vertex {{math|''x''<sub>0</sub>}} form a subgraph with a shape resembling the [[Rho (letter)|Greek letter rho]] ({{mvar|蟻}}): a path of length {{mvar|渭}} from {{math|''x''<sub>0</sub>}} to a [[Cycle (graph theory)|cycle]] of {{mvar|位}} vertices.<ref name="j224">{{harvtxt|Joux|2009|page=224}}.</ref> Practical cycle-detection algorithms do not find {{mvar|位}} and {{mvar|渭}} exactly.{{r|Joux}} They usually find lower and upper bounds {{math|''渭<sub>l</sub>'' ≤ ''渭'' ≤ ''渭<sub>h</sub>''}} for the start of the cycle, and a more detailed search of the range must be performed if the exact value of {{mvar|渭}} is needed. Also, most algorithms do not guarantee to find {{mvar|位}} directly, but may find some multiple {{math|''k位'' < ''渭'' + ''位''}}. (Continuing the search for an additional {{math|''k位''/''q''}} steps, where {{mvar|q}} is the smallest prime divisor of {{mvar|k位}}, will either find the true {{mvar|位}} or prove that {{math|''k'' {{=}} 1}}.)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)