Reference

Options

A reference for the options to configure Mixed Integer Programs (MIP).

If both an environment variable and its corresponding CLI flag are defined, the CLI flag will overwrite the environment variable.

These are the default options that are available with MIP.

Nextmv Hybrid Optimization Platform VERSION
Usage:
  -runner.input.path string
    	The input file path (env RUNNER_INPUT_PATH)
  -runner.output.path string
    	The output file path (env RUNNER_OUTPUT_PATH)
  -runner.output.solutions string
    	{all, last} (env RUNNER_OUTPUT_SOLUTIONS) (default "last")
  -runner.profile.cpu string
    	The CPU profile file path (env RUNNER_PROFILE_CPU)
  -runner.profile.memory string
    	The memory profile file path (env RUNNER_PROFILE_MEMORY)
  -solve.control.bool string
    	List of solver-specific control options (configurations) with bool values. Example: "name1=value1,name2=value2", where value1 and value2 are bool values. (env SOLVE_CONTROL_BOOL)
  -solve.control.float string
    	List of solver-specific control options (configurations) with float values. Example: "name1=value1,name2=value2", where value1 and value2 are float values. (env SOLVE_CONTROL_FLOAT)
  -solve.control.int string
    	List of solver-specific control options (configurations) with int values. Example: "name1=value1,name2=value2", where value1 and value2 are int values. (env SOLVE_CONTROL_INT)
  -solve.control.string string
    	List of solver-specific control options (configurations) with string values. Example: "name1=value1,name2=value2", where value1 and value2 are string values. (env SOLVE_CONTROL_STRING)
  -solve.duration duration
    	Maximum duration of the solver. (env SOLVE_DURATION) (default 30s)
  -solve.mip.gap.absolute float
    	Absolute gap stopping value. If the problem is an integer problem the solver will stop if the gap between the relaxed problem and the best found integer problem is less than this value. (env SOLVE_MIP_GAP_ABSOLUTE) (default 1e-06)
  -solve.mip.gap.relative float
    	Relative gap stopping value. If the problem is an integer problem the solver will stop if the relative gap between the relaxed problem and the best found integer problem is less than this value. (env SOLVE_MIP_GAP_RELATIVE) (default 0.0001)
  -solve.verbosity value
    	{off, low, medium, high} Verbosity of the solver in the console. (env SOLVE_VERBOSITY)
Copy

Valid time units for -solve.duration are as follows, according to time.ParseDuration from Go's standard library:

  • ns (nanoseconds)
  • us/µs (microseconds)
  • ms (milliseconds)
  • s (seconds)
  • m (minutes)
  • h (hours)

The solve duration is displayed in ns in the output.

The options are marshalled to the output when running an app, under the options key. Here is an example of how the options are displayed.

"options": {
  "solve": {
    "control": {
      "bool": [],
      "float": [],
      "int": [],
      "string": []
    },
    "duration": 10000000000,
    "mip": {
      "gap": {
        "absolute": 0.000001,
        "relative": 0.0001
      }
    },
    "verbosity": "off"
  }
},
Copy

Solver control parameters

Please find relevant links and examples for each provider in the supported solvers page.

The Nextmv SDK has options for controlling the solver that work regardless of the provider being used. Some of these options include (using CLI-style flags):

  • -solve.duration: maximum duration of the solve.
  • -solve.verbosity: verbosity of the solver.
  • -solve.mip.gap.relative: relative gap for the MIP solver.
  • -solve.mip.gap.absolute: absolute gap for the MIP solver.

Each provider has its own set of parameters for controlling the solver. Depending on the option's data type, you can use one of the following flags (the list showcases CLI-style flags) to set these parameters:

  • -solve.control.bool: parameters with bool values.
  • -solve.control.float: parameters with float values.
  • -solve.control.int: parameters with int values.
  • -solve.control.string parameters with string values.

Each of these options receives a name=value pair. To set multiple options of the same type, use a comma-separated list: name1=value1,name2=value2. Note that not all providers support all data types.

Here is an example where out-of-the-box SDK options are set, alongside HiGHS-specific options. The Nextmv CLI is used. Notice that some options set multiple solver parameters.

nextmv sdk run . -- \
    -runner.input.path input.json \
    -runner.output.path output.json \
    -solve.duration 10s \
    -solve.mip.gap.absolute 80 \
    -solve.mip.gap.relative 0.4 \
    -solve.verbosity high \
    -solve.control.float "mip_heuristic_effort=0.7" \
    -solve.control.int "mip_max_nodes=200,threads=1" \
    -solve.control.string "presolve=off"

Copy

Given that verbosity is set to high, the console will show the solver's log (exposing that the options were set):

--------------------------------------------------------------------------------
This software is provided by Nextmv.
The current Nextmv token expires in 90 days.

© 2019-2023 nextmv.io inc. All rights reserved.

    (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)
    (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)
   o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)
--------------------------------------------------------------------------------
Running HiGHS 1.3.1 [date: 2023-01-01, git hash: abcd1234]
Copyright (c) 2022 ERGO-Code under MIT licence terms
Running with 1 thread(s)

Presolve is switched off
Objective function is integral with scale 1

Solving MIP model with:
   1 rows
   11 cols (11 binary, 0 integer, 0 implied int., 0 continuous)
   11 nonzeros

        Nodes      |    B&B Tree     |            Objective Bounds              |  Dynamic Constraints |       Work      
     Proc. InQueue |  Leaves   Expl. | BestBound       BestSol              Gap |   Cuts   InLp Confl. | LpIters     Time

         0       0         0   0.00%   543             -inf                 inf        0      0      0         0     0.0s
 S       0       0         0   0.00%   543             444               22.30%        0      0      0         0     0.0s

Solving report
  Status            Optimal
  Primal bound      444
  Dual bound        451
  Gap               1.58% (tolerance: 40%)
  Solution status   feasible
                    444 (objective)
                    0 (bound viol.)
                    0 (int. viol.)
                    0 (row viol.)
  Timing            0.00 (total)
                    0.00 (presolve)
                    0.00 (postsolve)
  Nodes             1
  LP iterations     1 (total)
                    0 (strong br.)
                    0 (separation)
                    0 (heuristics)
Copy

The output also shows the options that were used:

"options": {
  "solve": {
    "control": {
      "bool": [],
      "float": [
        {
          "name": "mip_heuristic_effort",
          "value": 0.7
        }
      ],
      "int": [
        {
          "name": "mip_max_nodes",
          "value": 200
        },
        {
          "name": "threads",
          "value": 1
        }
      ],
      "string": [
        {
          "name": "presolve",
          "value": "off"
        }
      ]
    },
    "duration": 10000000000,
    "mip": {
      "gap": {
        "absolute": 80,
        "relative": 0.4
      }
    },
    "verbosity": "off"
  }
},
Copy

Page last updated

Go to on-page nav menu