Wednesday, November 2, 2011

Saving partially completed OptQuest model runs in Crystal Ball

There are times when working with a large OptQuest (a.k.a. Decision Optimizer) model which is running for hours with no end in sight, you want to take a break and do something else with the computer. But, you do not want to lose the progress that has been achieved by the solver so far - so you need a way to save the partially completed run. Although there is no direct way to achieve this through a button click, this can be done. Here we discuss two ways to do this, depending on how long a break you (and your computer) need(s).

Short break
It is possible to informally save a partially completed OptQuest Run. You can hit the red 'Stop' button on the Crystal Ball control panel, and that would essentially pause the solver. When you are ready, you can hit the green 'Continue Optimization' button, and that would continue the optimization from where it stopped, with all the settings and the progress intact.
1. This technique would work on general optimization problems, but would not work if you are trying to evaluate the efficient frontier.

Long break
It is also possible to completely shut down Excel and Crystal Ball with a partially completed model. In this case, after you hit the red 'Stop' button on the Crystal Ball control panel, you would then have to export the intermediate solution to the spreadsheet by using OptQuest Results window -> Edit -> Copy Best solution to Spreadsheet. Then you can save and close the file. When you start up the file again and run OptQuest, it will use the saved solution as the starting solution (base value of the variables) and improve over that and should still end up with the same solution.
1. Notice the word should in the last line. In this approach, OptQuest looses its history of previous solutions tried, and might end up re-examining some of the solution space.
2. Hence, the solution path and time taken might differ from what would have been the original solution path had you not disrupted the solver. The resulting solutions in these two cases (undisturbed vs. restarted) should not be considerably different though.

Enjoy your break !!

Note: This post is based of a recent CBUG discussion on the same topic.

No comments:

Post a Comment