- About HiGHS
- Capabilities at a glance
- Documentation
- Installation
- Running HiGHS
- Common workflows and use cases
- Interfaces
- Reference
HiGHS is a high performance serial and parallel solver for large scale sparse linear optimization problems of the form
where
HiGHS has primal and dual revised simplex solvers, originally written by Qi Huangfu and further developed by Julian Hall. It also has an interior point solver for LP written by Lukas Schork, an active set solver for QP written by Michael Feldmeier, and a MIP solver written by Leona Gottwald. Other features have been added by Julian Hall and Ivet Galabova, who manages the software engineering of HiGHS and interfaces to C, C#, FORTRAN, Julia and Python.
Find out more about HiGHS at https://www.highs.dev.
Although HiGHS is freely available under the MIT license, we would be pleased to learn about users' experience and give advice via email sent to highsopt@gmail.com.
flowchart TB
highs["HiGHS<br/>large-scale sparse optimization"]
highs --> lp["LP"]
highs --> qp["convex QP"]
highs --> mip["MIP"]
lp --> simplex["revised simplex<br/>(dual / primal)"]
lp --> ipm["interior point<br/>(IPX, HiPO)"]
lp --> pdlp["first-order PDLP<br/>(cuPDLP, optional GPU)"]
qp --> ipm
qp --> qpasm["active-set QP<br/>(qpasm)"]
mip --> bnc["branch-and-cut<br/>+ heuristics"]
bnc -. "binary subMIP" .-> quantum["quantum / SBM<br/>heuristic"]
highs -. interfaces .-> ifaces["C++ · C · C# · Fortran<br/>Julia · Python · Rust"]
- Problem classes — linear (LP), convex quadratic (QP,
Qpositive semidefinite), and mixed-integer (MIP). - Solver engines — dual/primal revised simplex, two interior-point solvers (IPX and HiPO; HiPO also solves convex QP), a first-order PDLP solver (CPU and optional NVIDIA GPU via cuPDLP), an active-set QP solver (
qpasm), and a branch-and-cut MIP solver with a portfolio of primal heuristics. - Performance machinery — presolve/postsolve, a dependency-free in-house parallel task scheduler, warm starting, ranging, and IIS (irreducible infeasible subsystem) detection.
- Interfaces — the
highsexecutable; the C++Highsclass; C, C#, Fortran, and Julia APIs; thehighspyPython package; and the Rusthighs/highs-syscrates. - Fork additions — a quantum / Simulated-Bifurcation oscillator-Ising MIP heuristic, plus acceleration features (cuPDLP+ first-order algorithmics, mixed-precision interior point with an analog inner-solve bridge, a CPU tensor-core Ozaki-scheme GEMM, an ADMM/OSQP-style QP path, two-column presolve probing, and vectorized ratio-test kernels). See the documentation's Capabilities & use cases, Acceleration, and Quantum heuristic pages.
Documentation is available at https://ergo-code.github.io/HiGHS/.
HiGHS uses CMake as build system, and requires at least version 3.15. To generate build files in a new subdirectory called 'build', run:
cmake -S . -B build
cmake --build buildThis installs the executable bin/highs and the library lib/highs.
To test whether the compilation was successful, change into the build directory and run
ctestMore details on building with CMake can be found in HiGHS/cmake/README.md.
HiGHS is a C++17 project (the installed CMake target exports cxx_std_17, so a
consumer using find_package(HiGHS) is compiled as C++17).
To build with a modern Clang/LLVM toolchain:
cmake -S . -B build-clang -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build-clangOptional ergonomics: -DHIGHS_USE_LLD=ON (link with lld),
-DHIGHS_USE_LIBCXX=ON (Clang + libc++), -DHIGHS_COLOR_DIAGNOSTICS=ON (default).
Sanitizers are selected with the combinable HIGHS_SANITIZER option
(address, undefined, thread, leak, memory; address/thread/memory
are mutually exclusive). It instruments both C and C++ and links the shared
library accordingly:
cmake -S . -B build-asan -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DHIGHS_SANITIZER="address;undefined" -DALL_TESTS=ON \
-DHIGHS_SANITIZE_IGNORELIST=$PWD/sanitize-ignorelist.txt
cmake --build build-asan
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 ctest --test-dir build-asanRuntime suppression files for vendored code and the in-house task scheduler live
in tools/ (tsan_suppressions.txt, lsan_suppressions.txt, …) and
sanitize-ignorelist.txt. MemorySanitizer (memory) is Clang-only and needs an
MSan-instrumented libc++. The deprecated DEBUG_MEMORY option still works as an
alias for HIGHS_SANITIZER. Meson exposes the same via -Db_sanitize=... and
Bazel via --config=asan|tsan|lsan|ubsan|asan_ubsan.
As an alternative, HiGHS can be installed using the meson build interface:
meson setup bbdir -Dwith_tests=True
meson test -C bbdirThe meson build files are provided by the community and are not officially supported by the HiGHS development team. If you use this method and encounter issues, please consider contributing fixes or updates by checking the HiGHS Contribution Guide.
There is a nix flake that provides the highs binary:
nix run .You can even run without installing anything, supposing you have installed nix:
nix run github:ERGO-Code/HiGHSThe nix flake also provides the python package:
nix build .#highspy
tree result/And a devShell for testing it:
nix develop .#highspy
python
>>> import highspy
>>> highspy.Highs()The nix build files are provided by the community and are not officially supported by the HiGHS development team.
Precompiled static binaries are available at https://github.com/ERGO-Code/HiGHS/releases.
Additionally, there is one package containing shared libraries for Windows x64.
The *-mit binary packages contain HiGHS and are MIT-licenced.
The *-apache binary packages contain HiGHS with HiPO and are Apache-licenced, due to the licensing of the dependencies of HiPO. For more information, see THIRD_PARTY_NOTICES.md.
If you have any questions or requests for more platforms and binaries, please get in touch with us at hello@highs.dev.
HiGHS can read MPS files and (CPLEX) LP files, and the following command
solves the model in ml.mps
highs ml.mpsWhen HiGHS is run from the command line, some fundamental option values may be specified directly. Many more may be specified via a file. Formally, the usage is:
$ bin/highs --help
usage:
./bin/highs [options] [file]
options:
--model_file file File of model to solve.
--options_file file File containing HiGHS options.
--read_solution_file file File of solution to read.
--read_basis_file text File of initial basis to read.
--write_model_file text File for writing out model.
--solution_file text File for writing out solution.
--write_basis_file text File for writing out final basis.
--presolve text Set presolve option to:
"choose" * default
"on"
"off"
--solver text Set solver option to:
"choose" * default
"simplex"
"ipm"
--parallel text Set parallel option to:
"choose" * default
"on"
"off"
--run_crossover text Set run_crossover option to:
"choose"
"on" * default
"off"
--time_limit float Run time limit (seconds - double).
--random_seed int Seed to initialize random number
generation.
--ranging text Compute cost, bound, RHS and basic
solution ranging:
"on"
"off" * default
-v, --version Print version.
-h, --help Print help.
For a full list of options, see the options page of the documentation website.
By default HiGHS chooses a solver from the model; you can also set --solver explicitly. The decision, at a glance:
flowchart TB
start["model"] --> q_int{"integer<br/>variables?"}
q_int -- yes --> mip["MIP: branch-and-cut + heuristics<br/>(Feasibility-Jump, sbm / quantum)"]
q_int -- no --> q_hess{"quadratic<br/>objective?"}
q_hess -- yes --> qp["QP: HiPO or qpasm"]
q_hess -- "no (LP)" --> q_size{"very large &<br/>moderate accuracy ok?"}
q_size -- yes --> pdlp["PDLP first-order<br/>(optional GPU)"]
q_size -- no --> q_warm{"warm start /<br/>re-solve?"}
q_warm -- yes --> splx["revised simplex"]
q_warm -- no --> ipm["interior point<br/>(IPX / HiPO)"]
Worked, runnable models live in examples/. A few starting points:
| Workflow | Try | Problem type |
|---|---|---|
| Command line | highs model.mps (--solver=pdlp, --parallel=on, --time_limit=…) |
any LP/QP/MIP |
Python (highspy) |
examples/minimal.py, call_highs_from_python_highspy.py |
build & solve in code |
| 0/1 knapsack | examples/knapsack.py |
binary MIP |
| Min-cost network flow | examples/network_flow.py |
LP with duals |
| N-queens | examples/nqueens.py |
binary feasibility |
| Blending / distillation | examples/distillation.py |
continuous LP |
| Production planning | examples/chip.py |
MIP |
| Column generation | examples/branch-and-price.py |
branch-and-price |
| Multi-objective | examples/multi_objective.py |
lexicographic / blended |
| MIP with live callbacks | examples/callback_gap.py |
watching the gap |
| C++ library | examples/call_highs_from_cpp.cpp |
native Highs class |
| Rust crate | highs/interfaces/rust/ |
safe highs wrapper |
| MIP + physical-analogue heuristic | highs-quantum solve model.mps --backend sbm |
oscillator-Ising incumbents |
There are HiGHS interfaces for C, C#, FORTRAN, and Python in HiGHS/highs/interfaces, with example driver files in HiGHS/examples/. More on language and modelling interfaces can be found at https://ergo-code.github.io/HiGHS/stable/interfaces/other/.
We are happy to give a reasonable level of support via email sent to highsopt@gmail.com.
The python package highspy is a thin wrapper around HiGHS and is available on PyPi. It can be easily installed via pip by running
$ pip install highspyAlternatively, highspy can be built from source. Download the HiGHS source code and run
pip install .from the root directory.
The HiGHS C++ library no longer needs to be separately installed. The python package highspy depends on the numpy package and numpy will be installed as well, if it is not already present.
The installation can be tested using the small example HiGHS/examples/call_highs_from_python_highspy.py.
The Google Colab Example Notebook also demonstrates how to call highspy.
The C API is in HiGHS/highs/interfaces/highs_c_api.h. It is included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.
The nuget package Highs.Native is on https://www.nuget.org, at https://www.nuget.org/packages/Highs.Native/.
It can be added to your C# project with dotnet
dotnet add package Highs.Native --version 1.14.0The nuget package contains runtime libraries for
win-x64win-x32linux-x64linux-arm64macos-x64macos-arm64
Details for building locally can be found in nuget/README.md.
The Fortran API is in HiGHS/highs/interfaces/highs_fortran_api.f90. It is not included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.
Rust bindings live in highs/interfaces/rust/ as a two-crate Cargo workspace: highs-sys (raw bindgen FFI over the C API) and highs (a safe, idiomatic wrapper with an expression DSL, typed errors, and a GIL-free parallel runtime for solving many models concurrently). The default build compiles HiGHS from source via CMake; cargo test --no-default-features links a prebuilt tree for a fast loop.
use highs::{Highs, ModelStatus};
// max 2x + 3y s.t. x + y <= 4, x + 3y <= 6, x, y >= 0
let mut h = Highs::new().silenced();
let x = h.add_var(0.0, f64::INFINITY)?;
let y = h.add_var(0.0, f64::INFINITY)?;
h.add_constr((x + y).le(4.0))?;
h.add_constr((x + 3.0 * y).le(6.0))?;
h.maximize(2.0 * x + 3.0 * y)?;
assert_eq!(h.run()?, ModelStatus::Optimal);
println!("objective = {}", h.objective_value()); // 9See highs/interfaces/rust/README.md for build options, feature flags, and the parallel runtime.
If you use HiGHS in an academic context, please acknowledge this and cite the following article.
Parallelizing the dual revised simplex method Q. Huangfu and J. A. J. Hall Mathematical Programming Computation, 10 (1), 119-142, 2018. DOI: 10.1007/s12532-017-0130-5