Initializing help system before first use

Interrupting the Solve

It is common that users need to interrupt iterations before a solving algorithm is complete. This is particularly common when solving MIP problems since the time to solve these to completion can be large and users are often satisfied with near–optimal solutions. The Optimizer provides for this with structured interrupt criteria using controls and with user–triggered interrupts.

As described previously in section Interrupting Console Optimizer Console Optimizer can receive a user–triggered interrupt from the keyboard Ctrl–C event. It was also described in this previous section how interrupted commands could be resumed by simply reissuing the command. Similarly, optimization runs started from the library interface and interrupted by either structured or user–triggered interrupts, will return from the call in such a state that the run may be resumed with a follow–on call.

To setup structured interrupts the user will need to set the value of certain controls. Controls are scalar values that are accessed by their name in Console Optimizer and by their id number via the library interface using functions such as XPRSgetintcontrol and XPRSsetintcontrol. These particular library functions are used for getting and setting the values of integer controls. Similar library functions are used for accessing double precision and string type controls.

Some types of structured interrupts include limits on iterations of the solving algorithms and a limit on the overall time of the optimization run. Limits on the simplex algorithms' iterations are set using the control LPITERLIMIT. Iterations of the Newton barrier algorithm are limited using the control BARITERLIMIT. A limit on the number of nodes processed in the branch and bound search when solving MIP problems is provided with the MAXNODE control. The integer control MAXTIME is used to limit the overall run time of the optimization run.

Note that it is important to be careful when using interrupts, to ensure that the optimization run is not being unduly restricted. This is particularly important when using interrupts on MIP optimization runs. Specific controls to use as stopping criteria for the MIP search are discussed in section Stopping Criteria.

{
  XPRSprob prob;
  XPRScreateprob(&prob);
  XPRSsetlogfile(prob, "logfile.log");
  XPRSreadprob(prob, "hpw15", "");
  XPRSsetintcontrol(prob, XPRS_MAXNODE, 20000);
  XPRSmipoptimize(prob, "");
  XPRSdestroyprob(prob);
}

Finally note that library users can trigger an interrupt on an optimization run (in a similar way to the Ctrl–C interrupt in Console Optimizer) using a call to the function XPRSinterrupt. It is recommended that the user call this function from a callback during the optimization run. See section Using the Callbacks for details about using callbacks.

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.