Highs

HiGHS

Reference for using HiGHS with Nextmv

HiGHS logo

HiGHS is a high performance serial and parallel open-source solver used for solving large-scale sparse linear programming (LP), mixed-integer programming (MIP) and quadratic programming (QP) models.

Get started using HiGHS with Go (Nextmv SDK)

When running locally, this solver is supported natively using Nextmv's Go SDK.

Specify the highs feature in your app.yaml manifest:

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: go
runtime: ghcr.io/nextmv-io/runtime/default:latest

# Directives to build a Go binary from the app.
build:
  command: go build -o main .
  environment:
    GOOS: linux
    GOARCH: arm64
    CGO_ENABLED: 1
    CC: "zig cc -target aarch64-linux-musl"

# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main
Copy

HiGHS supports the use of these flags:

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

Please visit HiGHS's documentation for a full list of all the solver control parameters.

Take the simplex_update_limit parameter as an example:

simplex_update_limit

Limit on the number of simplex UPDATE operations
Type: integer
Range: {0, 2147483647}
Default: 5000
Copy

The Type indicates the data type of the parameter. In this case, it is an integer. To set this parameter, use the -solve.control.int flag as -solve.control.int "simplex_update_limit=10000".

Here is an example where out-of-the-box SDK options are set, alongside different 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

License

HiGHS does not require additional licensing or setup for running locally or remotely on Nextmv Platform.

Supported version

The current supported HiGHS version when using Go is v1.3.0. If you’re using Python, you can specify which version you would like to use in requirements.txt and that version will be bundled as a dependency.

Languages & runtimes

Supported languages and available runtimes for HiGHS apps are listed in the table below. These properties must be defined in the app manifest for your app to run remotely.

Language Runtime
Goghcr.io/nextmv-io/runtime/default
Pythonghcr.io/nextmv-io/runtime/python

Community apps

The community apps listed in the table below use HiGHS.

Community app Description
go-highs-knapsackSolve a knapsack problem with HiGHS.
go-highs-orderfulfillmentSolve an order fulfillment problem with HiGHS.
go-highs-shiftschedulingSolve a shift scheduling with HiGHS.
python-highs-knapsackSolve a knapsack problem with HiGHS.
python-ampl-facilitylocationSolve a facility location problem with AMPL and HiGHS.
python-ampl-knapsackSolve a knapsack problem with AMPL and HiGHS.
python-ampl-priceoptimizationSolve a price optimization problem with AMPL and HiGHS.
python-pyoptinterface-knapsackSolve a knapsack problem with PyOptInterface and HiGHS.

Clone a community app locally using Nextmv CLI:

nextmv community clone -a go-highs-knapsack
Copy

Marketplace apps

The HiGHS Shift Scheduling and HiGHS Order Fulfillment apps in Nextmv Marketplace use HiGHS.

Sign up for a free Nextmv Cloud account to test out the HiGHS Shift Scheduling and HiGHS Order Fulfillment apps.

Page last updated

Go to on-page nav menu