Talk:Cycle detection

message: The article states that the worst-case performance of the algorithm is λ + μ/2 comparisons. This statement cannot be correct, since in the example where λ=2 and μ=6, λ + μ/2 = 5, but the description of a running of the algorithm states that it finishes in 6 iterations.
The article also states that the slow sequence cannot get more than halfway around the loop without meeting the fast sequence, but in the given example the sequences meet at the second half of the loop.
:Fixed. BradAustin2 21:55, 11 March 2007 (UTC)
thread_title:  Contradictions in the article 

message: The hare - tortoise image is cute, but I think it's too much 'heavy'. A more stylized and lighter image may be better. —Preceding unsigned comment added by 79.42.205.63 (talk • contribs) 
I like it.--CzarKirk (talk) 03:30, 16 January 2009 (UTC)
thread_title:  Too much graphical-heavy image 

message: Currently both the floyd and brent code examples of the algorithm leaves out a critical component, making it nearly useless as is. both algorithms have an undefined function f(someNode) which is explained to simply return the node next to someNode. However in most graphs there isnt a single node adjacent to another, there are several. since f() isnt actually defined it doesnt tell you which of the neighbor nodes should be selected, and clearly just picking any at all wont work (or else the entire graph doesnt get traversed). This should be fixed, or perhaps someone could explain this to me and i can fix it? - Debeo Morium: to be morally bound (Talk | Contribs) 04:55, 21 April 2010 (UTC)
replies: text: You seem to have mistaken this for an article about finding cycles in arbitrary graphs. For that, you probably want depth first search or something like that. This is about finding cycles in sequences defined by repeatedly calling a function. f is an input to the algorithm, and (together with the initial value) defines the sequence in which a cycle is to be found. —David Eppstein (talk) 05:06, 21 April 2010 (UTC)
thread_title: Example code needs fixing

message: I agree with Erel Segal.  I think this article, "cycle detection", should define cycle detection as the more general detection of cycles in a directed graph.  The special case dealt with here (functional case, where a given node/value has a single successor) deserves special attention, but as a special case, not as the full "cycle detection" problem.  
I was searching for incremental algorithms for the graph theoretic cycle detection -- i.e., where you've identified all cycles in a huge network, then one link is changed and you need to adjust the cycle identification.  Is it possible to do this more efficiently than a full reprocessing of the full network?  I don't know the answer (yet), but it would have been nice for me if the article might have addressed this.  — Preceding unsigned comment added by Ldc (talk • contribs) 22:29, 10 August 2011 (UTC)
thread_title:  Cycle detection in directed graphs 

message: I can't seem to understand why the T and H should meet at the node, k nodes before entry point, whenever the length of the list excluding (before) the loop is k? Does this only work when the speeds are x and 2x or all the time? 117.198.124.222 (talk) 06:39, 28 October 2012 (UTC)
replies: text: At each step the hare gets one position farther ahead of the tortoise, because it is faster by one unit. So after k steps (when the tortoise enters the loop) the hare is k positions ahead, or equivalently L-k steps positions behind, where L is the length of the loop. And after L-k more steps, the hare has caught up to the tortoise again. At this time the tortoise will have moved L-k units past where it entered the loop; that is, k nodes before the entry point.—David Eppstein (talk) 07:19, 28 October 2012 (UTC)
replies: text: What if the speed of the tortoise and hare are x and y respectively? and the nodes before the loop is k and nodes in the loop is L?117.198.136.11 (talk) 06:30, 30 October 2012 (UTC)
thread_title:  Where do the Hare and Tortoise meet? 

message: x_i = x_i + kλ cannot be true unless kλ=0. I assume it's supposed to be x_(i+1) = x_i + kλ  — Preceding unsigned comment added by 208.54.80.171 (talk) 23:31, 9 December 2012 (UTC)
replies: text: Yes, that is the wrong equation. It is so wrong that it is not even in the article. Instead, what we have is x_i = x_{i+kλ}, which is not so difficult to satisfy. —David Eppstein (talk) 23:37, 9 December 2012 (UTC)
thread_title:  Wrong equation 

message: LCG of TI calculators is ok, because they have more than 32 bits of precision, Brent hit integer overflow in his own program rather than mistake in LCG  — Preceding unsigned comment added by 94.244.46.42 (talk) 12:16, 14 February 2021 (UTC)
thread_title:  Mistake in Brent's article 

message: In code we can see
      Because the
    # distance between them is constant at 2ν, a multiple of λ,
    # they will agree as soon as the tortoise reaches index μ.
What is 2ν? Is it node "ν", where there two in-edge, or something else? Tookser (talk) 10:50, 24 March 2024 (UTC)
thread_title:  Possible typo in code comment