API Reference¶
This page documents every public symbol in the cyhighs package. The
descriptions are generated from the docstrings in the source.
Solver interfaces¶
cyhighs.solve_linear_problem
¶
solve_linear_problem(
objective_coefficients,
*,
constraint_matrix_values=None,
constraint_matrix_row_indices=None,
constraint_matrix_column_pointers=None,
constraint_lower_bounds=None,
constraint_upper_bounds=None,
variable_lower_bounds=None,
variable_upper_bounds=None,
integrality=None,
initial_column_values=None,
objective_sense: ObjectiveSense | int = MINIMIZE,
options=None,
) -> LinearProblemSolution
Solve minimize c @ x subject to linear constraints and bounds.
This is the thin low level interface. It maps almost one to one onto the HiGHS C API, so the constraint matrix must already be a single matrix in compressed sparse column form together with per row lower and upper bounds. The problem solved is:
optimize objective_coefficients @ x
subject to constraint_lower_bounds <= A @ x <= constraint_upper_bounds
variable_lower_bounds <= x <= variable_upper_bounds
Inequality and equality constraints are both expressed through the row
bounds. An inequality row A_i @ x <= b_i uses a lower bound of negative
infinity and an upper bound of b_i, while an equality row uses equal
lower and upper bounds. The convenience wrapper
solve_linear_problem_sparse builds
this merged form from separate inequality and equality matrices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
objective_coefficients
|
The objective coefficient vector |
required | |
constraint_matrix_values
|
The |
None
|
|
constraint_matrix_row_indices
|
The |
None
|
|
constraint_matrix_column_pointers
|
The |
None
|
|
constraint_lower_bounds
|
Per row lower bounds. Required when the constraint matrix is given. |
None
|
|
constraint_upper_bounds
|
Per row upper bounds. Required when the constraint matrix is given, and must match the lower bounds length. |
None
|
|
variable_lower_bounds
|
Per variable lower bounds. Default to negative infinity, meaning free below. |
None
|
|
variable_upper_bounds
|
Per variable upper bounds. Default to positive infinity, meaning free above. |
None
|
|
integrality
|
Per variable integrality using
|
None
|
|
initial_column_values
|
A warm start solution for the variables. |
None
|
|
objective_sense
|
ObjectiveSense | int
|
Whether to minimize (default) or maximize the objective. |
MINIMIZE
|
options
|
Solver options as a mapping from
|
None
|
Returns:
| Type | Description |
|---|---|
LinearProblemSolution
|
The |
cyhighs.solve_linear_problem_sparse
¶
solve_linear_problem_sparse(
objective_coefficients,
*,
inequality_constraint_matrix=None,
inequality_upper_bounds=None,
equality_constraint_matrix=None,
equality_right_hand_sides=None,
variable_lower_bounds=None,
variable_upper_bounds=None,
integrality=None,
initial_column_values=None,
objective_sense: ObjectiveSense | int = MINIMIZE,
options=None,
) -> LinearProblemSolution
Solve a linear or mixed integer program with SciPy sparse matrices.
Minimizes c @ x subject to A_ub @ x <= b_ub, A_eq @ x == b_eq and
the variable bounds. The two constraint matrices are merged internally into
the row bounded form used by
solve_linear_problem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
objective_coefficients
|
The objective coefficient vector |
required | |
inequality_constraint_matrix
|
The inequality matrix |
None
|
|
inequality_upper_bounds
|
The right hand side vector |
None
|
|
equality_constraint_matrix
|
The equality matrix |
None
|
|
equality_right_hand_sides
|
The right hand side vector |
None
|
|
variable_lower_bounds
|
Per variable lower bounds. |
None
|
|
variable_upper_bounds
|
Per variable upper bounds. |
None
|
|
integrality
|
Per variable integrality using
|
None
|
|
initial_column_values
|
A warm start solution. |
None
|
|
objective_sense
|
ObjectiveSense | int
|
Whether to minimize (default) or maximize. |
MINIMIZE
|
options
|
Solver options as a mapping from
|
None
|
Returns:
| Type | Description |
|---|---|
LinearProblemSolution
|
The |
cyhighs.linprog
¶
linprog(
c,
A_ub=None,
b_ub=None,
A_eq=None,
b_eq=None,
bounds=None,
method: str = "highs",
x0=None,
integrality=None,
options=None,
)
Solve a linear program with a SciPy linprog compatible interface.
Minimizes c @ x subject to A_ub @ x <= b_ub, A_eq @ x == b_eq and
the given variable bounds. Constraint matrices may be dense array likes or
SciPy sparse matrices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c
|
Coefficients of the linear objective to minimize. |
required | |
A_ub
|
Inequality constraint matrix. |
None
|
|
b_ub
|
Inequality right hand side. |
None
|
|
A_eq
|
Equality constraint matrix. |
None
|
|
b_eq
|
Equality right hand side. |
None
|
|
bounds
|
Bounds on the variables following the SciPy convention. Defaults
to |
None
|
|
method
|
str
|
Present for SciPy compatibility. Only HiGHS is used, so this is accepted and otherwise ignored. |
'highs'
|
x0
|
A warm start solution, wired to the HiGHS warm start. |
None
|
|
integrality
|
Per variable integrality using the SciPy convention, which
matches the |
None
|
|
options
|
Solver options as a mapping from
|
None
|
Returns:
| Type | Description |
|---|---|
|
An |
|
|
|
|
|
fields. |
The solution record¶
cyhighs.LinearProblemSolution
¶
Bases: NamedTuple
The outcome of solving a linear or mixed integer program.
The field names follow HiGHS terminology. Columns are decision variables and
rows are constraints. For mixed integer problems the dual value and row value
fields are set to None, since dual information is not defined there.
Attributes:
| Name | Type | Description |
|---|---|---|
model_status |
ModelStatus
|
The status HiGHS reported for the solve, as a
|
column_values |
ndarray
|
The solution vector |
objective_value |
float
|
The objective value at the returned solution. |
column_dual_values |
ndarray | None
|
The reduced costs, one per variable. |
row_dual_values |
ndarray | None
|
The dual values of the constraints, one per row. |
row_values |
ndarray | None
|
The activity of each constraint row, that is the left hand
side value at the solution. |
simplex_iteration_count |
int
|
The number of simplex iterations performed, or -1 if not available. |
presolved_num_columns |
int
|
The number of columns in the presolved model.
Equal to |
presolved_num_rows |
int
|
The number of rows in the presolved model. Equal to
|
presolved_num_nonzeros |
int
|
The number of nonzeros in the constraint matrix of the presolved model. |
cyhighs.OptimizeResult
¶
Bases: NamedTuple
SciPy linprog shaped result, returned by linprog.
Carries the same field names scipy.optimize.OptimizeResult exposes for a
linprog call, plus a highs_solution field with the full HiGHS solve
result.
Attributes:
| Name | Type | Description |
|---|---|---|
x |
ndarray
|
The solution vector. |
fun |
float
|
The objective value at the returned solution. |
slack |
ndarray
|
The slack in each inequality constraint, |
con |
ndarray
|
The residual of each equality constraint, |
status |
int
|
SciPy convention status code: 0 optimal, 1 iteration or time limit, 2 infeasible, 3 unbounded, 4 numerical or other failure. |
success |
bool
|
True if |
message |
str
|
Human readable description of |
nit |
int
|
The number of solver iterations performed. |
highs_solution |
LinearProblemSolution
|
The full
|
Enumerations¶
cyhighs.ObjectiveSense
¶
Bases: IntEnum
Direction in which the objective function is optimized.
Mirrors the kHighsObjSense constants.
cyhighs.VariableType
¶
Bases: IntEnum
Integrality domain of a single decision variable.
Mirrors the kHighsVarType constants. This is what HiGHS calls
integrality, and the values are used directly in the integrality array
passed to Highs_passMip.
CONTINUOUS
class-attribute
instance-attribute
¶
The variable may take any real value within its bounds.
IMPLICIT_INTEGER
class-attribute
instance-attribute
¶
The variable is continuous but known to take an integer value at the optimum. This is used internally by HiGHS and is rarely set by callers.
INTEGER
class-attribute
instance-attribute
¶
The variable must take an integer value within its bounds.
SEMI_CONTINUOUS
class-attribute
instance-attribute
¶
The variable is either zero or a real value within its bounds. A finite upper bound is required by HiGHS for semi continuous variables.
SEMI_INTEGER
class-attribute
instance-attribute
¶
The variable is either zero or an integer value within its bounds. A finite upper bound is required by HiGHS for semi integer variables.
cyhighs.ModelStatus
¶
Bases: IntEnum
Outcome reported by HiGHS after a solve.
Mirrors the kHighsModelStatus constants from HiGHS 1.15.1. The most
commonly inspected values are OPTIMAL,
INFEASIBLE and
UNBOUNDED.
INTERRUPT
class-attribute
instance-attribute
¶
The solve was interrupted by the user.
ITERATION_LIMIT
class-attribute
instance-attribute
¶
The solve stopped because the iteration limit was reached.
MODEL_EMPTY
class-attribute
instance-attribute
¶
The model contains no variables and no constraints.
MODEL_ERROR
class-attribute
instance-attribute
¶
The model is invalid, for example because of inconsistent dimensions.
NOTSET
class-attribute
instance-attribute
¶
No status has been set. Seen when a solve has not been run.
OBJECTIVE_BOUND
class-attribute
instance-attribute
¶
The solve stopped because the objective reached a supplied bound.
OBJECTIVE_TARGET
class-attribute
instance-attribute
¶
The solve stopped because the objective reached a supplied target.
POSTSOLVE_ERROR
class-attribute
instance-attribute
¶
An error occurred during postsolve.
PRESOLVE_ERROR
class-attribute
instance-attribute
¶
An error occurred during presolve.
SOLUTION_LIMIT
class-attribute
instance-attribute
¶
The solve stopped because the solution count limit was reached.
SOLVE_ERROR
class-attribute
instance-attribute
¶
An error occurred during the main solve.
TIME_LIMIT
class-attribute
instance-attribute
¶
The solve stopped because the time limit was reached.
UNBOUNDED
class-attribute
instance-attribute
¶
The objective is unbounded, so no finite optimum exists.
UNBOUNDED_OR_INFEASIBLE
class-attribute
instance-attribute
¶
The model is either unbounded or infeasible. HiGHS could not distinguish the two, often because presolve detected the condition.
cyhighs.PresolveRule
¶
Bases: IntEnum
A presolve reduction rule, identified by its bit position.
Mirrors the PresolveRuleType constants from HiGHS 1.15.1. Each member's
value is the bit position HiGHS uses for that rule in the
HighsOption.PRESOLVE_RULE_OFF
bitmask and in HighsOption.PRESOLVE_RULE_TEST.
Use PresolveRule.mask to combine rules into
a bitmask rather than shifting bits by hand, for example:
EMPTY_ROW through DOMINATED_COL are always active in HiGHS and cannot
actually be turned off through the bitmask, only FORCING_ROW onward can.
AGGREGATOR
class-attribute
instance-attribute
¶
Substitute out columns by aggregating rows.
COL_STUFFING
class-attribute
instance-attribute
¶
Fix columns to their best bound when doing so cannot cause infeasibility.
DEPENDENT_EQUATIONS
class-attribute
instance-attribute
¶
Remove equations that are linearly dependent on other equations.
DEPENDENT_FREE_COLS
class-attribute
instance-attribute
¶
Remove free columns that are linearly dependent on other columns.
DOMINATED_COL
class-attribute
instance-attribute
¶
Fix columns whose cost and bounds mean one bound is always optimal.
DOUBLETON_EQUATION
class-attribute
instance-attribute
¶
Substitute out one column of an equation with exactly two columns.
DUAL_FIXING
class-attribute
instance-attribute
¶
Fix columns whose reduced cost sign forces them to a bound.
EMPTY_COL
class-attribute
instance-attribute
¶
Remove columns with no nonzero coefficients by fixing them.
EMPTY_ROW
class-attribute
instance-attribute
¶
Remove rows with no nonzero coefficients.
ENUMERATION
class-attribute
instance-attribute
¶
Solve small independent components of the model by enumeration.
FIXED_COL
class-attribute
instance-attribute
¶
Substitute out columns whose bounds force a single value.
FORCING_COL
class-attribute
instance-attribute
¶
Remove columns whose bounds force every row containing them.
FORCING_ROW
class-attribute
instance-attribute
¶
Remove rows whose bounds force every column in the row to a bound.
FREE_COL_SUBSTITUTION
class-attribute
instance-attribute
¶
Substitute out free columns using a row they appear in.
INITIAL_SWEEP
class-attribute
instance-attribute
¶
The initial sweep that removes empty rows and columns.
PARALLEL_ROWS_AND_COLS
class-attribute
instance-attribute
¶
Merge rows or columns that are parallel to one another.
PROBING
class-attribute
instance-attribute
¶
Fix binary variables whose value can be deduced by probing.
REDUNDANT_ROW
class-attribute
instance-attribute
¶
Remove rows implied by the bounds of their columns.
SINGLETON_ROW
class-attribute
instance-attribute
¶
Remove rows with a single nonzero coefficient by bounding the column.
SPARSIFY
class-attribute
instance-attribute
¶
Reduce fill-in by combining rows to cancel out matrix entries.
mask
classmethod
¶
mask(*rules: PresolveRule) -> int
Combine rules into the bitmask presolve_rule_off expects.
For example, PresolveRule.mask(PresolveRule.PROBING,
PresolveRule.SPARSIFY) disables just those two rules.
Options¶
cyhighs.HighsOption
¶
Bases: Enum
A HiGHS option together with its name and value kind.
The enumeration value is a (name, kind) pair. name is the string the
HiGHS C API expects and kind is one of the OPTION_KIND_* labels.
ALLOWED_COST_SCALE_FACTOR
class-attribute
instance-attribute
¶
Largest power-of-two factor permitted when scaling the costs. Integer, default 0.
ALLOWED_MATRIX_SCALE_FACTOR
class-attribute
instance-attribute
¶
Largest power-of-two factor permitted when scaling the constraint matrix. Integer, default 20.
ALLOW_UNBOUNDED_OR_INFEASIBLE
class-attribute
instance-attribute
¶
Whether ModelStatus.UNBOUNDED_OR_INFEASIBLE may be reported when presolve cannot
distinguish the two. Boolean, default False.
BLEND_MULTI_OBJECTIVES
class-attribute
instance-attribute
¶
Blend multiple objectives or apply lexicographically. Boolean, default True.
CENTRING_RATIO_TOLERANCE
class-attribute
instance-attribute
¶
Centring stops when the ratio max(x_js_j) / min(x_js_j) is below this tolerance. Double, default 100.
COST_SCALE_FACTOR
class-attribute
instance-attribute
¶
Scaling factor for costs. Integer, default 0.
DUAL_FEASIBILITY_TOLERANCE
class-attribute
instance-attribute
¶
Tolerance for dual feasibility. Double, default 1e-7.
DUAL_RESIDUAL_TOLERANCE
class-attribute
instance-attribute
¶
Dual residual tolerance. Double, default 1e-7.
DUAL_SIMPLEX_COST_PERTURBATION_MULTIPLIER
class-attribute
instance-attribute
¶
DUAL_SIMPLEX_COST_PERTURBATION_MULTIPLIER = (
"dual_simplex_cost_perturbation_multiplier",
OPTION_KIND_DOUBLE,
)
Dual simplex cost perturbation multiplier. 0 means no perturbation. Double, default 1.0.
DUAL_SIMPLEX_PIVOT_GROWTH_TOLERANCE
class-attribute
instance-attribute
¶
DUAL_SIMPLEX_PIVOT_GROWTH_TOLERANCE = (
"dual_simplex_pivot_growth_tolerance",
OPTION_KIND_DOUBLE,
)
Dual simplex pivot growth tolerance. Double, default 1e-9.
DUAL_STEEPEST_EDGE_WEIGHT_ERROR_TOLERANCE
class-attribute
instance-attribute
¶
DUAL_STEEPEST_EDGE_WEIGHT_ERROR_TOLERANCE = (
"dual_steepest_edge_weight_error_tolerance",
OPTION_KIND_DOUBLE,
)
Tolerance on dual steepest edge weight errors. Double, default infinity.
DUAL_STEEPEST_EDGE_WEIGHT_LOG_ERROR_THRESHOLD
class-attribute
instance-attribute
¶
DUAL_STEEPEST_EDGE_WEIGHT_LOG_ERROR_THRESHOLD = (
"dual_steepest_edge_weight_log_error_threshold",
OPTION_KIND_DOUBLE,
)
Threshold on dual steepest edge weight errors for the Devex switch. Double, default 10.
FACTOR_PIVOT_THRESHOLD
class-attribute
instance-attribute
¶
Matrix factorization pivot threshold. Double, default 0.1.
FACTOR_PIVOT_TOLERANCE
class-attribute
instance-attribute
¶
Matrix factorization pivot tolerance. Double, default 1e-10.
GLPSOL_COST_ROW_LOCATION
class-attribute
instance-attribute
¶
Location of cost row for Glpsol file: -2 => Last; -1 => None; 0 => None if empty, otherwise data file location; 1 <= n <= num_row => Location n; n > num_row => Last. Integer, default 0.
HIGHS_ANALYSIS_LEVEL
class-attribute
instance-attribute
¶
Analysis level in HiGHS. Integer, default 0.
HIGHS_DEBUG_LEVEL
class-attribute
instance-attribute
¶
Internal debugging verbosity from 0 to 3. Integer, default 0.
HIPO_BLOCK_SIZE
class-attribute
instance-attribute
¶
Block size for dense linear algebra within HiPO. Integer, default 128.
HIPO_ORDERING
class-attribute
instance-attribute
¶
HiPO matrix reordering: "choose", "metis", "amd" or "rcm". String, default "choose".
HIPO_PARALLEL_TYPE
class-attribute
instance-attribute
¶
HiPO parallelism: "tree", "node" or "both". String, default "both".
HIPO_SYSTEM
class-attribute
instance-attribute
¶
HiPO Newton system: "choose", "augmented" or "normaleq". String, default "choose".
ICRASH
class-attribute
instance-attribute
¶
Run iCrash. Boolean, default False.
ICRASH_APPROX_ITER
class-attribute
instance-attribute
¶
iCrash approximate minimization iterations. Integer, default 50.
ICRASH_BREAKPOINTS
class-attribute
instance-attribute
¶
Exact subproblem solution for iCrash. Boolean, default False.
ICRASH_DUALIZE
class-attribute
instance-attribute
¶
Dualize strategy for iCrash. Boolean, default False.
ICRASH_EXACT
class-attribute
instance-attribute
¶
Exact subproblem solution for iCrash. Boolean, default False.
ICRASH_ITERATIONS
class-attribute
instance-attribute
¶
iCrash iterations. Integer, default 30.
ICRASH_STARTING_WEIGHT
class-attribute
instance-attribute
¶
iCrash starting weight. Double, default 1e-3.
ICRASH_STRATEGY
class-attribute
instance-attribute
¶
Strategy for iCrash. String, default "ICA".
IIS_STRATEGY
class-attribute
instance-attribute
¶
Strategy for IIS calculation: 0 => Light test; 1 => Try dual ray; 2 => Try elastic LP; 4 => Prioritise columns; 8 => Find true IIS; 16 => Find relaxation IIS for MIP. Integer, default 0.
IIS_TIME_LIMIT
class-attribute
instance-attribute
¶
Time limit for computing IIS (seconds). Double, default infinity.
INFINITE_BOUND
class-attribute
instance-attribute
¶
Limit on |constraint bound|: values greater than or equal to this will be treated as infinite. Double, default 1e20.
INFINITE_COST
class-attribute
instance-attribute
¶
Limit on |cost coefficient|: values greater than or equal to this will be treated as infinite. Double, default 1e20.
IPM_ITERATION_LIMIT
class-attribute
instance-attribute
¶
Iteration limit for IPM solver. Integer, default a very large value.
IPM_OPTIMALITY_TOLERANCE
class-attribute
instance-attribute
¶
IPM optimality tolerance. Double, default 1e-8.
IPX_DUALIZE_STRATEGY
class-attribute
instance-attribute
¶
Strategy for dualizing before IPX. Integer, default 2.
KEEP_N_ROWS
class-attribute
instance-attribute
¶
For multiple N-rows in MPS files: delete rows / delete entries / keep rows (-1/0/1). Integer, default -1.
KKT_TOLERANCE
class-attribute
instance-attribute
¶
If changed from its default value, this tolerance is used for all feasibility and optimality (KKT) measures. Double, default 1e-7.
LARGE_MATRIX_VALUE
class-attribute
instance-attribute
¶
Upper limit on |matrix entries|: values greater than or equal to this will be treated as infinite. Double, default 1e15.
LESS_INFEASIBLE_DSE_CHECK
class-attribute
instance-attribute
¶
Check whether the LP is a candidate for less infeasible dual steepest edge (LiDSE). Boolean, default True.
LESS_INFEASIBLE_DSE_CHOOSE_ROW
class-attribute
instance-attribute
¶
Use LiDSE if the LP has the right properties. Boolean, default True.
LOG_DEV_LEVEL
class-attribute
instance-attribute
¶
Output development messages: 0 => none; 1 => info; 2 => detailed; 3 => verbose. Integer, default 0.
LOG_FILE
class-attribute
instance-attribute
¶
Log file. String, default "".
LOG_GITHASH
class-attribute
instance-attribute
¶
Log the githash. Boolean, default True.
LOG_TO_CONSOLE
class-attribute
instance-attribute
¶
Whether log messages are written to the console. Boolean, default True.
LP_PRESOLVE_REQUIRES_BASIS_POSTSOLVE
class-attribute
instance-attribute
¶
LP_PRESOLVE_REQUIRES_BASIS_POSTSOLVE = (
"lp_presolve_requires_basis_postsolve",
OPTION_KIND_BOOL,
)
Prevents LP presolve steps for which postsolve cannot maintain a basis. Boolean, default True.
MAX_CENTRING_STEPS
class-attribute
instance-attribute
¶
Maximum number of steps to use when computing the analytic centre. Integer, default 5.
MAX_DUAL_SIMPLEX_CLEANUP_LEVEL
class-attribute
instance-attribute
¶
Max level of dual simplex cleanup. Integer, default 1.
MAX_DUAL_SIMPLEX_PHASE1_CLEANUP_LEVEL
class-attribute
instance-attribute
¶
MAX_DUAL_SIMPLEX_PHASE1_CLEANUP_LEVEL = (
"max_dual_simplex_phase1_cleanup_level",
OPTION_KIND_INT,
)
Max level of dual simplex phase 1 cleanup. Integer, default 2.
MIP_ABS_GAP
class-attribute
instance-attribute
¶
Absolute optimality gap at which a mixed integer solve stops. Double, default 1e-6.
MIP_ALLOW_CUT_SEPARATION_AT_NODES
class-attribute
instance-attribute
¶
Whether cut separation at nodes other than the root node is permitted. Boolean, default True.
MIP_ALLOW_RESTART
class-attribute
instance-attribute
¶
Whether MIP restart is permitted. Boolean, default True.
MIP_DETECT_SYMMETRY
class-attribute
instance-attribute
¶
Whether MIP symmetry should be detected. Boolean, default True.
MIP_FEASIBILITY_TOLERANCE
class-attribute
instance-attribute
¶
Feasibility tolerance for integer variables. Double, default 1e-6.
MIP_HEURISTIC_EFFORT
class-attribute
instance-attribute
¶
Effort spent for MIP heuristics. Double, default 0.05.
MIP_HEURISTIC_RUN_FEASIBILITY_JUMP
class-attribute
instance-attribute
¶
Use the feasibility jump heuristic. Boolean, default True.
MIP_HEURISTIC_RUN_RENS
class-attribute
instance-attribute
¶
Use the RENS heuristic. Boolean, default True.
MIP_HEURISTIC_RUN_RINS
class-attribute
instance-attribute
¶
Use the RINS heuristic. Boolean, default True.
MIP_HEURISTIC_RUN_ROOT_REDUCED_COST
class-attribute
instance-attribute
¶
Use the rootReducedCost heuristic. Boolean, default True.
MIP_HEURISTIC_RUN_SHIFTING
class-attribute
instance-attribute
¶
Use the Shifting heuristic. Boolean, default False.
MIP_HEURISTIC_RUN_ZI_ROUND
class-attribute
instance-attribute
¶
Use the ZI Round heuristic. Boolean, default False.
MIP_IMPROVING_SOLUTION_FILE
class-attribute
instance-attribute
¶
File for reporting improving MIP solutions. Not reported for an empty string. String, default "".
MIP_IMPROVING_SOLUTION_REPORT_SPARSE
class-attribute
instance-attribute
¶
MIP_IMPROVING_SOLUTION_REPORT_SPARSE = (
"mip_improving_solution_report_sparse",
OPTION_KIND_BOOL,
)
Whether improving MIP solutions should be reported in sparse format. Boolean, default False.
MIP_IMPROVING_SOLUTION_SAVE
class-attribute
instance-attribute
¶
Whether improving MIP solutions should be saved. Boolean, default False.
MIP_IPM_SOLVER
class-attribute
instance-attribute
¶
MIP IPM solver: "choose", "ipx" or "hipo". String, default "choose".
MIP_LIFTING_FOR_PROBING
class-attribute
instance-attribute
¶
Level of lifting for probing that is used. Integer, default -1.
MIP_LP_AGE_LIMIT
class-attribute
instance-attribute
¶
Maximal age of dynamic LP rows before they are removed from the LP relaxation in the MIP solver. Integer, default 10.
MIP_LP_SOLVER
class-attribute
instance-attribute
¶
MIP LP solver: "choose", "simplex", "ipm", "ipx" or "hipo". String, default "choose".
MIP_MAX_IMPROVING_SOLS
class-attribute
instance-attribute
¶
Limit on the number of improving solutions found to stop the MIP solver prematurely. Integer, default a very large value.
MIP_MAX_LEAVES
class-attribute
instance-attribute
¶
MIP solver max number of leaf nodes. Integer, default a very large value.
MIP_MAX_NODES
class-attribute
instance-attribute
¶
Maximum number of branch and bound nodes. Integer, default a very large value.
MIP_MAX_STALL_NODES
class-attribute
instance-attribute
¶
MIP solver max number of nodes where estimate is above cutoff bound. Integer, default a very large value.
MIP_MAX_START_NODES
class-attribute
instance-attribute
¶
MIP solver max number of nodes when completing a partial MIP start. Integer, default 500.
MIP_MIN_CLIQUETABLE_ENTRIES_FOR_PARALLELISM
class-attribute
instance-attribute
¶
MIP_MIN_CLIQUETABLE_ENTRIES_FOR_PARALLELISM = (
"mip_min_cliquetable_entries_for_parallelism",
OPTION_KIND_INT,
)
Minimal number of entries in the MIP solver cliquetable before neighbourhood queries of the conflict graph use parallel processing. Integer, default 100000.
MIP_MIN_LOGGING_INTERVAL
class-attribute
instance-attribute
¶
MIP minimum logging interval. Double, default 5.
MIP_POOL_AGE_LIMIT
class-attribute
instance-attribute
¶
Maximal age of rows in the MIP solver cutpool before they are deleted. Integer, default 30.
MIP_POOL_SOFT_LIMIT
class-attribute
instance-attribute
¶
Soft limit on the number of rows in the MIP solver cutpool for dynamic age adjustment. Integer, default 10000.
MIP_PSCOST_MINRELIABLE
class-attribute
instance-attribute
¶
Minimal number of observations before MIP solver pseudo costs are considered reliable. Integer, default 8.
MIP_REL_GAP
class-attribute
instance-attribute
¶
Relative optimality gap at which a mixed integer solve stops. Double, default 1e-4.
MIP_REPORT_LEVEL
class-attribute
instance-attribute
¶
MIP solver reporting level. Integer, default 1.
MIP_ROOT_PRESOLVE_ONLY
class-attribute
instance-attribute
¶
Whether MIP presolve is only applied at the root node. Boolean, default False.
MIP_SEARCH_SIMULATE_CONCURRENCY
class-attribute
instance-attribute
¶
Simulate MIP search concurrency on a single thread. Boolean, default False.
MPS_PARSER_TYPE_FREE
class-attribute
instance-attribute
¶
Use the free format MPS file reader. Boolean, default True.
NO_UNNECESSARY_REBUILD_REFACTOR
class-attribute
instance-attribute
¶
No unnecessary refactorization on simplex rebuild. Boolean, default True.
OBJECTIVE_BOUND
class-attribute
instance-attribute
¶
Bound on the objective that stops the solve when reached. Double, default infinity.
OBJECTIVE_TARGET
class-attribute
instance-attribute
¶
Target objective value that stops the solve when reached. Double, default negative infinity.
OPTIMALITY_TOLERANCE
class-attribute
instance-attribute
¶
Optimality tolerance. Double, default 1e-7.
OUTPUT_FLAG
class-attribute
instance-attribute
¶
Master switch for all HiGHS logging. Set to True to let the solver print
its log. Boolean; HiGHS itself defaults to True, but
solve_linear_problem defaults it to False
so the solver is silent unless requested.
PARALLEL
class-attribute
instance-attribute
¶
Parallelism control. One of "off", "choose" or "on". String, default "choose".
PDLP_CUPDLPC_RESTART_METHOD
class-attribute
instance-attribute
¶
Restart mode for cuPDLP-C solver: 0 => none; 1 => GPU (default); 2 => CPU. Integer, default 1.
PDLP_ITERATION_LIMIT
class-attribute
instance-attribute
¶
Iteration limit for PDLP solver. Integer, default a very large value.
PDLP_OPTIMALITY_TOLERANCE
class-attribute
instance-attribute
¶
PDLP optimality tolerance. Double, default 1e-7.
PDLP_RESTART_STRATEGY
class-attribute
instance-attribute
¶
Restart strategy for PDLP solver: 0 => off; 1 => fixed; 2 => adaptive; 3 => Halpern. Integer, default 2.
PDLP_RUIZ_ITERATIONS
class-attribute
instance-attribute
¶
Number of Ruiz scaling iteraitons for PDLP solver. Integer, default 10.
PDLP_SCALING_MODE
class-attribute
instance-attribute
¶
Scaling mode for PDLP solver (default = 5): 1 => Ruiz; 2 => L2; 4 => PC. Integer, default 5.
PDLP_STEP_SIZE_STRATEGY
class-attribute
instance-attribute
¶
Step size strategy for PDLP solver: 0 => fixed; 1 => adaptive; 2 => Malitsky-Pock; 3 => PID. Integer, default 1.
PRESOLVE
class-attribute
instance-attribute
¶
Presolve control. One of "off", "choose" or "on". String, default "choose".
PRESOLVE_PIVOT_THRESHOLD
class-attribute
instance-attribute
¶
Matrix factorization pivot threshold for substitutions in presolve. Double, default 0.01.
PRESOLVE_REDUCTION_LIMIT
class-attribute
instance-attribute
¶
Limit on number of presolve reductions. -1 means no limit. Integer, default -1.
PRESOLVE_REMOVE_SLACKS
class-attribute
instance-attribute
¶
Remove slacks after presolve. Boolean, default False.
PRESOLVE_RULE_LOGGING
class-attribute
instance-attribute
¶
Log effectiveness of presolve rules for LP. Boolean, default False.
PRESOLVE_RULE_OFF
class-attribute
instance-attribute
¶
Bit mask of presolve rules that are not allowed. Build the mask with
PresolveRule.mask, for example
PresolveRule.mask(PresolveRule.PROBING, PresolveRule.SPARSIFY). Integer, default 0
(every rule allowed).
PRESOLVE_RULE_TEST
class-attribute
instance-attribute
¶
A single PresolveRule value to test in isolation.
Development and debugging use only. Integer, default 0.
PRESOLVE_SUBSTITUTION_MAXFILLIN
class-attribute
instance-attribute
¶
Maximal fillin allowed for substitutions in presolve. Integer, default 10.
PRIMAL_FEASIBILITY_TOLERANCE
class-attribute
instance-attribute
¶
Tolerance for primal feasibility. Double, default 1e-7.
PRIMAL_RESIDUAL_TOLERANCE
class-attribute
instance-attribute
¶
Primal residual tolerance. Double, default 1e-7.
PRIMAL_SIMPLEX_BOUND_PERTURBATION_MULTIPLIER
class-attribute
instance-attribute
¶
PRIMAL_SIMPLEX_BOUND_PERTURBATION_MULTIPLIER = (
"primal_simplex_bound_perturbation_multiplier",
OPTION_KIND_DOUBLE,
)
Primal simplex bound perturbation multiplier. 0 means no perturbation. Double, default 1.0.
QP_ALLOW_HOT_START
class-attribute
instance-attribute
¶
Allow the active set QP solver to hot start. Boolean, default False.
QP_ITERATION_LIMIT
class-attribute
instance-attribute
¶
Iteration limit for the active set QP solver. Integer, default a very large value.
QP_NULLSPACE_LIMIT
class-attribute
instance-attribute
¶
Nullspace limit for the active set QP solver. Integer, default 4000.
QP_REGULARIZATION_VALUE
class-attribute
instance-attribute
¶
Regularization value added to the Hessian in the active set QP solver. Double, default 1e-7.
RANDOM_SEED
class-attribute
instance-attribute
¶
Seed for the random number generator. Integer, default 0.
RANGING
class-attribute
instance-attribute
¶
Compute cost, bound, RHS and basic solution ranging: "off" or "on". String, default "off".
READ_BASIS_FILE
class-attribute
instance-attribute
¶
Read basis file. String, default "".
READ_SOLUTION_FILE
class-attribute
instance-attribute
¶
Read solution file. String, default "".
REBUILD_REFACTOR_SOLUTION_ERROR_TOLERANCE
class-attribute
instance-attribute
¶
REBUILD_REFACTOR_SOLUTION_ERROR_TOLERANCE = (
"rebuild_refactor_solution_error_tolerance",
OPTION_KIND_DOUBLE,
)
Tolerance on solution error when considering refactorization on simplex rebuild. Double, default 1e-8.
RESTART_PRESOLVE_REDUCTION_LIMIT
class-attribute
instance-attribute
¶
Limit on number of further presolve reductions on restart in the MIP solver. -1 means no limit. Integer, default -1.
RUN_CENTRING
class-attribute
instance-attribute
¶
Perform centring steps to compute the analytic centre before crossover. Boolean, default False.
RUN_CROSSOVER
class-attribute
instance-attribute
¶
Whether to run crossover after an interior point solve. One of "off", "choose" or "on". String, default "on".
SIMPLEX_CRASH_STRATEGY
class-attribute
instance-attribute
¶
Strategy for simplex crash: off / LTSSF / Bixby (0/½). Integer, default 0.
SIMPLEX_DUALIZE_STRATEGY
class-attribute
instance-attribute
¶
Strategy for dualizing before simplex: off / on (-1/1). Integer, default -1.
SIMPLEX_DUAL_EDGE_WEIGHT_STRATEGY
class-attribute
instance-attribute
¶
Strategy for simplex dual edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/½). Integer, default -1.
SIMPLEX_ITERATION_LIMIT
class-attribute
instance-attribute
¶
Iteration limit for simplex solver when solving LPs, but not subproblems in the MIP solver. Integer, default a very large value.
SIMPLEX_MAX_CONCURRENCY
class-attribute
instance-attribute
¶
Maximum level of concurrency in parallel simplex. Integer, default 8.
SIMPLEX_MIN_CONCURRENCY
class-attribute
instance-attribute
¶
Minimum level of concurrency in parallel simplex. Integer, default 1.
SIMPLEX_PERMUTE_STRATEGY
class-attribute
instance-attribute
¶
Strategy for permuting before simplex: off / on (-1/1). Integer, default -1.
SIMPLEX_PRICE_STRATEGY
class-attribute
instance-attribute
¶
Strategy for PRICE in simplex. Integer, default 3.
SIMPLEX_PRIMAL_EDGE_WEIGHT_STRATEGY
class-attribute
instance-attribute
¶
Strategy for simplex primal edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/½). Integer, default -1.
SIMPLEX_SCALE_STRATEGY
class-attribute
instance-attribute
¶
Simplex scaling strategy: off / choose / equilibration (default) / forced equilibration / max value (0/½/¾). Integer, default 2.
SIMPLEX_STRATEGY
class-attribute
instance-attribute
¶
Strategy for simplex solver 0 => Choose; 1 => Dual (serial); 2 => Dual (SIP); 3 => Dual (PAMI); 4 => Primal. Integer, default 1.
SIMPLEX_UNSCALED_SOLUTION_STRATEGY
class-attribute
instance-attribute
¶
Strategy for solving the unscaled LP in simplex. Integer, default 1.
SIMPLEX_UPDATE_LIMIT
class-attribute
instance-attribute
¶
Limit on the number of simplex UPDATE operations. Integer, default 5000.
SMALL_MATRIX_VALUE
class-attribute
instance-attribute
¶
Lower limit on |matrix entries|: values less than or equal to this will be treated as zero. Double, default 1e-9.
SOLUTION_FILE
class-attribute
instance-attribute
¶
Write solution file. String, default "".
SOLVER
class-attribute
instance-attribute
¶
Which algorithm to use. One of "choose", "simplex", "ipm", "pdlp" or "hipo". String, default "choose".
SOLVE_RELAXATION
class-attribute
instance-attribute
¶
Solve the relaxation of discrete model components instead of the discrete model itself. Boolean, default False.
START_CROSSOVER_TOLERANCE
class-attribute
instance-attribute
¶
Tolerance to be satisfied before IPM crossover will start. Double, default 1e-8.
THREADS
class-attribute
instance-attribute
¶
Number of threads to use. Zero means let HiGHS choose. Integer, default 0.
TIMELESS_LOG
class-attribute
instance-attribute
¶
Suppression of time-based data in logging. Boolean, default False.
TIME_LIMIT
class-attribute
instance-attribute
¶
Wall clock time limit for the solve in seconds. Double, default infinity.
USER_BOUND_SCALE
class-attribute
instance-attribute
¶
Exponent of power-of-two bound scaling for model. Integer, default 0.
USER_OBJECTIVE_SCALE
class-attribute
instance-attribute
¶
Exponent of power-of-two objective scaling for model. Integer, default 0.
USE_IMPLIED_BOUNDS_FROM_PRESOLVE
class-attribute
instance-attribute
¶
Use relaxed implied bounds from presolve. Boolean, default False.
USE_ORIGINAL_HFACTOR_LOGIC
class-attribute
instance-attribute
¶
Use original HFactor logic for sparse vs hyper-sparse TRANs. Boolean, default True.
USE_WARM_START
class-attribute
instance-attribute
¶
Use any warm start that is available. Boolean, default True.
WRITE_BASIS_FILE
class-attribute
instance-attribute
¶
Write basis file. String, default "".
WRITE_HESSIAN_IMAGE
class-attribute
instance-attribute
¶
Write an image of the Hessian to a file. Boolean, default False.
WRITE_IIS_MODEL_FILE
class-attribute
instance-attribute
¶
Write IIS model file. String, default "".
WRITE_MATRIX_IMAGE
class-attribute
instance-attribute
¶
Write an image of the constraint matrix to a file. Boolean, default False.
WRITE_MODEL_FILE
class-attribute
instance-attribute
¶
Write model file. String, default "".
WRITE_MODEL_TO_FILE
class-attribute
instance-attribute
¶
Write the model to a file. Boolean, default False.
WRITE_PRESOLVED_MODEL_FILE
class-attribute
instance-attribute
¶
Write presolved model file. String, default "".
WRITE_PRESOLVED_MODEL_TO_FILE
class-attribute
instance-attribute
¶
Write the presolved model to a file. Boolean, default False.
WRITE_SOLUTION_STYLE
class-attribute
instance-attribute
¶
Style of solution file (raw = computer-readable, pretty = human-readable): -1 => HiGHS old raw (deprecated); 0 => HiGHS raw; 1 => HiGHS pretty; 2 => Glpsol raw; 3 => Glpsol pretty; 4 => HiGHS sparse raw. Integer, default 0.
WRITE_SOLUTION_TO_FILE
class-attribute
instance-attribute
¶
Write the primal and dual solution to a file. Boolean, default False.
Library information¶
cyhighs.highs_version
¶
Return the version string of the linked HiGHS library.
Returns:
| Type | Description |
|---|---|
|
The HiGHS version, for example |
cyhighs.highs_infinity
¶
Return the value HiGHS uses to represent infinity.
Any bound whose magnitude is greater than or equal to this value is treated by HiGHS as unbounded.
Returns:
| Type | Description |
|---|---|
|
The infinity threshold, typically |