HiGHS

Initial setup

from pyoptinterface import highs

model = highs.Model()

You need to follow the instructions in Getting Started to set up the optimizer correctly.

The capability of highs.Model

Supported constraints

Supported model attribute

Attribute

Get

Set

Name

❌

❌

ObjectiveSense

✅

✅

DualStatus

✅

❌

PrimalStatus

✅

❌

RawStatusString

✅

❌

TerminationStatus

✅

❌

BarrierIterations

❌

❌

DualObjectiveValue

❌

❌

NodeCount

❌

❌

NumberOfThreads

✅

✅

ObjectiveBound

❌

❌

ObjectiveValue

✅

❌

RelativeGap

✅

✅

Silent

✅

✅

SimplexIterations

❌

❌

SolverName

✅

❌

SolverVersion

✅

❌

SolveTimeSec

✅

❌

TimeLimitSec

✅

✅

Supported variable attribute

Attribute

Get

Set

Value

✅

❌

LowerBound

✅

✅

UpperBound

✅

✅

Domain

✅

✅

PrimalStart

✅

✅

Name

✅

✅

IISLowerBound

❌

❌

IISUpperBound

❌

❌

ReducedCost

✅

❌

Supported constraint attribute

Attribute

Get

Set

Name

✅

✅

Primal

✅

❌

Dual

✅

❌

IIS

❌

❌

Solver-specific operations

Parameter

For solver-specific parameters, we provide get_raw_parameter and set_raw_parameter methods to get and set the parameters.

model = highs.Model()

# get the value of the parameter
value = model.get_raw_parameter("time_limit")

# set the value of the parameter
model.set_raw_parameter("time_limit", 10.0)

Information

HiGHS provides information for the model. We provide model.get_raw_information(name: str) method to access the value of information.