Skip to content

Options issues in CPLEX MP #261

Open

Description

@4er4er4er

I get various complaints that some CPLEX option does not work, when a user of the ASL version has switched to MP. Here's a summary; the first 3 are the most serious.

network simplex
ASL: netopt requires an argument (0, 1, 2, or 3) which determines whether and how the network simplex method is applied; there are also related options
netdisplay, netfeasibility, netfind, netiterations, netoptimality, and netpricing.
MP: netopt does not accept an argument. netiterations is recognized, but the other 5 related options are not.

logs
ASL: mipdisplay and mipinterval control the contents of the MIP log; display or lpdisplay controls the simplex log, and bardisplay controls the barrier log.
MP: All of the above are accepted but do not produce any log output. outlev does produce logs, but with less control over the settings, and with a - in front of almost every line. outlev=1 would be better if it used mipdisplay=2 rather than mipdisplay=3 (which is usually more verbose than needed).

primal versus dual
ASL: primal and dual force CPLEX to solve the primal or the dual, respectively, of the problem received from AMPL. predual is similar, but chooses between the primal and the dual form of the problem that results after presolve. primalopt and dualopt select the primal or dual simplex method.
MP: primal is not recognized, and dual is treated as a synonym for dualopt (alg:dual). (predual, primalopt, and dualopt are still available.)

sensitivity
ASL: sensitivity does not have an argument. It creates suffixes .up, .down, and .current which only apply properly to objective coefficients and single right-hand sides. (There is an example of their use in the subsection Solver-defined suffixes: sensitivity analysis in the AMPL book.)
MP: sensitivity (alg:sens) requires an argument. It doesn't recognize ASL's suffixes, but defines others that are more general.

error handling
ASL: Scans the entire cplex_options string and reports every option that is in error.
MP: Stops scanning the cplex_options string after the first error is found.

Activity

  1. glebbelov commented on Apr 22, 2025

    @glebbelov
    Contributor

    MP also has alg:method:

    alg:method (method, lpmethod, simplex, mipstartalg)
          Which algorithm to use for non-MIP problems or for the root node of MIP
          problems, unless primal/dual/barrier/network/sifting flags are
          specified:
    
          -1 - Automatic (default)
          0  - Primal simplex
          1  - Dual simplex
          2  - Barrier
          3  - Nondeterministic concurrent (several solves in parallel)
          4  - Network simplex
          5  - Sifting
    
          For MIQP problems (quadratic objective, linear constraints), setting 5
          is treated as 0 and 6 as 4. For MIQCP problems(quadratic objective &
          constraints), all settings are treated as 4.
    

    This option was introduced for compatibility with other drivers.

    The last paragraph makes little sense.

  2. glebbelov commented on Apr 22, 2025

    @glebbelov
    Contributor

    Done the following changes:

    alg:netopt (netopt)
          Whether to use network simplex method for non-MIP problems or for the
          root node of MIP problems, unless
          primalopt/dualopt/barrier/network/sifting flags or alg:method are
          specified:
    
          0 - Never invoke the network optimizer
          1 - Compatibility value; same as 3
          2 - Compatibility value; same as 3
          3 - (Default) invoke the network optimizer by setting CPLEX'
              LP/QPMethod to CPX_ALG_NET telling CPLEX to search for network
              (sub)structures in the model. CPLEX presolve might influence
              automatic recognition of network structures
    

    The reason is, we don't parse any arc/node info in FlatConverter. Instead, we only use value 3 of netopt, which is the default (i.e., any LP is analyzed for network by default; this is affected by CPLEX presolve).

    Fixed logs.

    Option dual was manually implemented in cplexasl. Changed it to be dummy:

    'dual' Options:
    
    alg:dual (dualopt)
          Solve (MIP root) LPs by dual simplex method.
    
    alg:dualproblem (dual)
          Compatibility option with the legacy cplexasl driver. No effect.
    
    pre:dual (predual)
          Whether CPLEX's presolve phase should present the CPLEX solution
          algorithm with the primal(-1) or dual(1) problem or (default = 0) should
          decide automatically.
    
    'primal' Options:
    
    alg:primal (primalopt)
          Solve (MIP root) LPs by primal simplex method.
    
    alg:primalproblem (primal)
          Compatibility option with the legacy cplexasl driver. No effect.
    

    We might still think about priorities between alg:method / alg:priamlopt... / alg:netopt.

  3. glebbelov commented on Apr 23, 2025

    @glebbelov
    Contributor

    More changes:

    1. netopt=0 default
    2. alg:method and mip:nodemethod override the keyword flags alg:primalopt etc., which override netopt
    3. Aligned alg:method values with those of mip:nodemethod, mip:submipstartalg, mip:submipalg.
    4. Added suffixes .down/.up/.current for objective coefficients and .down/.up for RHS constraints (Gurobi, CPLEX, Mosek).

    In detail on 1.:

    alg:netopt (netopt)
          Whether to use network simplex method for non-MIP problems or for the
          continuous relaxations of MIP nodes, unless alg:(node)method
          orprimalopt/dualopt/barrier/network/sifting flags are specified. Options
          alg:(node)method override (for MIP, in the root or subnodes):
    
          0 - (Default) never invoke the network optimizer
          1 - Compatibility value; same as 3
          2 - Compatibility value; same as 3
          3 - Invoke the network optimizer by setting CPLEX' LP/QP/MIPNodeMethod
              to CPX_ALG_NET telling CPLEX to search for network (sub)structures
              in the model. CPLEX presolve might influence automatic recognition
              of network structures
    
    alg:network (network)
          Solve (substructure of) (MIP node's) LP/QP by network simplex method.
          Synonym for alg:netopt=3.
    

    In detail on 2., 3.:

    alg:method (method, lpmethod, qpmethod, simplex, mip:method, mipstartalg)
          Which algorithm to use for non-MIP problems or for the root node of MIP
          problems:
    
          0 - Automatic (default)
          1 - Primal simplex
          2 - Dual simplex
          3 - Network simplex
          4 - Barrier
          5 - Sifting
          6 - Concurrent (dual, barrier and primal in opportunistic mode; dual
              and barrier in deterministic mode; 4 is used for MIPQs).
    
          For MIQP problems (quadratic objective, linear constraints), setting 5
          is treated as 0 and 6 as 4. For MIQCP problems (quadratic objective &
          constraints), all settings are treated as 4. See also mip:nodemethod.
          Overrides netopt option and primalopt/dualopt/barrier/network/sifting
          flags.
    
    mip:nodemethod (nodemethod, mipalg, mipalgorithm)
          Algorithm used to solve relaxed MIP node problems (after the initial
          relaxation); for MIQP problems (quadratic objective, linear
          constraints), settings other than 3 and 5 are treated as 0. For MIQCP
          problems (quadratic objective and constraints), only 0 is permitted.
    
          0 - Automatic (default)
          1 - Primal simplex
          2 - Dual simplex
          3 - Network simplex
          4 - Barrier
          5 - Sifting
    
          See also alg:method. Overrides netopt option and
          primalopt/dualopt/barrier/network/sifting flags.
    
    mip:submipalg (submipalg)
          Choice of algorithm used to solve the subproblems of a subMIP: not a
          subproblem, but an auxiliary MIP that CPLEX sometimes forms and solves,
          e.g., when dealing with a partial MIP start, repairing an infeasible MIP
          start, using the RINS heuristic, branching locally or polishing a
          solution. Possible values (only 0 is allowed for MIQCPs):
    
          0 - Automatic (default)
          1 - Primal simplex
          2 - Dual simplex
          3 - Network simplex
          4 - Barrier
          5 - Sifting
    
    mip:submipstartalg (submipstartalg)
          Rarely used choice of algorithm for the initial relaxation of a subMIP
          (described with "submipalg"):
    
          0 - Automatic (default)
          1 - Primal simplex
          2 - Dual simplex
          3 - Network simplex
          4 - Barrier
          5 - Sifting
          6 - Concurrent (dual, barrier and primal in opportunistic mode; dual
              and barrier in deterministic mode; 4 is used for MIPQs).
    

    In detail on 4.:

    alg:sens (sens, solnsens, sensitivity)
          Whether to return suffixes for solution sensitivities, i.e., ranges of
          values for which the optimal basis remains optimal (note that the
          variable and objective values can change):
    
          0 - No (default)
          1 - Yes: suffixes returned on variables are
          .sensobjlo = smallest objective coefficients
          .down = same as .sensobjlo
          .sensobj = current objective coefficients
          .current = same as .sensobj
          .sensobjhi = greatest objective coefficients
          .up = same as .sensobjhi
          .senslblo = smallest variable lower bounds
          .senslbhi = greatest variable lower bounds
          .sensublo = smallest variable upper bounds
          .sensubhi = greatest variable upper bounds;
    
          suffixes for all constraints are
    
          .senslblo = smallest constraint lower bounds
          .senslbhi = greatest constraint lower bounds
          .sensublo = smallest constraint upper bounds
          .sensubhi = greatest constraint upper bounds;
    
          suffixes for one-sided constraints only:
    
          .sensrhslo = smallest right-hand side values
          .down = same as .sensrhslo
          .sensrhshi = greatest right-hand side values.
          .up = same as .sensrhshi.
    
          The suffixes correspond to the AMPL solver model, command 'solexpand'.
          For easiest interpretation, disable AMPL presolve, 'option presolve 0;'
    
  4. added a commit that references this issue on Apr 23, 2025
  5. glebbelov commented on Apr 29, 2025

    @glebbelov
    Contributor

    The changes have been released in 20250424.

  6. glebbelov commented on May 1, 2025

    @glebbelov
    Contributor

    dual and predual are now connected to imitate CPLEX ASL:

    'dual' Options:
    
    alg:dualopt (alg:dual, dualopt)
          Solve (MIP node) LPs by dual simplex method.
    
    alg:dualproblem (dual)
          Compatibility option with the legacy cplexasl driver. Interacts with
          pre:dual as follows:
    
          alg:dualproblem - alone, equivalent to pre:dual=0
          alg:dualproblem pre:dual=-1 - together, equivalent to pre:dual=1
          alg:dualproblem pre:dual=0 - together, equivalent to pre:dual=0
          alg:dualproblem pre:dual=1 - together, equivalent to pre:dual=-1.
    
    pre:dual (predual)
          Whether CPLEX's presolve phase should present the CPLEX solution
          algorithm with the primal(-1) or dual(1) problem or (default = 0) should
          decide automatically.
    
          For compatibility, pre:dual interacts with alg:dualproblem.
    

    For comparison, here CPLEX ASL versions:

    dual                   Single-word phrase:  solve the dual problem.
    
    dualopt                Single-word phrase:  use a dual simplex algorithm.
    
    predual                Whether CPLEX's presolve phase should present the
                           CPLEX solution algorithm with the primal (-1) or
                           dual (1) problem or (default = 0) should decide
                           which automatically.  Specifying "predual=1" often
                           gives better performance than specifying just "dual",
                           but sometimes "dual predual=1" is still better.
    

    To be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions