Forum Discussion
FICO
10 years agoCommunity Manager
ADDMIPSOL and XPRS_CB_SOLNOTIFY
Hi everyone,
I am looking for how to use "addmipsol" and find online the following example:
public procedure solnotify(id:string, status:integer)
writeln("Optimiser loaded solution ",id," status=",status)
end-procedure
addmipsol(id,heursol)
setcallback(XPRS_CB_SOLNOTIFY,"solnotify")
I adapted this example to my code and it is working. The point is that the callback procedure prints a status equal to 3 and I could not find any reference to what it means. Does anyone has the specifications behind XPRS_CB_SOLNOTIFY.
Thanks for any help.
Bruno Fanzeres
3 Replies
- FICOCommunity Manager
You might want to check the Xpress-Optimizer documentation. The details are described in the XPRSaddcbusersolnotify section:
Status has one of the following values:
0 Solution not checked. Likely because the MIP solve completed before the solution could be processed.
1 Solution is feasible.
2 Solution is feasible after reoptimizing with fixed globals.
3 A local search heuristic was applied and a feasible solution discovered.
4 A local search heuristic was applied but a feasible solution was not found.
5 Solution is infeasible and a local search could not be applied.
6 Solution is partial and a local search could not be applied.
7 Failed to reoptimize the problem with globals fixed to the provided solution. Likely because a time or iteration limit was reached.
- FICOCommunity Manager
Hi Bruno, and apologies for not linking "SOLNOTIFY" to "usersolnotify" in the documentation!
- FICOCommunity Manager
You could extend the "solnotify" routine as follows:
public procedure solnotify(id:string, status:integer)
declarations
SOLSTAT: array(range) of string
end-declarations
SOLSTAT:: (0..7)["Solution not checked",
"Solution is feasible",
"Solution feasible after reoptimizing with fixed globals",
"Feasible solution discovered by local search heuristic",
"Local search heuristic applied, no solution found",
"Solution infeasible, local search not applied",
"Partial solution, local search not applied",
"Failed to reoptimize with globals fixed"]
writeln("Optimiser loaded solution '", id, "' status: ", SOLSTAT(status))
end-procedure
Related Content
Related Content
Xpress solver freezes when using addmipsol
I have run my code, which includes adding heuristic solutions at each leaf node of the branch-and-bound tree. The added solution is feasible and accepted by the solver. However, at a certain point, t...1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread0Views0likes5CommentsRe: How to load a MIP solution?
Thank you for your answer. When using addmipsol, XPRS_CB_SOLNOTIFY returns me the status code 8. However, I cannot find an overview of solnotify codes similar to loadmipsol exit codes (https://www.fi...7 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum5 unread comments5 unread1View0likes0Comments