Initializing help system before first use

Introduction

Topics covered in this section:

This quick reference guide presents a collection of MIP model formulations for Xpress Optimizer, including standard linearization techniques involving binary variables, the use of more specific modeling objects such as SOS and partial integer variables, and reformulations of logic constraints through indicator constraints.

Integer Programming entities supported in Xpress

  • Binary variables (BV)decision variables that must take either the value 0 or the value 1, sometimes called 0/1 variables;
  • Integer variables (UI)decision variables that must take on integer values. Some upper limit must be specified;
  • Partial integer variables (PI)decision variables that must take integer values below a specified limit but can take any value above that limit;
  • Semi-continuous variables (SC)decision variables that must take on either the value 0, or any value in a range whose lower an upper limits are specified. SCs help model situations where, if a variable is to be used at all, it has to be at some minimum level;
  • Semi-continuous integer variables (SI)decision variables that must take either the value 0, or any integer value in a range whose lower and upper limits are specified;
  • Special ordered sets of type one (SOS1)an ordered set of variables of which at most one can take a nonzero value;
  • Special ordered sets of type two (SOS2)an ordered set of variables of which at most two can be nonzero, and if two are nonzero, they must be consecutive in their ordering.

Remarks

  • The solution values of binary and integer variables are real valued, not integer valued.
  • At an optimal MIP solution, the actual values of the binary and integer variables will be integer – to within a certain tolerance.

Integer Programming entities in Mosel

Definition: integer programming types are defined as unary constraints on previously declared decision variables of type mpvar; name the constraints if you want to be able to access/modify them.

model "intromip"
 uses "mmxprs"
 declarations
  d: mpvar
  ifmake: array(PRODS,LINES) of mpvar
  x: mpvar
 end-declarations

 d is_binary                      ! Single binary variable
 forall(p in PRODS, l in LINES)
  ifmake(p,l) is_binary           ! An array of binaries

 ACtr:= x is_integer              ! An integer variable
 x >= MINVAL                      ! Lower bound on the variable
 x <= MAXVAL                      ! Upper bound on the variable
 ! MINVAL,MAXVAL: values between -MAX_REAL and MAX_REAL
 ...
 ACtr:= x is_partint 10           ! Change type to partial integer
 ...
 ACtr:= 0                         ! Delete constraint
! Equivalently:
 ACtr:= x is_continuous           ! Change type to continuous
 ...

Solving: with Xpress Optimizer (Mosel module mmxprs) any problem containing integer programming entities is automatically solved as a MIP problem, to solve just the LP relaxation use option XPRS_LPSTOP (if following up with MIP search) or XPRS_LIN (ignore all MIP information) for maximize / minimize.

 minimize(d)                      ! Solve the MIP problem
 minimize(XPRS_LPSTOP, d)         ! Solve the LP releaxation

Accessing the solution: for obtaining solution values of decision variables and linear expressions use getsol (alternative syntax: .sol); the MIP problem status is returned by the function getparam("XPRS_MIPSTATUS")

 case getparam("XPRS_MIPSTATUS") of
  XPRS_MIP_NOT_LOADED,
    XPRS_MIP_LP_NOT_OPTIMAL: writeln("Solving not started")
  XPRS_MIP_LP_OPTIMAL:       writeln("Root LP solved")
  XPRS_MIP_UNBOUNDED:        writeln("LP unbounded")
  XPRS_MIP_NO_SOL_FOUND,
    XPRS_MIP_INFEAS:         writeln("MIP search started, no solution")
  XPRS_MIP_SOLUTION,
    XPRS_MIP_OPTIMAL:        writeln("MIP solution: ", , getobjval)
 end-case

 writeln("x: ", getsol(x))
 writeln("d: ", d.sol)

© 2001-2025 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.