Saving & restoring a recursive search
807606May 8 2007 — edited May 9 2007Hi all
I'm facing the following problem:
I have a very long and time consuming backtracking algorithm. The algorithm works perfectly but I would like to "save its state" to disk in order to stop the computation and resotre it (continue with it) in the future (and maybe in another machine).
I know that I have to store (for example in a file) the status of all my variables in each "step" of the recursion. I think that an "easy" way to do it would be returning a "special value" which would mean "save your status to the file" and then all the previously recursive calls /states would be written into the file.
However, my biggest concern is with restoring that saved state. How would I "replicate" the recursive calls that I have previously saved?
Do anyone know of an easy example on how to store / retrieve the state for a recursive algorithm?
Excuse me if my question is not clear enough or if my English is not good.
Thank you for your attention
Zerjillo