On 9 September 2012 13:41, Mark H Weaver <m...@netris.org> wrote: > Another option is to use the method described in "Efficient Nondestructive > Equality Checking for Trees and Graphs" by Adams and Dybvig. > > http://www.cs.indiana.edu/~dyb/pubs/equal.pdf > > Mark
The 'interleave' algorithm there looks excellent. One possible refinement: the 'stack' of items currently being examined is probably a good hint as to which slots may have cycles, so it could be useful to reify that stack, at least the portion of it that has not been checked yet. -- William Leslie