HiGHS.jl
HiGHS.jl is a wrapper for the HiGHS solver.
It has two components:
- a thin wrapper around the complete C API
- an interface to MathOptInterface
Affiliation
This wrapper is maintained by the JuMP community and is not an official project of the HiGHS developers.
Getting help
If you need help, please ask a question on the JuMP community forum.
If you have a reproducible example of a bug, please open a GitHub issue.
License
HiGHS.jl
is licensed under the MIT License.
The underlying solver, ERGO-Code/HiGHS, is licensed under the MIT license.
Installation
Install HiGHS as follows:
import Pkg
Pkg.add("HiGHS")
In addition to installing the HiGHS.jl package, this will also download and install the HiGHS binaries. You do not need to install HiGHS separately.
To use a custom binary, read the Custom solver binaries section of the JuMP documentation.
Use with JuMP
To use HiGHS with JuMP, use HiGHS.Optimizer
:
using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
# Set options as needed, for example:
set_attribute(model, "presolve", "on")
set_attribute(model, "time_limit", 60.0)
MathOptInterface API
The HiGHS optimizer supports the following constraints and attributes.
List of supported objective functions:
MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}
MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{Float64}}
List of supported variable types:
List of supported constraint types:
MOI.ScalarAffineFunction{Float64}
inMOI.EqualTo{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.GreaterThan{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.Interval{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.LessThan{Float64}
MOI.VariableIndex
inMOI.EqualTo{Float64}
MOI.VariableIndex
inMOI.GreaterThan{Float64}
MOI.VariableIndex
inMOI.Integer
MOI.VariableIndex
inMOI.Interval{Float64}
MOI.VariableIndex
inMOI.LessThan{Float64}
MOI.VariableIndex
inMOI.Semicontinuous{Float64}
MOI.VariableIndex
inMOI.Semiinteger{Float64}
MOI.VariableIndex
inMOI.ZeroOne
List of supported model attributes:
Options
See the HiGHS documentation for a full list of the available options.
Infeasibility certificates
By default, HiGHS.jl will attempt to compute an infeasibility certificate when the primal or dual is infeasible. If you do not require the certificate, set the HiGHS.ComputeInfeasibilityCertificate
attribute to false
:
using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
set_attribute(model, HiGHS.ComputeInfeasibilityCertificate(), false)
C API
The C API can be accessed via HiGHS.Highs_xxx
functions, where the names and arguments are identical to the C API.
Threads
HiGHS uses a global scheduler that is shared between threads.
Before changing the number of threads using MOI.Threads()
, you must call Highs_resetGlobalScheduler(1)
:
using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
Highs_resetGlobalScheduler(1)
set_attribute(model, MOI.NumberOfThreads(), 1)
If modifying the number of HiGHS threads across different Julia threads, be sure to read the docstring of Highs_resetGlobalScheduler
. In particular, resetting the scheduler is not thread-safe.