Forum Discussion
FICO
3 years agoCommunity Manager
Print intermediate solution and bounds with Mosel
Hi, I tried to search forit but I did not find any answer.
Is it possible, while solving a MIP from Mosel, to get the incumbent and the best bound at specific time limits (e.g., after every 1000 seconds)?
3 Replies
- FICOCommunity Manager
There are currently no Optimizer callbacks tied to timed events. You could try using the optnode callback, which will be called once per node during the branch-and-bound tree and combine this with a message callback to ensure more callbacks are fired from the root node.
See below for a demonstration of the optnode callback for a periodic output after freq many seconds.
model "periodically report best solution and bound during a solve" uses "mmsystem", "mmxprs" forward public function periodic_optnode: boolean !setparam("XPRS_verbose", true) ! initialize initial time starttime := gettime lasttime := starttime ! frequency (minimum (fraction of) seconds between two consecutive prints) freq := 1000.0 setcallback(XPRS_CB_OPTNODE, "periodic_optnode") ! ! ... your solve commands here ! public function periodic_optnode: boolean if gettime - lasttime >= freq then writeln("(Opt Node ", gettime - starttime, " seconds, Best Bound: ", getparam("XPRS_BESTBOUND"), " Best Solution: ", getparam("XPRS_MIPBESTOBJVAL")); lasttime := gettime end-if end-function end-model - FICOCommunity Manager
A modification to the previous answer: Mosel implements the Optimizer callback CHECKTIME, since Xpress Release 9.0 (Mosel 6.2) this callback can be configured to be invoked at regular time intervals. Please take a look at this example that shows the use of various solver callbacks (including CHECKTIME configured with a time interval) for reporting purposes: elscb_graph.mos
- FICOCommunity Manager
NB: This example also forms part of the Xpress distribution (see subdirectory examples/mosel/WhitePapers/MoselPar of your Xpress installation).
Related Content
Related Content
MIP solution status
Hello, I've been using code like this to get the solution status of a MIP: case getprobstat of XPRS_OPT: status:="Optimum found" XPRS_UNF: status:="Unfinished" XPRS_INF: status:="Infeasib...5 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread42Views0likes3CommentsIs there a way to monitor the solver's progress or see intermediate updates.
Hello, I am working in Xpress IVE on an optimization model. Sometimes the problem size becomes large, and the solver takes a long time. During this time, I only see a blank screen with no indication ...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread17Views0likes1CommentBest way to specify lower bound in xprsmip when only some variables need lower bound
I am using xprsmip with a combination of continuous and binary variables. The continuous variables need a lower bound of 0. If all variables were binary, I could set lb = [], but that is not the cas...2 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread16Views0likes3Comments