T
Tim Richardson
I am doing a depth-first generative search with a recursive algorithm.
My problem can return to a node already visited. I need to know this,
otherwise I could end up in loops. I think this is not unlike a chess
program, which I think solves the problem by a "hash table", which
quickly lets the search algorithm realise it is somewhere it has
already been.
I can also make a unique value for each node, and add this to a
special hash. I wonder if there is a good generic way to do this?
Using Digest::MD5 or something like it perhaps?
For sure I am reinventing the wheel, but this is a hobby program as I
try to improve my Perl.
Tim
My problem can return to a node already visited. I need to know this,
otherwise I could end up in loops. I think this is not unlike a chess
program, which I think solves the problem by a "hash table", which
quickly lets the search algorithm realise it is somewhere it has
already been.
I can also make a unique value for each node, and add this to a
special hash. I wonder if there is a good generic way to do this?
Using Digest::MD5 or something like it perhaps?
For sure I am reinventing the wheel, but this is a hobby program as I
try to improve my Perl.
Tim