HiGHS - High Performance Mathematical Optimization

VerifiedSafe

Provides comprehensive assistance with HiGHS, an open-source solver for linear, mixed-integer, and quadratic programming. Helps users set up, modify, and solve optimization models programmatically in Python, C++, Julia, and other languages. Useful for production-level optimization tasks requiring high performance and parallel solvers.

Sby Skills Guide Bot
Data & AIIntermediate
6/2/2026
Claude CodeCursorWindsurf
#highs#linear-programming#mixed-integer-programming#quadratic-programming#optimization

Recommended for

Automated summary

Comprehensive assistance for using HiGHS, an open-source software for solving linear, mixed-integer, and quadratic programming problems.

Strengths

  • Broad support for problem types (LP, MILP, QP)
  • Multi-language interfaces (Python, C++, Julia, etc.)
  • Parallelization and GPU acceleration options
  • Integrated official documentation for accurate advice

Limitations

  • Cannot solve integer quadratic programming problems
  • Requires optimization knowledge to tune solver options
  • Very large models may need advanced configuration
When to use it

When you need to solve linear, mixed-integer, or quadratic programming problems programmatically.

When not to use it

For non-linear optimization or very simple problems better solved with analytical methods or basic tools.

Security analysis

Safe
Quality score90/100

The skill provides documentation and code examples for using the HiGHS optimization library. It does not instruct any destructive, exfiltrating, or obfuscated actions. All commands (e.g., pip install, cmake build) are standard and legitimate for scientific computing. No risk of executing harmful operations.

No concerns found

How this analysis is made

Examples

Solving a Simple LP
Help me set up and solve a linear programming problem using HiGHS in Python. Minimize x + 2y subject to 0 ≤ x ≤ 10, 0 ≤ y ≤ 10, and x + y ≥ 5.
MILP Model with Integer Variables
How do I create a mixed-integer linear programming model in HiGHS with Julia and JuMP? I need to minimize cost with binary variables.
Performance Tuning for Large Problems
I have a large LP with millions of variables. What HiGHS options should I set for the best performance, including parallel solving or GPU?

name: highs description: High Performance Optimization Software for solving linear programming (LP), mixed integer linear programming (MILP), and quadratic programming (QP) problems

HiGHS - High Performance Optimization Software

Comprehensive assistance with HiGHS development, generated from official documentation.

HiGHS is open-source software for defining, modifying, and solving large-scale sparse linear optimization models. It's freely available under MIT license with no third-party dependencies.

When to Use This Skill

Use this skill when:

  • Solving linear programming (LP) problems
  • Solving mixed integer linear programming (MILP) problems
  • Solving quadratic programming (QP) problems
  • Implementing optimization solutions in C++, Python (highspy), Julia, C, C#, Fortran, or Rust
  • Building or modifying optimization models programmatically
  • Working with MPS or CPLEX LP file formats
  • Optimizing performance with parallel solvers or GPU acceleration
  • Setting solver options and tolerances
  • Hot-starting from existing solutions or bases

Problem Types Supported

HiGHS can solve problems of the form:

Linear Programming (LP):

minimize    c^T x
subject to  L ≤ Ax ≤ U
            l ≤ x ≤ u

Mixed Integer Linear Programming (MILP): Same as LP, but some variables must take integer values.

Quadratic Programming (QP): LP with additional objective term ½x^T Q x where Q is positive semi-definite. (Note: Cannot solve integer QP problems)

Solvers Available

  • Simplex methods: Revised simplex (primal and dual)
  • Interior point method: For continuous LP and QP
  • PDLP: First-order primal-dual method (GPU-accelerated option available)
  • Branch-and-cut: For MILP
  • Active set: For QP

Quick Reference

Common Patterns

1. Basic Model Setup (Python with highspy)

import highspy
h = highspy.Highs()

# Read model from file
h.readModel("model.mps")

# Solve
h.run()

# Get solution
solution = h.getSolution()
info = h.getInfo()

2. Building a Model Programmatically

import highspy
h = highspy.Highs()

# Add variables (one at a time)
h.addCol(cost=1.0, lower=0.0, upper=4.0, num_nz=0, index=None, value=None)  # x
h.addCol(cost=1.0, lower=1.0, upper=float('inf'), num_nz=0, index=None, value=None)  # y

# Set variable as integer
h.changeColIntegrality(1, highspy.HighsVarType.kInteger)

# Set objective sense
h.changeObjectiveSense(highspy.ObjSense.kMinimize)

# Solve
h.run()

3. Using with Julia JuMP

using JuMP
import HiGHS

model = Model(HiGHS.Optimizer)
set_optimizer_attribute(model, "presolve", "on")
set_optimizer_attribute(model, "time_limit", 60.0)

# Define your optimization model...
optimize!(model)

4. Setting Options

h = highspy.Highs()

# Common options
h.setOptionValue("presolve", "on")
h.setOptionValue("time_limit", 100.0)
h.setOptionValue("mip_rel_gap", 0.01)
h.setOptionValue("solver", "ipm")  # interior point method

# For GPU acceleration with PDLP
h.setOptionValue("solver", "pdlp")
h.setOptionValue("kkt_tolerance", 1e-4)  # Recommended for PDLP

5. Hot Starting

# Set initial solution
h.setSolution(solution)

# Set initial basis
h.setBasis(basis)

# Run from warm start
h.run()

6. Extracting Model Information

# Get model dimensions
num_cols = h.getNumCols()
num_rows = h.getNumRows()
num_nz = h.getNumEntries()

# Get specific column/row data
col_data = h.getCol(col_index)
row_data = h.getRow(row_index)

# Get matrix coefficient
coeff = h.getCoeff(row_index, col_index)

7. Modifying Models

# Change objective coefficient
h.changeColCost(col_index, new_cost)

# Change bounds
h.changeColBounds(col_index, new_lower, new_upper)
h.changeRowBounds(row_index, new_lower, new_upper)

# Change matrix coefficient
h.changeCoeff(row_index, col_index, new_value)

Reference Files

This skill includes comprehensive documentation in references/:

  • api.md - Api documentation
  • getting_started.md - Getting Started documentation
  • guide.md - Guide documentation
  • options.md - Options documentation
  • solvers.md - Solvers documentation
  • terminology.md - Terminology documentation

Use view to read specific reference files when detailed information is needed.

Key Concepts

Installation

Via Package Managers:

  • Python: pip install highspy or conda install highs
  • Julia: using Pkg; Pkg.add("HiGHS")
  • C#: NuGet package available
  • Rust: Available via cargo

From Source:

git clone https://github.com/ERGO-Code/HiGHS.git
cd HiGHS
cmake -S. -B build
cmake --build build --parallel

File Formats Supported

  • .mps - MPS format (industry standard)
  • .lp - CPLEX LP format
  • .gz - Compressed files (gzip)

Data Structures

Key Classes:

  • HighsLp - Linear programming model data
  • HighsModel - General optimization model
  • HighsSparseMatrix - Sparse matrix representation
  • HighsHessian - Quadratic objective Hessian
  • HighsSolution - Solution data
  • HighsBasis - Basis status information
  • HighsInfo - Solver statistics and info

Important Enums:

  • HighsModelStatus - Model status (optimal, infeasible, unbounded, etc.)
  • HighsVarType - Variable types (continuous, integer, semi-continuous, etc.)
  • ObjSense - Objective sense (minimize, maximize)

Tolerances and Accuracy

HiGHS uses absolute tolerances by default (default: 1e-7):

  • Primal feasibility tolerance - How close to feasible
  • Dual feasibility tolerance - Dual constraint violations
  • Optimality tolerance - KKT condition satisfaction

Important: PDLP uses relative tolerances. For PDLP, increase kkt_tolerance to 1e-4 for faster convergence.

GPU Acceleration

PDLP solver can run on NVIDIA GPUs (Linux/Windows only):

  • Requires CUDA Toolkit and matching NVIDIA driver
  • Must build HiGHS locally with CMake
  • Set solver to "pdlp" and adjust tolerances

Callbacks

HiGHS supports callbacks for:

  • Logging custom output
  • Implementing custom termination criteria
  • Monitoring solver progress
  • Extracting intermediate solutions

Working with This Skill

For Beginners

  1. Start with references/getting_started.md for installation and basic concepts
  2. Review problem formulations in references/terminology.md
  3. Try basic examples from references/api.md

For Specific Features

  • Building models: references/guide.md (Basic features section)
  • API reference: references/api.md (C++, Python, Julia interfaces)
  • Solver options: references/options.md
  • Advanced topics: references/guide.md (GPU, hot start, presolve)
  • Performance tuning: references/solvers.md

For Code Examples

  • Python examples in references/api.md (Python section)
  • Julia examples in references/api.md (Julia section)
  • C++ examples in references/api.md (C++ section)

Performance Benchmarks

HiGHS is competitive with commercial solvers. See:

  • Mittelmann LP benchmarks (feasibility and optimality)
  • Mittelmann MILP benchmarks

Common Use Cases

  1. Supply chain optimization - Minimize costs while meeting constraints
  2. Resource allocation - Optimize resource distribution
  3. Production planning - Maximize output or minimize waste
  4. Portfolio optimization - Balance risk and return (QP)
  5. Network flow problems - Transportation, routing
  6. Scheduling - Job shop, employee scheduling (MILP)
  7. Cutting stock problems - Minimize material waste

Resources

references/

Organized documentation extracted from official sources. These files contain:

  • Detailed explanations
  • Code examples with language annotations
  • Links to original documentation
  • Table of contents for quick navigation

scripts/

Add helper scripts here for common automation tasks.

assets/

Add templates, boilerplate, or example projects here.

Citing HiGHS

If you use HiGHS in an academic context, please cite:

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

Troubleshooting

Model Status Not Optimal

  • Check HighsInfo for infeasibility/unboundedness indicators
  • Review constraint feasibility and objective bounds
  • Try different solvers (simplex, IPM, PDLP)

PDLP Reports Optimal But HiGHS Says Not Optimal

  • PDLP uses relative tolerances vs absolute
  • Increase kkt_tolerance to 1e-4
  • Check HighsInfo for actual infeasibility values
  • Consider if the solution is "good enough" for your use case

Slow Performance

  • Enable presolve: setOptionValue("presolve", "on")
  • Try parallel mode for large problems
  • Adjust time limits and MIP gap tolerances
  • Consider GPU acceleration for very large LPs (PDLP)

Memory Issues with Large Models

  • Use sparse matrix representations
  • Pass models via passModel() rather than building incrementally
  • Consider model compression techniques

Additional Resources

  • GitHub: https://github.com/ERGO-Code/HiGHS
  • Documentation: https://ergo-code.github.io/HiGHS/dev/
  • Contact: highsopt@gmail.com

Notes

  • This skill was automatically generated from official HiGHS documentation
  • Reference files preserve structure and examples from source docs
  • Code examples include language detection for syntax highlighting
  • All references link back to original documentation

Updating

To refresh this skill with updated documentation:

  1. Re-run the scraper: python3 cli/doc_scraper.py --config configs/highs.json
  2. The skill will be rebuilt with the latest information

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/highs-high-performance-mathematical-optimization-mm5t897j/download' --output '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md.part' && mv '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md.part' '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Quick Reference

Common Patterns

1. Basic Model Setup (Python with highspy)

import highspy
h = highspy.Highs()

# Read model from file
h.readModel("model.mps")

# Solve
h.run()

# Get solution
solution = h.getSolution()
info = h.getInfo()

2. Building a Model Programmatically

import highspy
h = highspy.Highs()

# Add variables (one at a time)
h.addCol(cost=1.0, lower=0.0, upper=4.0, num_nz=0, index=None, value=None)  # x
h.addCol(cost=1.0, lower=1.0, upper=float('inf'), num_nz=0, index=None, value=None)  # y

# Set variable as integer
h.changeColIntegrality(1, highspy.HighsVarType.kInteger)

# Set objective sense
h.changeObjectiveSense(highspy.ObjSense.kMinimize)

# Solve
h.run()

3. Using with Julia JuMP

using JuMP
import HiGHS

model = Model(HiGHS.Optimizer)
set_optimizer_attribute(model, "presolve", "on")
set_optimizer_attribute(model, "time_limit", 60.0)

# Define your optimization model...
optimize!(model)

4. Setting Options

h = highspy.Highs()

# Common options
h.setOptionValue("presolve", "on")
h.setOptionValue("time_limit", 100.0)
h.setOptionValue("mip_rel_gap", 0.01)
h.setOptionValue("solver", "ipm")  # interior point method

# For GPU acceleration with PDLP
h.setOptionValue("solver", "pdlp")
h.setOptionValue("kkt_tolerance", 1e-4)  # Recommended for PDLP

5. Hot Starting

# Set initial solution
h.setSolution(solution)

# Set initial basis
h.setBasis(basis)

# Run from warm start
h.run()

6. Extracting Model Information

# Get model dimensions
num_cols = h.getNumCols()
num_rows = h.getNumRows()
num_nz = h.getNumEntries()

# Get specific column/row data
col_data = h.getCol(col_index)
row_data = h.getRow(row_index)

# Get matrix coefficient
coeff = h.getCoeff(row_index, col_index)

7. Modifying Models

# Change objective coefficient
h.changeColCost(col_index, new_cost)

# Change bounds
h.changeColBounds(col_index, new_lower, new_upper)
h.changeRowBounds(row_index, new_lower, new_upper)

# Change matrix coefficient
h.changeCoeff(row_index, col_index, new_value)

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md' && test -s '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/highs' && cp -R '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j' '.claude/skills/highs'

Cursor
test -f '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md' && test -s '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/highs' && cp -R '.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j' '.cursor/skills/highs'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j'

openskills read 'highs-high-performance-mathematical-optimization-mm5t897j'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/highs-high-performance-mathematical-optimization-mm5t897j/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills