highs-js / TypeScript + WebAssembly

Linear Optimizer for JavaScript.

The open-source HiGHS optimization solver, packaged for Node.js and modern browsers. Build and solve linear, mixed-integer, and convex quadratic models from JavaScript and TypeScript.

npm install highs@next Node.js 18+
quick startES module
// Load the WebAssembly runtime
import loadHighs from "highs";
const highs = await loadHighs();

// Solve a model in CPLEX LP format
const result = highs.solve(lpText);
console.log(result.ObjectiveValue);
LP · MIP · convex QP

Three useful classes of optimization problem.

HiGHS is designed for models whose objective and constraints are linear, plus continuous convex quadratic objectives. Choose the class that matches which variables must be discrete and whether the objective contains quadratic terms.

LP

Linear programs

Continuous decisions with a linear objective and linear row bounds. HiGHS provides revised simplex, interior-point with crossover, and PDLP algorithms.

MILP

Mixed-integer programs

Linear models with integer, binary, or semi-continuous columns. HiGHS uses branch-and-cut with presolve, heuristics, and gap-based stopping.

QP

Convex quadratic programs

Continuous columns, linear constraints, and a convex quadratic objective supplied as a sparse Hessian. Non-convex QP and MIQP are outside HiGHS’ scope.

The browser package exposes both the convenient path and the solver machinery underneath it.

APIs
solve(lpText) · persistent createModel() · raw C interface
Model input
LP and MPS text · typed sparse CSC/CSR matrices · incremental mutation
MIP
binary/integer variables · starts · SOS1/SOS2 · callbacks · solution injection
Analysis
basis access · primal/dual rays · ranging · IIS · feasibility relaxation
Execution
Node.js or browser WebAssembly · in-memory model import/export
Problem scope
no general nonlinear models · no mixed-integer quadratic programs
Browser limits
single-threaded solve · no native filesystem paths

Runnable API examples

Loading runnable examples…