From 98209fc4f32f0c0c10d4a6fada6c0daadd8f993d Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 10 Jan 2025 20:46:28 +0000 Subject: [PATCH] build based on 43fd6b5 --- previews/PR2119/callbacks/index.html | 2 +- previews/PR2119/executable/index.html | 2 +- previews/PR2119/guide/advanced/index.html | 2 +- previews/PR2119/guide/basic/index.html | 2 +- previews/PR2119/guide/further/index.html | 2 +- previews/PR2119/guide/index.html | 2 +- previews/PR2119/index.html | 2 +- previews/PR2119/installation/index.html | 2 +- previews/PR2119/interfaces/c_api/index.html | 2 +- previews/PR2119/interfaces/cpp/examples/index.html | 2 +- previews/PR2119/interfaces/cpp/index.html | 2 +- previews/PR2119/interfaces/cpp/library/index.html | 2 +- previews/PR2119/interfaces/csharp/index.html | 2 +- previews/PR2119/interfaces/fortran/index.html | 2 +- previews/PR2119/interfaces/julia/index.html | 2 +- previews/PR2119/interfaces/other/index.html | 2 +- previews/PR2119/interfaces/python/example-py/index.html | 2 +- previews/PR2119/interfaces/python/index.html | 2 +- previews/PR2119/options/definitions/index.html | 2 +- previews/PR2119/options/intro/index.html | 2 +- previews/PR2119/parallel/index.html | 2 +- previews/PR2119/search/index.html | 2 +- previews/PR2119/solvers/index.html | 2 +- previews/PR2119/structures/classes/HighsHessian/index.html | 2 +- previews/PR2119/structures/classes/HighsLp/index.html | 2 +- previews/PR2119/structures/classes/HighsModel/index.html | 2 +- previews/PR2119/structures/classes/HighsSparseMatrix/index.html | 2 +- previews/PR2119/structures/classes/index.html | 2 +- previews/PR2119/structures/enums/index.html | 2 +- previews/PR2119/structures/index.html | 2 +- previews/PR2119/structures/structs/HighsBasis/index.html | 2 +- previews/PR2119/structures/structs/HighsInfo/index.html | 2 +- .../PR2119/structures/structs/HighsLinearObjective/index.html | 2 +- previews/PR2119/structures/structs/HighsSolution/index.html | 2 +- previews/PR2119/structures/structs/index.html | 2 +- previews/PR2119/terminology/index.html | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/previews/PR2119/callbacks/index.html b/previews/PR2119/callbacks/index.html index 23a0cfb427..0de83c213b 100644 --- a/previews/PR2119/callbacks/index.html +++ b/previews/PR2119/callbacks/index.html @@ -9,4 +9,4 @@ void (*userCallback)(const int, const char*, const struct HighsCallbackDataOut*, struct HighsCallbackDataIn*, void*), - void* user_callback_data)

The current callback scenarios are set out below, and the particular callback is activated in C++ by calling

HighsStatus startCallback(const int callback_type);

and, in C, by calling

HighsInt Highs_startCallback(void* highs, const int callback_type);

, and de-activated in C++ by calling

HighsStatus stopCallback(const int callback_type);

and, in C, by calling

HighsInt Highs_stopCallback(void* highs, const int callback_type);

User interrupt

For the non-logging callbacks below, if the user_interrupt member of the HighsCallbackDataIn struct is set to a nonzero value, then the corresponding solver will be interrupted, and HiGHS will return to the user.

Logging callback

The logging callback type is a cast of kCallbackLogging in the C++ enum HighsCallbackType and, in C, is the constant kHighsCallbackLogging. The logging type is a cast of the particular member of the enum class 'HighsLogType', and is available as a constant in C. It is passed as the member log_type in the HighsCallbackDataOut struct, and the message is passed as the const char* parameter.

Simplex interrupt callback

The simplex interrupt is called once every simplex iteration, and its callback type is a cast of kCallbackSimplexInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackSimplexInterrupt constant in C. The simplex iteration count is passed as the simplex_iteration_count member of the HighsCallbackDataOut struct.

IPM interrupt callback

The IPM interrupt is called once every interior point iteration, and its callback type is a cast of kCallbackIpmInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackIpmInterrupt constant in C. The IPM iteration count is passed as the ipm_iteration_count member of the HighsCallbackDataOut struct.

MIP improving solution callback

The MIP improving solution is called whenever the MIP solver identifies an improving integer feasible solution, and its callback type is a cast of kCallbackMipImprovingSolution in the C++ enum HighsCallbackType, and the kHighsCallbackMipImprovingSolution constant in C. A pointer to the improving solution is passed as the objective_function_value and mip_solution members of the HighsCallbackDataOut struct.

MIP logging callback

The MIP logging callback is called once every time MIP logging takes place, and its callback type is a cast of kCallbackMipLogging in the C++ enum HighsCallbackType, and kHighsCallbackMipLogging in C.

MIP interrupt callback

The MIP interrupt callback is called when the MIP solver checks whether computation limits (such as time, node, leaves, improving solutions, and target objective) have been reached, and its callback type is a cast of kCallbackMipInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackMipInterrupt constant in C. The simplex iteration count is passed as the simplex_iteration_count member of the HighsCallbackDataOut struct.

MIP callback data

For each of the MIP callbacks, the following HighsCallbackDataOut struct members will have value set

+ void* user_callback_data)

The current callback scenarios are set out below, and the particular callback is activated in C++ by calling

HighsStatus startCallback(const int callback_type);

and, in C, by calling

HighsInt Highs_startCallback(void* highs, const int callback_type);

, and de-activated in C++ by calling

HighsStatus stopCallback(const int callback_type);

and, in C, by calling

HighsInt Highs_stopCallback(void* highs, const int callback_type);

User interrupt

For the non-logging callbacks below, if the user_interrupt member of the HighsCallbackDataIn struct is set to a nonzero value, then the corresponding solver will be interrupted, and HiGHS will return to the user.

Logging callback

The logging callback type is a cast of kCallbackLogging in the C++ enum HighsCallbackType and, in C, is the constant kHighsCallbackLogging. The logging type is a cast of the particular member of the enum class 'HighsLogType', and is available as a constant in C. It is passed as the member log_type in the HighsCallbackDataOut struct, and the message is passed as the const char* parameter.

Simplex interrupt callback

The simplex interrupt is called once every simplex iteration, and its callback type is a cast of kCallbackSimplexInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackSimplexInterrupt constant in C. The simplex iteration count is passed as the simplex_iteration_count member of the HighsCallbackDataOut struct.

IPM interrupt callback

The IPM interrupt is called once every interior point iteration, and its callback type is a cast of kCallbackIpmInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackIpmInterrupt constant in C. The IPM iteration count is passed as the ipm_iteration_count member of the HighsCallbackDataOut struct.

MIP improving solution callback

The MIP improving solution is called whenever the MIP solver identifies an improving integer feasible solution, and its callback type is a cast of kCallbackMipImprovingSolution in the C++ enum HighsCallbackType, and the kHighsCallbackMipImprovingSolution constant in C. A pointer to the improving solution is passed as the objective_function_value and mip_solution members of the HighsCallbackDataOut struct.

MIP logging callback

The MIP logging callback is called once every time MIP logging takes place, and its callback type is a cast of kCallbackMipLogging in the C++ enum HighsCallbackType, and kHighsCallbackMipLogging in C.

MIP interrupt callback

The MIP interrupt callback is called when the MIP solver checks whether computation limits (such as time, node, leaves, improving solutions, and target objective) have been reached, and its callback type is a cast of kCallbackMipInterrupt in the C++ enum HighsCallbackType, and the kHighsCallbackMipInterrupt constant in C. The simplex iteration count is passed as the simplex_iteration_count member of the HighsCallbackDataOut struct.

MIP callback data

For each of the MIP callbacks, the following HighsCallbackDataOut struct members will have value set

diff --git a/previews/PR2119/executable/index.html b/previews/PR2119/executable/index.html index 6f8ad520ad..1e168e56d7 100644 --- a/previews/PR2119/executable/index.html +++ b/previews/PR2119/executable/index.html @@ -22,4 +22,4 @@ --ranging arg Compute cost, bound, RHS and basic solution ranging. --version Print version. - -h, --help Print help.

The list of options section gives a full list of options, and the format in which they are specified.

Return code values

Consistent with the callable methods in HiGHS, there are three possible return codes

+ -h, --help Print help.

The list of options section gives a full list of options, and the format in which they are specified.

Return code values

Consistent with the callable methods in HiGHS, there are three possible return codes

diff --git a/previews/PR2119/guide/advanced/index.html b/previews/PR2119/guide/advanced/index.html index 0e4984fa32..bfe82412fc 100644 --- a/previews/PR2119/guide/advanced/index.html +++ b/previews/PR2119/guide/advanced/index.html @@ -1,2 +1,2 @@ -Advanced features · HiGHS Documentation

Advanced features

Simplex tableau data

HiGHS has a suite of methods for operations with the invertible representation of the current basis matrix $B$. To use these requires knowledge of the corresponding (ordered) basic variables. This is obtained using the method getBasicVariables , with non-negative values being columns and negative values corresponding to row indices plus one [so -1 indicates row 0]. Methods getBasisInverseRow and getBasisInverseCol yield a specific row or column of $B^{-1}$. Methods getBasisSolve and getBasisTransposeSolve yield the solution of $Bx=b$ and $Bx=b$ respectively. Finally, the methods getReducedRow and getReducedColumn yield a specific row or column of $B^{-1}A$. In all cases, HiGHS can return the number and indices of the nonzeros in the result.

+Advanced features · HiGHS Documentation

Advanced features

Simplex tableau data

HiGHS has a suite of methods for operations with the invertible representation of the current basis matrix $B$. To use these requires knowledge of the corresponding (ordered) basic variables. This is obtained using the method getBasicVariables , with non-negative values being columns and negative values corresponding to row indices plus one [so -1 indicates row 0]. Methods getBasisInverseRow and getBasisInverseCol yield a specific row or column of $B^{-1}$. Methods getBasisSolve and getBasisTransposeSolve yield the solution of $Bx=b$ and $Bx=b$ respectively. Finally, the methods getReducedRow and getReducedColumn yield a specific row or column of $B^{-1}A$. In all cases, HiGHS can return the number and indices of the nonzeros in the result.

diff --git a/previews/PR2119/guide/basic/index.html b/previews/PR2119/guide/basic/index.html index f353c629f3..b721d1c113 100644 --- a/previews/PR2119/guide/basic/index.html +++ b/previews/PR2119/guide/basic/index.html @@ -1,2 +1,2 @@ -Basic features · HiGHS Documentation

Basic features

The minimal use of HiGHS has the following three stages.

Although its default actions will be sufficient for most users, HiGHS can be controlled by setting Option values.

Intro to other basic features

HiGHS data structures

There are several specialist data structures that can be used to interact with HiGHS when using C++ and highspy. These are defined in the sections on enums and classes, and are referred to below.

Enums

Enums are scalar identifier types that can take only a limited range of values.

Classes

The advantage of using the native C++ classes in HiGHS is that many fewer parameters are needed when passing data to and from HiGHS. The binding of the data members of these classes to highspy structures allows them to be used when calling HiGHS from Python, although they are not necessary for the basic use of highspy. As with the C and Fortran interfaces, there are equivalent methods that use simple scalars and vectors of data.

Defining a model

HiGHS has comprehensive tools for defining models. This can be done by either reading a model using a data file created elsewhere, or by passing model data to HiGHS. Once a model has been defined in HiGHS, it is referred to as the incumbent model.

Reading a model from a file

The simplest way to define a model in HiGHS is to read it from a file using the method readModel. HiGHS infers the file type by the extension. Supported extensions are:

  • .mps: for an MPS file
  • .lp: for a CPLEX LP file

HiGHS can read compressed files that end in the .gz extension, but not (yet) files that end in the .zip extension.

Building a model

The model in HiGHS can be built using a sequence of calls to add variables and constraints. This is most easily done one-by-one using the methods addCol and addRow. Alternatively, calls to addVar can be used to add variables, with calls to changeColCost used to define each objective coefficient.

Addition of multiple variables and constraints can be achieved using addCols and addRows. Alternatively, addVars can be used to add variables, with changeColsCost used to define objective coefficients. Note that defining multiple variables and constraints requires vectors of data and the specification of constraint coefficients as compressed row-wise or column-wise matrices.

Passing a model

If the entire definition of a model is known, then it can be passed to HiGHS via individual data arrays using the method passModel. In languages where HiGHS data structures can be used, an instance of the HighsLp class can be populated with data and then passed.

Solving the model

The incumbent model in HiGHS is solved by a call to the method run. By default, HiGHS minimizes the model's objective function, although this can be changed. Where possible, HiGHS will reduce the solution time by using data obtained on previous runs, or supplied by the user. More information on this process of hot starting solvers is available.

Extracting results

After solving a model, it is important to know whether it has been solved to optimality, shown to be infeasible or unbounded, or why the solver may have terminated early. This model status is given by the value returned by the method getModelStatus. This value is of type HighsModelStatus. Scalar information about a solved model is obtained using the method getInfo. The solution and (any) basis are returned by the methods getSolution and getBasis respectively. HiGHS can also be used to write the solution to a file using the method writeSolution.

Option values

The option values that control HiGHS are of type string, bool, int and double. Options are referred to by a string identical to the name of their identifier. A full specification of the options is given in the list of options. An option value is changed by passing its name and value to the method setOptionValue. The current value of an option is obtained by passing its name to the method getOptionValue.

+Basic features · HiGHS Documentation

Basic features

The minimal use of HiGHS has the following three stages.

Although its default actions will be sufficient for most users, HiGHS can be controlled by setting Option values.

Intro to other basic features

HiGHS data structures

There are several specialist data structures that can be used to interact with HiGHS when using C++ and highspy. These are defined in the sections on enums and classes, and are referred to below.

Enums

Enums are scalar identifier types that can take only a limited range of values.

Classes

The advantage of using the native C++ classes in HiGHS is that many fewer parameters are needed when passing data to and from HiGHS. The binding of the data members of these classes to highspy structures allows them to be used when calling HiGHS from Python, although they are not necessary for the basic use of highspy. As with the C and Fortran interfaces, there are equivalent methods that use simple scalars and vectors of data.

Defining a model

HiGHS has comprehensive tools for defining models. This can be done by either reading a model using a data file created elsewhere, or by passing model data to HiGHS. Once a model has been defined in HiGHS, it is referred to as the incumbent model.

Reading a model from a file

The simplest way to define a model in HiGHS is to read it from a file using the method readModel. HiGHS infers the file type by the extension. Supported extensions are:

  • .mps: for an MPS file
  • .lp: for a CPLEX LP file

HiGHS can read compressed files that end in the .gz extension, but not (yet) files that end in the .zip extension.

Building a model

The model in HiGHS can be built using a sequence of calls to add variables and constraints. This is most easily done one-by-one using the methods addCol and addRow. Alternatively, calls to addVar can be used to add variables, with calls to changeColCost used to define each objective coefficient.

Addition of multiple variables and constraints can be achieved using addCols and addRows. Alternatively, addVars can be used to add variables, with changeColsCost used to define objective coefficients. Note that defining multiple variables and constraints requires vectors of data and the specification of constraint coefficients as compressed row-wise or column-wise matrices.

Passing a model

If the entire definition of a model is known, then it can be passed to HiGHS via individual data arrays using the method passModel. In languages where HiGHS data structures can be used, an instance of the HighsLp class can be populated with data and then passed.

Solving the model

The incumbent model in HiGHS is solved by a call to the method run. By default, HiGHS minimizes the model's objective function, although this can be changed. Where possible, HiGHS will reduce the solution time by using data obtained on previous runs, or supplied by the user. More information on this process of hot starting solvers is available.

Extracting results

After solving a model, it is important to know whether it has been solved to optimality, shown to be infeasible or unbounded, or why the solver may have terminated early. This model status is given by the value returned by the method getModelStatus. This value is of type HighsModelStatus. Scalar information about a solved model is obtained using the method getInfo. The solution and (any) basis are returned by the methods getSolution and getBasis respectively. HiGHS can also be used to write the solution to a file using the method writeSolution.

Option values

The option values that control HiGHS are of type string, bool, int and double. Options are referred to by a string identical to the name of their identifier. A full specification of the options is given in the list of options. An option value is changed by passing its name and value to the method setOptionValue. The current value of an option is obtained by passing its name to the method getOptionValue.

diff --git a/previews/PR2119/guide/further/index.html b/previews/PR2119/guide/further/index.html index 4371990732..e723c86c72 100644 --- a/previews/PR2119/guide/further/index.html +++ b/previews/PR2119/guide/further/index.html @@ -1,2 +1,2 @@ -Further features · HiGHS Documentation

Further features

Model and solution management

HiGHS has comprehensive tools for defining and extracting models. This can be done either to/from MPS or (CPLEX) format LP files, or via method calls. HiGHS also has methods that permit the incumbent model to be modified. Solutions can be supplied and extracted using either files or method calls.

Extracting model data

The numbers of column, rows and nonzeros in the model are returned by the methods getNumCols, getNumRows, and getNumEntries respectively.

Model data can be extracted for a single column or row by specifying the index of the column or row and calling the methods getCol and getRow.

As well as returning the value of the cost and bounds, these methods also return the number of nonzeros in the corresponding column or row of the constraint matrix. The indices and values of the nonzeros can be obtained using the methods getColEntries and getRowEntries.

For multiple columns and rows defined by a set of indices, the corresponding data can be extracted using the methods getCols, getRows, getColsEntries and getRowsEntries.

Specific matrix coefficients obtained using the method getCoeff.

Modifying model data

The most immediate model modification is to change the sense of the objective. By default, HiGHS minimizes the model's objective function. The objective sense can be set to minimize (maximize) using changeObjectiveSense.

Model data for can be changed for one column or row by specifying the index of the column or row, together with the new scalar value for the cost or bounds, the specific methods being changeColCost, changeColBounds. The corresponding method for a row is changeRowBounds. Changes for multiple columns or rows are defined by supplying a list of indices, together with arrays of new values, using the methods changeColsCost, changeColsBounds. The corresponding method for a row is changeRowsBounds. An individual matrix coefficient is changed by passing its row index, column index and new value to changeCoeff.

Hot start

It may be possible for HiGHS to start solving a model using data obtained by solving a related model, or supplied by a user. Whether this is possible depends on the the class of model being solved, the solver to be used, and the modifications (if any) that have been to the incumbent model since it was last solved.

LP

To run HiGHS from a user-defined solution or basis, this is passed to HiGHS using the methods setSolution or setBasis. The basis passed to HiGHS need not be complete

  • There can be more basic variables then the number of rows in the model. HiGHS will identify a set of basic variables of the correct dimension by making some basic variables nonbasic

  • There can be fewer basic variables then the number of rows in the model. HiGHS will identify a set of basic variables of the correct dimension by adding basic variables corresponding to slacks.

  • For nonbasic variables, it is unnecessary to specify whether they are at their lower or upper bound unless they are "boxed" variables.

MIP

If a (partial) feasible assignment of the integer variables is known, this can be passed to HiGHS via setSolution. If integer variables are set to integer values, HiGHS will solve the LP with these integer variables fixed (or MIP if the assignment of the integer variables is not complete). If a feasible solution is obtained, it will be used to provide the MIP solver with an initial primal bound when it run to solve for all integer variables.

Presolve

HiGHS has a sophisticated presolve procedure for LPs and MIPs that aims to reduce the dimension of the model that must be solved. In most cases, the time saved by solving the reduced model is very much greater than the time taken to perform presolve. Once he presolved model is solved, a postsolve procedure (of minimal computational cost) deduces the optimal solution to the original model. Hence presolve is performed by default. The only exception occus when there is a valid basis for an LP and the simplex solver is used. In this case the original LP is solved, starting from this basis. In cases where the use of presolve is found not to be advantageous, its use can be switched off by setting the presolve option to "off".

HiGHS has a method presolve that performs presolve on the incumbent model, allowing the presolved model to be extracted or written to a file. This is intended for users who have their own solution technique that they wish to test using models presolved by HiGHS. Note that this does not affect how the incumbent model is solved. There are two corresponding postsolve methods, according to whether there are just solution values, or also a basis.

Multi-objective optimization

Users can specify multiple linear objectives with respect to which HiGHS will optimize by either blending them, or by performing lexicographic optimization according to the truth of the blend_multi_objectives option. Each linear objective is represented by the following data, held in the HighsLinearObjective structure

  • weight: Scalar of type double - The weight of this objective when blending
  • offset: Scalar of type double - The offset of this objective
  • coefficients: Vector of type double - The coefficients of this objective
  • abs_tolerance: Scalar of type double - The absolute tolerance on this objective when performing lexicographic optimization
  • rel_tolerance: Scalar of type double - The relative tolerance on this objective when performing lexicographic optimization
  • priority: Scalar of type HighsInt - The priority of this objective when performing lexicographic optimization

Methods

Multi-objective optimization in HiGHS is defined by the following methods

  • [addLinearObjective](@ref Multi-objective-optimization] - Add a single HighsLinearObjective instance to any already stored in HiGHS
  • [clearLinearObjectives](@ref Multi-objective-optimization] - Clears any linear objectives stored in HiGHS

When there is at least one HighsLinearObjective instance in HiGHS, the col_cost_ data in the incumbent model is ignored.

Blending multiple linear objectives

When blend_multi_objectives is true, as it is by default, any HighsLinearObjective instances will be combined according to the weight values, and the resulting objective will be minimized. Hence, any objectives that should be maximized within the combination must have a negative weight value.

Lexicographic optimization of multiple linear objectives

When blend_multi_objectives is false, HiGHS will optimize lexicographically with respect to any HighsLinearObjective instances. This is carried out as follows, according to the priority values in HighsLinearObjective instances. Note that all priority values must be distinct.

  • Minimize/maximize with respect to the linear objective of highest priority value, according to whether its weight is positive/negative

  • Add a constraint to the model so that the value of the linear objective of highest priority satsifies a bound given by the values of abs_tolerance and/or rel_tolerance.

    • If the objective was minimized to a value $f^*\ge0$, then the constraint ensures that the this objective value is no greater than $\min(f^*+abs\_tolerance,~f^*\times[1+rel\_tolerance]).$

    • If the objective was minimized to a value $f^*<0$, then the constraint ensures that the this objective value is no greater than $\min(f^*+abs\_tolerance,~f^*\times[1-rel\_tolerance]).$

    • If the objective was maximized to a value $f^*\ge0$, then the constraint ensures that the this objective value is no less than $\max(f^*-abs\_tolerance,~f^*\times[1-rel\_tolerance]).$

    • If the objective was maximized to a value $f^*<0$, then the constraint ensures that the this objective value is no less than $\max(f^*-abs\_tolerance,~f^*\times[1+rel\_tolerance]).$

  • Minimize/maximize with respect to the linear objective of next highest priority, and then add a corresponding objective constraint to the model, repeating until optimization with respect to the linear objective of lowest priority has taken place.

Note

  • Negative values of abs_tolerance and rel_tolerance will be ignored. This is a convenient way of "switching off" a bounding technique that is not of interest.
  • When the model is continuous, no dual information will be returned if there is more than one linear objective.
+Further features · HiGHS Documentation

Further features

Model and solution management

HiGHS has comprehensive tools for defining and extracting models. This can be done either to/from MPS or (CPLEX) format LP files, or via method calls. HiGHS also has methods that permit the incumbent model to be modified. Solutions can be supplied and extracted using either files or method calls.

Extracting model data

The numbers of column, rows and nonzeros in the model are returned by the methods getNumCols, getNumRows, and getNumEntries respectively.

Model data can be extracted for a single column or row by specifying the index of the column or row and calling the methods getCol and getRow.

As well as returning the value of the cost and bounds, these methods also return the number of nonzeros in the corresponding column or row of the constraint matrix. The indices and values of the nonzeros can be obtained using the methods getColEntries and getRowEntries.

For multiple columns and rows defined by a set of indices, the corresponding data can be extracted using the methods getCols, getRows, getColsEntries and getRowsEntries.

Specific matrix coefficients obtained using the method getCoeff.

Modifying model data

The most immediate model modification is to change the sense of the objective. By default, HiGHS minimizes the model's objective function. The objective sense can be set to minimize (maximize) using changeObjectiveSense.

Model data for can be changed for one column or row by specifying the index of the column or row, together with the new scalar value for the cost or bounds, the specific methods being changeColCost, changeColBounds. The corresponding method for a row is changeRowBounds. Changes for multiple columns or rows are defined by supplying a list of indices, together with arrays of new values, using the methods changeColsCost, changeColsBounds. The corresponding method for a row is changeRowsBounds. An individual matrix coefficient is changed by passing its row index, column index and new value to changeCoeff.

Hot start

It may be possible for HiGHS to start solving a model using data obtained by solving a related model, or supplied by a user. Whether this is possible depends on the the class of model being solved, the solver to be used, and the modifications (if any) that have been to the incumbent model since it was last solved.

LP

To run HiGHS from a user-defined solution or basis, this is passed to HiGHS using the methods setSolution or setBasis. The basis passed to HiGHS need not be complete

  • There can be more basic variables then the number of rows in the model. HiGHS will identify a set of basic variables of the correct dimension by making some basic variables nonbasic

  • There can be fewer basic variables then the number of rows in the model. HiGHS will identify a set of basic variables of the correct dimension by adding basic variables corresponding to slacks.

  • For nonbasic variables, it is unnecessary to specify whether they are at their lower or upper bound unless they are "boxed" variables.

MIP

If a (partial) feasible assignment of the integer variables is known, this can be passed to HiGHS via setSolution. If integer variables are set to integer values, HiGHS will solve the LP with these integer variables fixed (or MIP if the assignment of the integer variables is not complete). If a feasible solution is obtained, it will be used to provide the MIP solver with an initial primal bound when it run to solve for all integer variables.

Presolve

HiGHS has a sophisticated presolve procedure for LPs and MIPs that aims to reduce the dimension of the model that must be solved. In most cases, the time saved by solving the reduced model is very much greater than the time taken to perform presolve. Once he presolved model is solved, a postsolve procedure (of minimal computational cost) deduces the optimal solution to the original model. Hence presolve is performed by default. The only exception occus when there is a valid basis for an LP and the simplex solver is used. In this case the original LP is solved, starting from this basis. In cases where the use of presolve is found not to be advantageous, its use can be switched off by setting the presolve option to "off".

HiGHS has a method presolve that performs presolve on the incumbent model, allowing the presolved model to be extracted or written to a file. This is intended for users who have their own solution technique that they wish to test using models presolved by HiGHS. Note that this does not affect how the incumbent model is solved. There are two corresponding postsolve methods, according to whether there are just solution values, or also a basis.

Multi-objective optimization

Users can specify multiple linear objectives with respect to which HiGHS will optimize by either blending them, or by performing lexicographic optimization according to the truth of the blend_multi_objectives option. Each linear objective is represented by the following data, held in the HighsLinearObjective structure

  • weight: Scalar of type double - The weight of this objective when blending
  • offset: Scalar of type double - The offset of this objective
  • coefficients: Vector of type double - The coefficients of this objective
  • abs_tolerance: Scalar of type double - The absolute tolerance on this objective when performing lexicographic optimization
  • rel_tolerance: Scalar of type double - The relative tolerance on this objective when performing lexicographic optimization
  • priority: Scalar of type HighsInt - The priority of this objective when performing lexicographic optimization

Methods

Multi-objective optimization in HiGHS is defined by the following methods

  • [addLinearObjective](@ref Multi-objective-optimization] - Add a single HighsLinearObjective instance to any already stored in HiGHS
  • [clearLinearObjectives](@ref Multi-objective-optimization] - Clears any linear objectives stored in HiGHS

When there is at least one HighsLinearObjective instance in HiGHS, the col_cost_ data in the incumbent model is ignored.

Blending multiple linear objectives

When blend_multi_objectives is true, as it is by default, any HighsLinearObjective instances will be combined according to the weight values, and the resulting objective will be minimized. Hence, any objectives that should be maximized within the combination must have a negative weight value.

Lexicographic optimization of multiple linear objectives

When blend_multi_objectives is false, HiGHS will optimize lexicographically with respect to any HighsLinearObjective instances. This is carried out as follows, according to the priority values in HighsLinearObjective instances. Note that all priority values must be distinct.

  • Minimize/maximize with respect to the linear objective of highest priority value, according to whether its weight is positive/negative

  • Add a constraint to the model so that the value of the linear objective of highest priority satsifies a bound given by the values of abs_tolerance and/or rel_tolerance.

    • If the objective was minimized to a value $f^*\ge0$, then the constraint ensures that the this objective value is no greater than $\min(f^*+abs\_tolerance,~f^*\times[1+rel\_tolerance]).$

    • If the objective was minimized to a value $f^*<0$, then the constraint ensures that the this objective value is no greater than $\min(f^*+abs\_tolerance,~f^*\times[1-rel\_tolerance]).$

    • If the objective was maximized to a value $f^*\ge0$, then the constraint ensures that the this objective value is no less than $\max(f^*-abs\_tolerance,~f^*\times[1-rel\_tolerance]).$

    • If the objective was maximized to a value $f^*<0$, then the constraint ensures that the this objective value is no less than $\max(f^*-abs\_tolerance,~f^*\times[1+rel\_tolerance]).$

  • Minimize/maximize with respect to the linear objective of next highest priority, and then add a corresponding objective constraint to the model, repeating until optimization with respect to the linear objective of lowest priority has taken place.

Note

  • Negative values of abs_tolerance and rel_tolerance will be ignored. This is a convenient way of "switching off" a bounding technique that is not of interest.
  • When the model is continuous, no dual information will be returned if there is more than one linear objective.
diff --git a/previews/PR2119/guide/index.html b/previews/PR2119/guide/index.html index 20dd10eb1d..109c8d86cd 100644 --- a/previews/PR2119/guide/index.html +++ b/previews/PR2119/guide/index.html @@ -1,2 +1,2 @@ -Introduction · HiGHS Documentation

Introduction

This guide describes the features of HiGHS that are available when it is called from Python, C++, C, C# and Fortran. It is written in three sections: basic, further and advanced.

The basic section will be sufficient for most users. This and the further section cover the Python interface highspy. Although references to methods link to Python examples, the method names and functionality for other interfaces are as close as possible.

The advanced section covers features in the C++, C and Fortran that are not in highspy.

+Introduction · HiGHS Documentation

Introduction

This guide describes the features of HiGHS that are available when it is called from Python, C++, C, C# and Fortran. It is written in three sections: basic, further and advanced.

The basic section will be sufficient for most users. This and the further section cover the Python interface highspy. Although references to methods link to Python examples, the method names and functionality for other interfaces are as close as possible.

The advanced section covers features in the C++, C and Fortran that are not in highspy.

diff --git a/previews/PR2119/index.html b/previews/PR2119/index.html index e97ebe681e..a76cc8dc53 100644 --- a/previews/PR2119/index.html +++ b/previews/PR2119/index.html @@ -3,4 +3,4 @@ \min \quad & c^T\! x \\ \textrm{subject to} \quad & L \le Ax \le U \\ & l \le x \le u, -\end{aligned}\]

as well as mixed integer linear programming (MILP) models of the same form, for which some of the variables must take integer values.

HiGHS also solves quadratic programming (QP) models, which contain an additional objective term $\frac{1}{2}x^T\! Q x$, where the Hessian matrix $Q$ is positive semi-definite. HiGHS cannot solve QP models where some of the variables must take integer values.

Read the Terminology section for more details.

Using HiGHS

HiGHS can be used as a standalone executable on Windows, Linux and MacOS. There is also a C++11 library that can be used within a C++ project or, via its C, C#, FORTRAN, Julia, and Python interfaces.

Get started by following Install HiGHS.

Overview

The standalone executable allows models to be solved from MPS or (CPLEX) LP files, with full control of the HiGHS run-time options, and the solution can be written to files in human and computer-readable formats.

The HiGHS shared library allows models to be loaded, built and modified. It can also be used to extract solution data and perform other operations relating to the incumbent model. The basic functionality is introduced via a Guide, with links to examples of its use in the Python interface highspy. This makes use of the C++ structures and enums, and is as close as possible to the native C++ library calls. These can be studied via the C++ header file.

The C interface cannot make use of the C++ structures and enums, and its methods are documented explicitly.

Solvers

For LPs, HiGHS has implementations of the revised simplex method, interior point method, and PDLP first order method. MIPs are solved by branch-and-cut, and QPs by active set. More information on the HiGHS solvers is available.

Citing HiGHS

If you use HiGHS in an academic context, please 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

Performance benchmarks

The performance of HiGHS relative to some commercial and open-source simplex solvers may be assessed via the Mittlemann benchmarks:

Feedback

Your comments or specific questions on HiGHS would be greatly appreciated, so please send an email to highsopt@gmail.com to get in touch with the development team.

+\end{aligned}\]

as well as mixed integer linear programming (MILP) models of the same form, for which some of the variables must take integer values.

HiGHS also solves quadratic programming (QP) models, which contain an additional objective term $\frac{1}{2}x^T\! Q x$, where the Hessian matrix $Q$ is positive semi-definite. HiGHS cannot solve QP models where some of the variables must take integer values.

Read the Terminology section for more details.

Using HiGHS

HiGHS can be used as a standalone executable on Windows, Linux and MacOS. There is also a C++11 library that can be used within a C++ project or, via its C, C#, FORTRAN, Julia, and Python interfaces.

Get started by following Install HiGHS.

Overview

The standalone executable allows models to be solved from MPS or (CPLEX) LP files, with full control of the HiGHS run-time options, and the solution can be written to files in human and computer-readable formats.

The HiGHS shared library allows models to be loaded, built and modified. It can also be used to extract solution data and perform other operations relating to the incumbent model. The basic functionality is introduced via a Guide, with links to examples of its use in the Python interface highspy. This makes use of the C++ structures and enums, and is as close as possible to the native C++ library calls. These can be studied via the C++ header file.

The C interface cannot make use of the C++ structures and enums, and its methods are documented explicitly.

Solvers

For LPs, HiGHS has implementations of the revised simplex method, interior point method, and PDLP first order method. MIPs are solved by branch-and-cut, and QPs by active set. More information on the HiGHS solvers is available.

Citing HiGHS

If you use HiGHS in an academic context, please 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

Performance benchmarks

The performance of HiGHS relative to some commercial and open-source simplex solvers may be assessed via the Mittlemann benchmarks:

Feedback

Your comments or specific questions on HiGHS would be greatly appreciated, so please send an email to highsopt@gmail.com to get in touch with the development team.

diff --git a/previews/PR2119/installation/index.html b/previews/PR2119/installation/index.html index 383f360779..3a230c01f9 100644 --- a/previews/PR2119/installation/index.html +++ b/previews/PR2119/installation/index.html @@ -1,2 +1,2 @@ -Install HiGHS · HiGHS Documentation

Install HiGHS

Compile from source

HiGHS uses CMake as build system, and requires at least version 3.15. Details about building from source using cmake can be found in HiGHS/cmake/README.md.

Install via a package manager

HiGHS can be installed using a package manager in the cases of Julia, Python, CSharp and Rust.

Precompiled Binaries

These binaries are provided by the Julia community and are not officially supported by the HiGHS development team. If you have trouble using these libraries, please open a GitHub issue and tag @odow in your question.

Precompiled static executables are available for a variety of platforms at

Multiple versions are available. Each version has the form vX.Y.Z. In general, you should choose the most recent versinon.

To install a precompiled binary, download the appropriate HiGHSstatic.vX.Y.Z.[platform-string].tar.gz file and extract the executable located at /bin/highs.

Do not download the file starting with HiGHSstatic-logs. These files contain information from the automated compilation system. Click "Show all N assets" to see more files.

Platform strings

The GitHub releases contain precompiled binaries for a number of different platforms. These are indicated by the platform-specific string in each filename.

  • For Windows users: choose the file ending in x86_64-w64-mingw32-cxx11.tar.gz
  • For M1 macOS users: choose the file ending in aarch64-apple-darwin.tar.gz
  • For Intel macOS users: choose the file ending in x86_64-apple-darwin.tar.gz
+Install HiGHS · HiGHS Documentation

Install HiGHS

Compile from source

HiGHS uses CMake as build system, and requires at least version 3.15. Details about building from source using cmake can be found in HiGHS/cmake/README.md.

Install via a package manager

HiGHS can be installed using a package manager in the cases of Julia, Python, CSharp and Rust.

Precompiled Binaries

These binaries are provided by the Julia community and are not officially supported by the HiGHS development team. If you have trouble using these libraries, please open a GitHub issue and tag @odow in your question.

Precompiled static executables are available for a variety of platforms at

Multiple versions are available. Each version has the form vX.Y.Z. In general, you should choose the most recent versinon.

To install a precompiled binary, download the appropriate HiGHSstatic.vX.Y.Z.[platform-string].tar.gz file and extract the executable located at /bin/highs.

Do not download the file starting with HiGHSstatic-logs. These files contain information from the automated compilation system. Click "Show all N assets" to see more files.

Platform strings

The GitHub releases contain precompiled binaries for a number of different platforms. These are indicated by the platform-specific string in each filename.

  • For Windows users: choose the file ending in x86_64-w64-mingw32-cxx11.tar.gz
  • For M1 macOS users: choose the file ending in aarch64-apple-darwin.tar.gz
  • For Intel macOS users: choose the file ending in x86_64-apple-darwin.tar.gz
diff --git a/previews/PR2119/interfaces/c_api/index.html b/previews/PR2119/interfaces/c_api/index.html index 84e4a47bcf..c5f2888e2d 100644 --- a/previews/PR2119/interfaces/c_api/index.html +++ b/previews/PR2119/interfaces/c_api/index.html @@ -1,2 +1,2 @@ -C · HiGHS Documentation

C

Highs_addColMethod
Highs_addCol(highs, cost, lower, upper, num_new_nz, index, value)

Add a new column (variable) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • cost: The objective coefficient of the column.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.
  • num_new_nz: The number of non-zeros in the column.
  • index: An array of size [num_new_nz] with the row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addColsMethod
Highs_addCols(highs, num_new_col, costs, lower, upper, num_new_nz, starts, index, value)

Add multiple columns (variables) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_col: The number of new columns to add.
  • costs: An array of size [num_new_col] with objective coefficients.
  • lower: An array of size [num_new_col] with lower bounds.
  • upper: An array of size [num_new_col] with upper bounds.
  • num_new_nz: The number of new nonzeros in the constraint matrix.
  • starts: The constraint coefficients are given as a matrix in compressed sparse column form by the arrays starts, index, and value. starts is an array of size [num_new_cols] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addLinearObjectiveMethod
Highs_addLinearObjective(highs, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Adds linear objective data to HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • weight: The weight of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: The objective offset
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: The absolute tolerance used when constructing an objective constraint during lexicographic optimization
  • rel_tolerance: The relative tolerance used when constructing an objective constraint during lexicographic optimization
  • priority: The priority of this objective during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRowMethod
Highs_addRow(highs, lower, upper, num_new_nz, index, value)

Add a new row (a linear constraint) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the row.
  • upper: The upper bound of the row.
  • num_new_nz: The number of non-zeros in the row
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRowsMethod
Highs_addRows(highs, num_new_row, lower, upper, num_new_nz, starts, index, value)

Add multiple rows (linear constraints) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_row: The number of new rows to add
  • lower: An array of size [num_new_row] with the lower bounds of the rows.
  • upper: An array of size [num_new_row] with the upper bounds of the rows.
  • num_new_nz: The number of non-zeros in the rows.
  • starts: The constraint coefficients are given as a matrix in compressed sparse row form by the arrays starts, index, and value. starts is an array of size [num_new_rows] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVarMethod
Highs_addVar(highs, lower, upper)

Add a new variable to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVarsMethod
Highs_addVars(highs, num_new_var, lower, upper)

Add multiple variables to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_var: The number of new variables to add.
  • lower: An array of size [num_new_var] with lower bounds.
  • upper: An array of size [num_new_var] with upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeCoeffMethod
Highs_changeCoeff(highs, row, col, value)

Change a coefficient in the constraint matrix.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to change.
  • col: The index of the column to change.
  • value: The new constraint coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColBoundsMethod
Highs_changeColBounds(highs, col, lower, upper)

Change the variable bounds of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColCostMethod
Highs_changeColCost(highs, col, cost)

Change the objective coefficient of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column fo change.
  • cost: The new objective coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColIntegralityMethod
Highs_changeColIntegrality(highs, col, integrality)

Change the integrality of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The column index to change.
  • integrality: The new integrality of the column in the form of a kHighsVarType constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByMaskMethod
Highs_changeColsBoundsByMask(highs, mask, lower, upper)

Change the variable bounds of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column bounds should be changed and 0 otherwise.
  • lower: An array of length [num_col] with the new lower bounds.
  • upper: An array of length [num_col] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByRangeMethod
Highs_changeColsBoundsByRange(highs, from_col, to_col, lower, upper)

Change the variable bounds of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose bound changes.
  • to_col: The index of the last column whose bound changes.
  • lower: An array of length [to_col - from_col + 1] with the new lower bounds.
  • upper: An array of length [to_col - from_col + 1] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsBySetMethod
Highs_changeColsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByMaskMethod
Highs_changeColsCostByMask(highs, mask, cost)

Change the cost of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column cost should be changed and 0 otherwise.
  • cost: An array of length [num_col] with the new costs.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByRangeMethod
Highs_changeColsCostByRange(highs, from_col, to_col, cost)

Change the cost coefficients of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose cost changes.
  • to_col: The index of the last column whose cost changes.
  • cost: An array of length [to_col - from_col + 1] with the new objective coefficients.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostBySetMethod
Highs_changeColsCostBySet(highs, num_set_entries, set, cost)

Change the cost of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • cost: An array of length [num_set_entries] with the new costs of the columns.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByMaskMethod
Highs_changeColsIntegralityByMask(highs, mask, integrality)

Change the integrality of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column integrality should be changed and 0 otherwise.
  • integrality: An array of length [num_col] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByRangeMethod
Highs_changeColsIntegralityByRange(highs, from_col, to_col, integrality)

Change the integrality of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose integrality changes.
  • to_col: The index of the last column whose integrality changes.
  • integrality: An array of length [to_col - from_col + 1] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityBySetMethod
Highs_changeColsIntegralityBySet(highs, num_set_entries, set, integrality)

Change the integrality of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • integrality: An array of length [num_set_entries] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveOffsetMethod
Highs_changeObjectiveOffset(highs, offset)

Change the objective offset of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • offset: The new objective offset.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveSenseMethod
Highs_changeObjectiveSense(highs, sense)

Change the objective sense of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • sense: The new optimization sense in the form of a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowBoundsMethod
Highs_changeRowBounds(highs, row, lower, upper)

Change the bounds of a row.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsByMaskMethod
Highs_changeRowsBoundsByMask(highs, mask, lower, upper)

Change the bounds of multiple rows given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row bounds should be changed and 0 otherwise.
  • lower: An array of length [num_row] with the new lower bounds.
  • upper: An array of length [num_row] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsBySetMethod
Highs_changeRowsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple rows given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to change.
  • set: An array of size [num_set_entries] with the indices of the rows to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearMethod
Highs_clear(highs)

Reset the options and then call clearModel.

See Highs_destroy to free all associated memory.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearIntegralityMethod
Highs_clearIntegrality(highs)

Clear the integrality of all columns

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearLinearObjectivesMethod
Highs_clearLinearObjectives(highs)

Clears any multiple linear objective data in HiGHS

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearModelMethod
Highs_clearModel(highs)

Remove all variables and constraints from the model highs, but do not invalidate the pointer highs. Future calls (for example, adding new variables and constraints) are allowed.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearSolverMethod
Highs_clearSolver(highs)

Clear all solution data associated with the model.

See Highs_destroy to clear the model and free all associated memory.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_createMethod
Highs_create()

Create a Highs instance and return the reference.

Call Highs_destroy on the returned reference to clean up allocated memory.

Returns

A pointer to the Highs instance.

source
Highs_crossoverMethod
Highs_crossover(highs, num_col, num_row, col_value, col_dual, row_dual)

Set a primal (and possibly dual) solution as a starting point, then run crossover to compute a basic feasible solution.

Parameters

  • highs: A pointer to the Highs instance.
  • num_col: The number of variables.
  • num_row: The number of rows.
  • col_value: An array of length [num_col] with optimal primal solution for each column.
  • col_dual: An array of length [num_col] with optimal dual solution for each column. May be NULL, in which case no dual solution is passed.
  • row_dual: An array of length [num_row] with optimal dual solution for each row. . May be NULL, in which case no dual solution is passed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByMaskMethod
Highs_deleteColsByMask(highs, mask)

Delete multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column should be deleted and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByRangeMethod
Highs_deleteColsByRange(highs, from_col, to_col)

Delete multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column to delete.
  • to_col: The index of the last column to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsBySetMethod
Highs_deleteColsBySet(highs, num_set_entries, set)

Delete multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to delete.
  • set: An array of size [num_set_entries] with the indices of the columns to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByMaskMethod
Highs_deleteRowsByMask(highs, mask)

Delete multiple rows given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row should be deleted and 0 otherwise. The new index of any column not deleted is stored in place of the value 0.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByRangeMethod
Highs_deleteRowsByRange(highs, from_row, to_row)

Delete multiple adjacent rows.

Parameters

  • highs: A pointer to the Highs instance.
  • from_row: The index of the first row to delete.
  • to_row: The index of the last row to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsBySetMethod
Highs_deleteRowsBySet(highs, num_set_entries, set)

Delete multiple rows given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to delete.
  • set: An array of size [num_set_entries] with the indices of the rows to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_destroyMethod
Highs_destroy(highs)

Destroy the model highs created by Highs_create and free all corresponding memory. Future calls using highs are not allowed.

To empty a model without invalidating highs, see Highs_clearModel.

Parameters

  • highs: A pointer to the Highs instance.
source
Highs_ensureColwiseMethod
Highs_ensureColwise(highs)

Ensure that the constraint matrix of the incumbent model is stored column-wise.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_ensureRowwiseMethod
Highs_ensureRowwise(highs)

Ensure that the constraint matrix of the incumbent model is stored row-wise.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_feasibilityRelaxationMethod
Highs_feasibilityRelaxation(highs, global_lower_penalty, global_upper_penalty, global_rhs_penalty, local_lower_penalty, local_upper_penalty, local_rhs_penalty)

Compute the solution corresponding to a (possibly weighted) sum of (allowable) infeasibilities in an LP/MIP.

If local penalties are not defined, pass NULL, and the global penalty will be used. Negative penalty values imply that the bound or RHS value cannot be violated

Parameters

  • highs: A pointer to the Highs instance.
  • const: double global_lower_penalty The penalty for violating lower bounds on variables
  • const: double global_upper_penalty The penalty for violating upper bounds on variables
  • const: double global_rhs_penalty The penalty for violating constraint RHS values
  • const: double* local_lower_penalty The penalties for violating specific lower bounds on variables
  • const: double* local_upper_penalty The penalties for violating specific upper bounds on variables
  • const: double* local_rhs_penalty The penalties for violating specific constraint RHS values

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasicVariablesMethod
Highs_getBasicVariables(highs, basic_variables)

Get the indices of the rows and columns that make up the basis matrix $B$ of a basic feasible solution.

Non-negative entries are indices of columns, and negative entries are -row\_index - 1. For example, {1, -1} would be the second column and first row.

The order of these rows and columns is important for calls to the functions:

Parameters

  • highs: A pointer to the Highs instance.
  • basic_variables: An array of size [num_rows], filled with the indices of the basic variables.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisMethod
Highs_getBasis(highs, col_status, row_status)

Given a linear program with a basic feasible solution, get the column and row basis statuses.

Parameters

  • highs: A pointer to the Highs instance.
  • col_status: An array of length [num_col], to be filled with the column basis statuses in the form of a kHighsBasisStatus constant.
  • row_status: An array of length [num_row], to be filled with the row basis statuses in the form of a kHighsBasisStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseColMethod
Highs_getBasisInverseCol(highs, col, col_vector, col_num_nz, col_index)

Get a column of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseRowMethod
Highs_getBasisInverseRow(highs, row, row_vector, row_num_nz, row_index)

Get a row of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisSolveMethod
Highs_getBasisSolve(highs, rhs, solution_vector, solution_num_nz, solution_index)

Compute ${x}=B^{-1}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$.
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisTransposeSolveMethod
Highs_getBasisTransposeSolve(highs, rhs, solution_vector, solution_nz, solution_index)

Compute ${x}=B^{-T}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValueMethod
Highs_getBoolOptionValue(highs, option, value)

Get a boolean-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValuesMethod
Highs_getBoolOptionValues(highs, option, current_value, default_value)

Get the current and default values of a bool option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getCallbackDataOutItemMethod
Highs_getCallbackDataOutItem(data_out, item_name)

Get a void* pointer to a callback data item

Parameters

Returns

A void* pointer to the callback data item, or NULL if item_name not valid

source
Highs_getColByNameMethod
Highs_getColByName(highs, name, col)

Get the index of a column from its name.

If multiple columns have the same name, or if no column exists with name, this function returns kHighsStatusError.

Parameters

  • name: A pointer of the name of the column to query.
  • col: A pointer in which to store the index of the column

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColIntegralityMethod
Highs_getColIntegrality(highs, col, integrality)

Get the integrality of a column.

Parameters

  • col: The index of the column to query.
  • integrality: An integer in which the integrality of the column should be placed. The integer is one of the kHighsVarTypeXXX constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColNameMethod
Highs_getColName(highs, col, name)

Get the name of a column.

Parameters

  • col: The index of the column to query.
  • name: A pointer in which to store the name of the column. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByMaskMethod
Highs_getColsByMask(highs, mask, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by a mask.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Parameters

  • mask: An array of length [num_col] containing a 1 to get the column and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByRangeMethod
Highs_getColsByRange(highs, from_col, to_col, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent columns from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The first column for which to query data for.
  • to_col: The last column (inclusive) for which to query data for.
  • num_col: An integer populated with the number of columns got from the model (this should equal to\_col - from\_col + 1).
  • costs: An array of size [to_col - from_col + 1] for the column cost coefficients.
  • lower: An array of size [to_col - from_col + 1] for the column lower bounds.
  • upper: An array of size [to_col - from_col + 1] for the column upper bounds.
  • num_nz: An integer to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_col - from_col + 1] with the start indices of each column in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the row indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsBySetMethod
Highs_getColsBySet(highs, num_set_entries, set, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by an array.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Parameters

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] with the column indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleInfoValueMethod
Highs_getDoubleInfoValue(highs, info, value)

Get a double-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to a double that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValueMethod
Highs_getDoubleOptionValue(highs, option, value)

Get a double-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValuesMethod
Highs_getDoubleOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of a double option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualRayMethod
Highs_getDualRay(highs, has_dual_ray, dual_ray_value)

Indicates whether a dual ray that is a certificate of primal infeasibility currently exists, and (at the expense of solving an LP) gets it if it does not and dual_ray_value is not nullptr.

Parameters

  • highs: A pointer to the Highs instance.
  • has_dual_ray: A pointer to an int to store 1 if a dual ray currently exists.
  • dual_ray_value: An array of length [num_row] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualUnboundednessDirectionMethod
Highs_getDualUnboundednessDirection(highs, has_dual_unboundedness_direction, dual_unboundedness_direction_value)

Indicates whether a dual unboundedness direction (corresponding to a certificate of primal infeasibility) exists, and (at the expense of solving an LP) gets it if it does not and dual_unboundedness_direction is not nullptr

Parameters

  • highs: A pointer to the Highs instance.
  • has_dual_unboundedness_direction: A pointer to an int to store 1 if the dual unboundedness direction exists.
  • dual_unboundedness_direction_value: An array of length [num_col] filled with the unboundedness direction.
source
Highs_getHessianNumNzMethod
Highs_getHessianNumNz(highs)

Return the number of nonzeroes in the Hessian matrix of the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeroes in the Hessian matrix of the model.

source
Highs_getInfinityMethod
Highs_getInfinity(highs)

Return the value of infinity used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The value of infinity used by HiGHS.

source
Highs_getInfoTypeMethod
Highs_getInfoType(highs, info, type)

Get the type expected by an info item.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • type: An int in which the corresponding kHighsOptionType constant is stored.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getInt64InfoValueMethod
Highs_getInt64InfoValue(highs, info, value)

Get an int64-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an int64 that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntInfoValueMethod
Highs_getIntInfoValue(highs, info, value)

Get an int-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an integer that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValueMethod
Highs_getIntOptionValue(highs, option, value)

Get an int-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValuesMethod
Highs_getIntOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of an int option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getLpMethod
Highs_getLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModelMethod
Highs_getModel(highs, a_format, q_format, num_col, num_row, num_nz, hessian_num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Get the data from a HiGHS model.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz - Highs_getHessianNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModelStatusMethod
Highs_getModelStatus(highs)

Return the optimization status of the model in the form of a kHighsModelStatus constant.

Parameters

  • highs: A pointer to the Highs instance.

Returns

An integer corresponding to the kHighsModelStatus constant

source
Highs_getNumColMethod
Highs_getNumCol(highs)

Return the number of columns in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the model.

source
Highs_getNumNzMethod
Highs_getNumNz(highs)

Return the number of nonzeros in the constraint matrix of the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the model.

source
Highs_getNumOptionsMethod
Highs_getNumOptions(highs)

Return the number of options

Parameters

  • highs: A pointer to the Highs instance.
source
Highs_getNumRowMethod
Highs_getNumRow(highs)

Return the number of rows in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the model.

source
Highs_getObjectiveOffsetMethod
Highs_getObjectiveOffset(highs, offset)

Get the objective offset.

Parameters

  • highs: A pointer to the Highs instance.
  • offset: The location in which the current objective offset should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveSenseMethod
Highs_getObjectiveSense(highs, sense)

Get the objective sense.

Parameters

  • highs: A pointer to the Highs instance.
  • sense: The location in which the current objective sense should be placed. The sense is a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveValueMethod
Highs_getObjectiveValue(highs)

Get the primal objective function value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The primal objective function value

source
Highs_getOptionNameMethod
Highs_getOptionName(highs, index, name)

Get the name of an option identified by index

Parameters

  • highs: A pointer to the Highs instance.
  • index: The index of the option.
  • name: The name of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getOptionTypeMethod
Highs_getOptionType(highs, option, type)

Get the type expected by an option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • type: An int in which the corresponding kHighsOptionType constant should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedLpMethod
Highs_getPresolvedLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS presolved LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getPresolvedNumCol - Highs_getPresolvedNumRow - Highs_getPresolvedNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedNumColMethod
Highs_getPresolvedNumCol(highs)

Return the number of columns in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the presolved model.

source
Highs_getPresolvedNumNzMethod
Highs_getPresolvedNumNz(highs)

Return the number of nonzeros in the constraint matrix of the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the presolved model.

source
Highs_getPresolvedNumRowMethod
Highs_getPresolvedNumRow(highs)

Return the number of rows in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the presolved model.

source
Highs_getPrimalRayMethod
Highs_getPrimalRay(highs, has_primal_ray, primal_ray_value)

Indicates whether a primal ray that is a certificate of primal unboundedness currently exists, and (at the expense of solving an LP) gets it if it does not and primal_ray_value is not nullptr.

Parameters

  • highs: A pointer to the Highs instance.
  • has_primal_ray: A pointer to an int to store 1 if the primal ray exists.
  • primal_ray_value: An array of length [num_col] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRangingMethod
Highs_getRanging(highs, col_cost_up_value, col_cost_up_objective, col_cost_up_in_var, col_cost_up_ou_var, col_cost_dn_value, col_cost_dn_objective, col_cost_dn_in_var, col_cost_dn_ou_var, col_bound_up_value, col_bound_up_objective, col_bound_up_in_var, col_bound_up_ou_var, col_bound_dn_value, col_bound_dn_objective, col_bound_dn_in_var, col_bound_dn_ou_var, row_bound_up_value, row_bound_up_objective, row_bound_up_in_var, row_bound_up_ou_var, row_bound_dn_value, row_bound_dn_objective, row_bound_dn_in_var, row_bound_dn_ou_var)

Compute the ranging information for all costs and bounds. For nonbasic variables the ranging information is relative to the active bound. For basic variables the ranging information relates to...

For any values that are not required, pass NULL.

Parameters

  • highs: A pointer to the Highs instance.
  • col_cost_up_value: The upper range of the cost value
  • col_cost_up_objective: The objective at the upper cost range
  • col_cost_up_in_var: The variable entering the basis at the upper cost range
  • col_cost_up_ou_var: The variable leaving the basis at the upper cost range
  • col_cost_dn_value: The lower range of the cost value
  • col_cost_dn_objective: The objective at the lower cost range
  • col_cost_dn_in_var: The variable entering the basis at the lower cost range
  • col_cost_dn_ou_var: The variable leaving the basis at the lower cost range
  • col_bound_up_value: The upper range of the column bound value
  • col_bound_up_objective: The objective at the upper column bound range
  • col_bound_up_in_var: The variable entering the basis at the upper column bound range
  • col_bound_up_ou_var: The variable leaving the basis at the upper column bound range
  • col_bound_dn_value: The lower range of the column bound value
  • col_bound_dn_objective: The objective at the lower column bound range
  • col_bound_dn_in_var: The variable entering the basis at the lower column bound range
  • col_bound_dn_ou_var: The variable leaving the basis at the lower column bound range
  • row_bound_up_value: The upper range of the row bound value
  • row_bound_up_objective: The objective at the upper row bound range
  • row_bound_up_in_var: The variable entering the basis at the upper row bound range
  • row_bound_up_ou_var: The variable leaving the basis at the upper row bound range
  • row_bound_dn_value: The lower range of the row bound value
  • row_bound_dn_objective: The objective at the lower row bound range
  • row_bound_dn_in_var: The variable entering the basis at the lower row bound range
  • row_bound_dn_ou_var: The variable leaving the basis at the lower row bound range

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedColumnMethod
Highs_getReducedColumn(highs, col, col_vector, col_num_nz, col_index)

Compute a column of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedRowMethod
Highs_getReducedRow(highs, row, row_vector, row_num_nz, row_index)

Compute a row of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowByNameMethod
Highs_getRowByName(highs, name, row)

Get the index of a row from its name.

If multiple rows have the same name, or if no row exists with name, this function returns kHighsStatusError.

Parameters

  • name: A pointer of the name of the row to query.
  • row: A pointer in which to store the index of the row

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowNameMethod
Highs_getRowName(highs, row, name)

Get the name of a row.

Parameters

  • row: The index of the row to query.
  • name: A pointer in which to store the name of the row. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByMaskMethod
Highs_getRowsByMask(highs, mask, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by a mask.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Parameters

  • mask: An array of length [num_row] containing a 1 to get the row and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByRangeMethod
Highs_getRowsByRange(highs, from_row, to_row, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent rows from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Parameters

  • highs: A pointer to the Highs instance.
  • from_row: The first row for which to query data for.
  • to_row: The last row (inclusive) for which to query data for.
  • num_row: An integer to be populated with the number of rows got from the smodel.
  • lower: An array of size [to_row - from_row + 1] for the row lower bounds.
  • upper: An array of size [to_row - from_row + 1] for the row upper bounds.
  • num_nz: An integer to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_row - from_row + 1] with the start indices of each row in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the column indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsBySetMethod
Highs_getRowsBySet(highs, num_set_entries, set, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by an array.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Parameters

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] containing the row indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRunTimeMethod
Highs_getRunTime(highs)

Return the cumulative wall-clock time spent in Highs_run.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The cumulative wall-clock time spent in Highs_run

source
Highs_getSizeofHighsIntMethod
Highs_getSizeofHighsInt(highs)

Return the size of integers used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The size of integers used by HiGHS.

source
Highs_getSolutionMethod
Highs_getSolution(highs, col_value, col_dual, row_value, row_dual)

Get the primal and dual solution from an optimized model.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col], to be filled with primal column values.
  • col_dual: An array of length [num_col], to be filled with dual column values.
  • row_value: An array of length [num_row], to be filled with primal row values.
  • row_dual: An array of length [num_row], to be filled with dual row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValueMethod
Highs_getStringOptionValue(highs, option, value)

Get a string-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: A pointer to allocated memory (of at least kMaximumStringLength) to store the current value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValuesMethod
Highs_getStringOptionValues(highs, option, current_value, default_value)

Get the current and default values of a string option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_githashMethod
Highs_githash()

Return the HiGHS githash.

Returns

The HiGHS githash.

source
Highs_lpCallMethod
Highs_lpCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a linear program using HiGHS.

Parameters

  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of nonzeros in the constraint matrix.
  • a_format: The format of the constraint matrix as a kHighsMatrixFormat constant.
  • sense: The optimization sense as a kHighsObjSense constant.
  • offset: The objective constant.
  • col_cost: An array of length [num_col] with the column costs.
  • col_lower: An array of length [num_col] with the column lower bounds.
  • col_upper: An array of length [num_col] with the column upper bounds.
  • row_lower: An array of length [num_row] with the row lower bounds.
  • row_upper: An array of length [num_row] with the row upper bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • col_value: An array of length [num_col], to be filled with the primal column solution.
  • col_dual: An array of length [num_col], to be filled with the dual column solution.
  • row_value: An array of length [num_row], to be filled with the primal row solution.
  • row_dual: An array of length [num_row], to be filled with the dual row solution.
  • col_basis_status: An array of length [num_col], to be filled with the basis status of the columns in the form of a kHighsBasisStatus constant.
  • row_basis_status: An array of length [num_row], to be filled with the basis status of the rows in the form of a kHighsBasisStatus constant.
  • model_status: The location in which to place the termination status of the model after the solve in the form of a kHighsModelStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_mipCallMethod
Highs_mipCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality, col_value, row_value, model_status)

Formulate and solve a mixed-integer linear program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has an additional integrality argument, and that it is missing the col_dual, row_dual, col_basis_status and row_basis_status arguments.

Parameters

  • integrality: An array of length [num_col], containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passColNameMethod
Highs_passColName(highs, col, name)

Pass the name of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The column for which the name is supplied.
  • name: The name of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passHessianMethod
Highs_passHessian(highs, dim, num_nz, format, start, index, value)

Set the Hessian matrix for a quadratic objective.

Parameters

  • highs: A pointer to the Highs instance.
  • dim: The dimension of the Hessian matrix. Should be [num_col].
  • num_nz: The number of non-zero elements in the Hessian matrix.
  • format: The format of the Hessian matrix as a kHighsHessianFormat constant. This must be kHighsHessianFormatTriangular.
  • start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form), using q_start, q_index, and q_value.The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form. The sparse matrix consists of three arrays, start, index, and value. start is an array of length [num_col] containing the starting index of each column in index.
  • index: An array of length [num_nz] with indices of matrix entries.
  • value: An array of length [num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLinearObjectivesMethod
Highs_passLinearObjectives(highs, num_linear_objective, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Passes multiple linear objective data to HiGHS, clearing any such data already in HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • weight: A pointer to the weights of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: A pointer to the objective offsets
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: A pointer to the absolute tolerances used when constructing objective constraints during lexicographic optimization
  • rel_tolerance: A pointer to the relative tolerances used when constructing objective constraints during lexicographic optimization
  • priority: A pointer to the priorities of the objectives during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLpMethod
Highs_passLp(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value)

Pass a linear program (LP) to HiGHS in a single function call.

The signature of this function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program and the integrality vector.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passMipMethod
Highs_passMip(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Pass a mixed-integer linear program (MILP) to HiGHS in a single function call.

The signature of function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModelMethod
Highs_passModel(highs, num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Pass a model to HiGHS in a single function call. This is faster than constructing the model using Highs_addRow and Highs_addCol.

Parameters

  • highs: A pointer to the Highs instance.
  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of elements in the constraint matrix.
  • q_num_nz: The number of elements in the Hessian matrix.
  • a_format: The format of the constraint matrix to use in the form of a kHighsMatrixFormat constant.
  • q_format: The format of the Hessian matrix to use in the form of a kHighsHessianFormat constant.
  • sense: The optimization sense in the form of a kHighsObjSense constant.
  • offset: The constant term in the objective function.
  • col_cost: An array of length [num_col] with the objective coefficients.
  • col_lower: An array of length [num_col] with the lower column bounds.
  • col_upper: An array of length [num_col] with the upper column bounds.
  • row_lower: An array of length [num_row] with the upper row bounds.
  • row_upper: An array of length [num_row] with the upper row bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col]. If the model is linear, pass NULL.
  • q_index: An array of length [q_num_nz] with indices of matrix entries. If the model is linear, pass NULL.
  • q_value: An array of length [q_num_nz] with values of matrix entries. If the model is linear, pass NULL.
  • integrality: An array of length [num_col] containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModelNameMethod
Highs_passModelName(highs, name)

Pass the name of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • name: The name of the model.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passRowNameMethod
Highs_passRowName(highs, row, name)

Pass the name of a row.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The row for which the name is supplied.
  • name: The name of the row.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_postsolveMethod
Highs_postsolve(highs, col_value, col_dual, row_dual)

Postsolve a model using a primal (and possibly dual) solution.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • col_dual: An array of length [num_col] with the column dual values, or a null pointer if not known.
  • row_dual: An array of length [num_row] with the row dual values, or a null pointer if not known.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_presolveMethod
Highs_presolve(highs)

Presolve a model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_qpCallMethod
Highs_qpCall(num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a quadratic program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has additional arguments for specifying the Hessian matrix.

Parameters

  • q_num_nz: The number of nonzeros in the Hessian matrix.
  • q_format: The format of the Hessian matrix in the form of a kHighsHessianStatus constant. If q_num_nz > 0, this must be kHighsHessianFormatTriangular.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col].
  • q_index: An array of length [q_num_nz] with indices of matrix entries.
  • q_value: An array of length [q_num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readModelMethod
Highs_readModel(highs, filename)

Read a model from filename into highs.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to read.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readOptionsMethod
Highs_readOptions(highs, filename)

Read the option values from file.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename from which to read the option values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_resetGlobalSchedulerMethod
Highs_resetGlobalScheduler(blocking)

Releases all resources held by the global scheduler instance.

It is not thread-safe to call this function while calling Highs_run or one of the Highs_XXXcall methods on any other Highs instance in any thread.

After this function has terminated, it is guaranteed that eventually all previously created scheduler threads will terminate and allocated memory will be released.

After this function has returned, the option value for the number of threads may be altered to a new value before the next call to Highs_run or one of the Highs_XXXcall methods.

Parameters

  • blocking: If the blocking parameter has a nonzero value, then this function will not return until all memory is freed, which might be desirable when debugging heap memory, but it requires the calling thread to wait for all scheduler threads to wake-up which is usually not necessary.

Returns

No status is returned since the function call cannot fail. Calling this function while any Highs instance is in use on any thread is undefined behavior and may cause crashes, but cannot be detected and hence is fully in the callers responsibility.

source
Highs_resetOptionsMethod
Highs_resetOptions(highs)

Reset all options to their default value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_runMethod
Highs_run(highs)

Optimize a model. The algorithm used by HiGHS depends on the options that have been set.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleColMethod
Highs_scaleCol(highs, col, scaleval)

Scale a column by a constant.

Scaling a column modifies the elements in the constraint matrix, the variable bounds, and the objective coefficient.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to scale.
  • scaleval: The value by which to scale the column. If scaleval < 0, the variable bounds flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleRowMethod
Highs_scaleRow(highs, row, scaleval)

Scale a row by a constant.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to scale.
  • scaleval: The value by which to scale the row. If scaleval < 0, the row bounds are flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBasisMethod
Highs_setBasis(highs, col_status, row_status)

Set a basic feasible solution by passing the column and row basis statuses to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • col_status: an array of length [num_col] with the column basis status in the form of kHighsBasisStatus constants
  • row_status: an array of length [num_row] with the row basis status in the form of kHighsBasisStatus constants

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBoolOptionValueMethod
Highs_setBoolOptionValue(highs, option, value)

Set a boolean-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setCallbackMethod
Highs_setCallback(highs, user_callback, user_callback_data)

Set the callback method to use for HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • user_callback: A pointer to the user callback
  • user_callback_data: A pointer to the user callback data

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setDoubleOptionValueMethod
Highs_setDoubleOptionValue(highs, option, value)

Set a double-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setIntOptionValueMethod
Highs_setIntOptionValue(highs, option, value)

Set an int-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setLogicalBasisMethod
Highs_setLogicalBasis(highs)

Set a logical basis in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSolutionMethod
Highs_setSolution(highs, col_value, row_value, col_dual, row_dual)

Set a solution by passing the column and row primal and dual solution values.

For any values that are unavailable, pass NULL.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • row_value: An array of length [num_row] with the row solution values.
  • col_dual: An array of length [num_col] with the column dual values.
  • row_dual: An array of length [num_row] with the row dual values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSparseSolutionMethod
Highs_setSparseSolution(highs, num_entries, index, value)

Set a partial primal solution by passing values for a set of variables

Parameters

  • highs: A pointer to the Highs instance.
  • num_entries: Number of variables in the set
  • index: Indices of variables in the set
  • value: Values of variables in the set

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setStringOptionValueMethod
Highs_setStringOptionValue(highs, option, value)

Set a string-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_startCallbackMethod
Highs_startCallback(highs, callback_type)

Start callback of given type

Parameters

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be started

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_stopCallbackMethod
Highs_stopCallback(highs, callback_type)

Stop callback of given type

Parameters

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be stopped

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_versionMethod
Highs_version()

Return the HiGHS version number as a string of the form "vX.Y.Z".

Returns

The HiGHS version as a char*.

source
Highs_versionMajorMethod
Highs_versionMajor()

Return the HiGHS major version number.

Returns

The HiGHS major version number.

source
Highs_versionMinorMethod
Highs_versionMinor()

Return the HiGHS minor version number.

Returns

The HiGHS minor version number.

source
Highs_versionPatchMethod
Highs_versionPatch()

Return the HiGHS patch version number.

Returns

The HiGHS patch version number.

source
Highs_writeModelMethod
Highs_writeModel(highs, filename)

Write the model in highs to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsMethod
Highs_writeOptions(highs, filename)

Write the current options to file.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsDeviationsMethod
Highs_writeOptionsDeviations(highs, filename)

Write the value of non-default options to file.

This is similar to Highs_writeOptions, except only options with non-default value are written to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writePresolvedModelMethod
Highs_writePresolvedModel(highs, filename)

Write the presolved model in highs to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionMethod
Highs_writeSolution(highs, filename)

Write the solution information (including dual and basis status, if available) to a file.

See also: Highs_writeSolutionPretty.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionPrettyMethod
Highs_writeSolutionPretty(highs, filename)

Write the solution information (including dual and basis status, if available) to a file in a human-readable format.

The method identical to Highs_writeSolution, except that the printout is in a human-readable format.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_zeroAllClocksMethod
Highs_zeroAllClocks(highs)

Reset the clocks in a highs model.

Each highs model contains a single instance of clock that records how much time is spent in various parts of the algorithm. This clock is not reset on entry to Highs_run, so repeated calls to Highs_run report the cumulative time spent in the algorithm. A side-effect is that this will trigger a time limit termination once the cumulative run time exceeds the time limit, rather than the run time of each individual call to Highs_run.

As a work-around, call Highs_zeroAllClocks before each call to Highs_run.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
+C · HiGHS Documentation

C

Highs_addColMethod
Highs_addCol(highs, cost, lower, upper, num_new_nz, index, value)

Add a new column (variable) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • cost: The objective coefficient of the column.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.
  • num_new_nz: The number of non-zeros in the column.
  • index: An array of size [num_new_nz] with the row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addColsMethod
Highs_addCols(highs, num_new_col, costs, lower, upper, num_new_nz, starts, index, value)

Add multiple columns (variables) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_col: The number of new columns to add.
  • costs: An array of size [num_new_col] with objective coefficients.
  • lower: An array of size [num_new_col] with lower bounds.
  • upper: An array of size [num_new_col] with upper bounds.
  • num_new_nz: The number of new nonzeros in the constraint matrix.
  • starts: The constraint coefficients are given as a matrix in compressed sparse column form by the arrays starts, index, and value. starts is an array of size [num_new_cols] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with row indices.
  • value: An array of size [num_new_nz] with row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addLinearObjectiveMethod
Highs_addLinearObjective(highs, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Adds linear objective data to HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • weight: The weight of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: The objective offset
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: The absolute tolerance used when constructing an objective constraint during lexicographic optimization
  • rel_tolerance: The relative tolerance used when constructing an objective constraint during lexicographic optimization
  • priority: The priority of this objective during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRowMethod
Highs_addRow(highs, lower, upper, num_new_nz, index, value)

Add a new row (a linear constraint) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the row.
  • upper: The upper bound of the row.
  • num_new_nz: The number of non-zeros in the row
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addRowsMethod
Highs_addRows(highs, num_new_row, lower, upper, num_new_nz, starts, index, value)

Add multiple rows (linear constraints) to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_row: The number of new rows to add
  • lower: An array of size [num_new_row] with the lower bounds of the rows.
  • upper: An array of size [num_new_row] with the upper bounds of the rows.
  • num_new_nz: The number of non-zeros in the rows.
  • starts: The constraint coefficients are given as a matrix in compressed sparse row form by the arrays starts, index, and value. starts is an array of size [num_new_rows] with the start index of each row in indices and values.
  • index: An array of size [num_new_nz] with column indices.
  • value: An array of size [num_new_nz] with column values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVarMethod
Highs_addVar(highs, lower, upper)

Add a new variable to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • lower: The lower bound of the column.
  • upper: The upper bound of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_addVarsMethod
Highs_addVars(highs, num_new_var, lower, upper)

Add multiple variables to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • num_new_var: The number of new variables to add.
  • lower: An array of size [num_new_var] with lower bounds.
  • upper: An array of size [num_new_var] with upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeCoeffMethod
Highs_changeCoeff(highs, row, col, value)

Change a coefficient in the constraint matrix.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to change.
  • col: The index of the column to change.
  • value: The new constraint coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColBoundsMethod
Highs_changeColBounds(highs, col, lower, upper)

Change the variable bounds of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColCostMethod
Highs_changeColCost(highs, col, cost)

Change the objective coefficient of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column fo change.
  • cost: The new objective coefficient.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColIntegralityMethod
Highs_changeColIntegrality(highs, col, integrality)

Change the integrality of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The column index to change.
  • integrality: The new integrality of the column in the form of a kHighsVarType constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByMaskMethod
Highs_changeColsBoundsByMask(highs, mask, lower, upper)

Change the variable bounds of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column bounds should be changed and 0 otherwise.
  • lower: An array of length [num_col] with the new lower bounds.
  • upper: An array of length [num_col] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsByRangeMethod
Highs_changeColsBoundsByRange(highs, from_col, to_col, lower, upper)

Change the variable bounds of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose bound changes.
  • to_col: The index of the last column whose bound changes.
  • lower: An array of length [to_col - from_col + 1] with the new lower bounds.
  • upper: An array of length [to_col - from_col + 1] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsBoundsBySetMethod
Highs_changeColsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByMaskMethod
Highs_changeColsCostByMask(highs, mask, cost)

Change the cost of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column cost should be changed and 0 otherwise.
  • cost: An array of length [num_col] with the new costs.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostByRangeMethod
Highs_changeColsCostByRange(highs, from_col, to_col, cost)

Change the cost coefficients of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose cost changes.
  • to_col: The index of the last column whose cost changes.
  • cost: An array of length [to_col - from_col + 1] with the new objective coefficients.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsCostBySetMethod
Highs_changeColsCostBySet(highs, num_set_entries, set, cost)

Change the cost of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • cost: An array of length [num_set_entries] with the new costs of the columns.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByMaskMethod
Highs_changeColsIntegralityByMask(highs, mask, integrality)

Change the integrality of multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column integrality should be changed and 0 otherwise.
  • integrality: An array of length [num_col] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityByRangeMethod
Highs_changeColsIntegralityByRange(highs, from_col, to_col, integrality)

Change the integrality of multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column whose integrality changes.
  • to_col: The index of the last column whose integrality changes.
  • integrality: An array of length [to_col - from_col + 1] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeColsIntegralityBySetMethod
Highs_changeColsIntegralityBySet(highs, num_set_entries, set, integrality)

Change the integrality of multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to change.
  • set: An array of size [num_set_entries] with the indices of the columns to change.
  • integrality: An array of length [num_set_entries] with the new integralities of the columns in the form of kHighsVarType constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveOffsetMethod
Highs_changeObjectiveOffset(highs, offset)

Change the objective offset of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • offset: The new objective offset.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeObjectiveSenseMethod
Highs_changeObjectiveSense(highs, sense)

Change the objective sense of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • sense: The new optimization sense in the form of a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowBoundsMethod
Highs_changeRowBounds(highs, row, lower, upper)

Change the bounds of a row.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row whose bounds are to change.
  • lower: The new lower bound.
  • upper: The new upper bound.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsByMaskMethod
Highs_changeRowsBoundsByMask(highs, mask, lower, upper)

Change the bounds of multiple rows given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row bounds should be changed and 0 otherwise.
  • lower: An array of length [num_row] with the new lower bounds.
  • upper: An array of length [num_row] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_changeRowsBoundsBySetMethod
Highs_changeRowsBoundsBySet(highs, num_set_entries, set, lower, upper)

Change the bounds of multiple rows given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to change.
  • set: An array of size [num_set_entries] with the indices of the rows to change.
  • lower: An array of length [num_set_entries] with the new lower bounds.
  • upper: An array of length [num_set_entries] with the new upper bounds.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearMethod
Highs_clear(highs)

Reset the options and then call clearModel.

See Highs_destroy to free all associated memory.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearIntegralityMethod
Highs_clearIntegrality(highs)

Clear the integrality of all columns

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearLinearObjectivesMethod
Highs_clearLinearObjectives(highs)

Clears any multiple linear objective data in HiGHS

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearModelMethod
Highs_clearModel(highs)

Remove all variables and constraints from the model highs, but do not invalidate the pointer highs. Future calls (for example, adding new variables and constraints) are allowed.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_clearSolverMethod
Highs_clearSolver(highs)

Clear all solution data associated with the model.

See Highs_destroy to clear the model and free all associated memory.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_createMethod
Highs_create()

Create a Highs instance and return the reference.

Call Highs_destroy on the returned reference to clean up allocated memory.

Returns

A pointer to the Highs instance.

source
Highs_crossoverMethod
Highs_crossover(highs, num_col, num_row, col_value, col_dual, row_dual)

Set a primal (and possibly dual) solution as a starting point, then run crossover to compute a basic feasible solution.

Parameters

  • highs: A pointer to the Highs instance.
  • num_col: The number of variables.
  • num_row: The number of rows.
  • col_value: An array of length [num_col] with optimal primal solution for each column.
  • col_dual: An array of length [num_col] with optimal dual solution for each column. May be NULL, in which case no dual solution is passed.
  • row_dual: An array of length [num_row] with optimal dual solution for each row. . May be NULL, in which case no dual solution is passed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByMaskMethod
Highs_deleteColsByMask(highs, mask)

Delete multiple columns given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_col] with 1 if the column should be deleted and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsByRangeMethod
Highs_deleteColsByRange(highs, from_col, to_col)

Delete multiple adjacent columns.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The index of the first column to delete.
  • to_col: The index of the last column to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteColsBySetMethod
Highs_deleteColsBySet(highs, num_set_entries, set)

Delete multiple columns given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of columns to delete.
  • set: An array of size [num_set_entries] with the indices of the columns to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByMaskMethod
Highs_deleteRowsByMask(highs, mask)

Delete multiple rows given by a mask.

Parameters

  • highs: A pointer to the Highs instance.
  • mask: An array of length [num_row] with 1 if the row should be deleted and 0 otherwise. The new index of any column not deleted is stored in place of the value 0.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsByRangeMethod
Highs_deleteRowsByRange(highs, from_row, to_row)

Delete multiple adjacent rows.

Parameters

  • highs: A pointer to the Highs instance.
  • from_row: The index of the first row to delete.
  • to_row: The index of the last row to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_deleteRowsBySetMethod
Highs_deleteRowsBySet(highs, num_set_entries, set)

Delete multiple rows given by an array of indices.

Parameters

  • highs: A pointer to the Highs instance.
  • num_set_entries: The number of rows to delete.
  • set: An array of size [num_set_entries] with the indices of the rows to delete.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_destroyMethod
Highs_destroy(highs)

Destroy the model highs created by Highs_create and free all corresponding memory. Future calls using highs are not allowed.

To empty a model without invalidating highs, see Highs_clearModel.

Parameters

  • highs: A pointer to the Highs instance.
source
Highs_ensureColwiseMethod
Highs_ensureColwise(highs)

Ensure that the constraint matrix of the incumbent model is stored column-wise.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_ensureRowwiseMethod
Highs_ensureRowwise(highs)

Ensure that the constraint matrix of the incumbent model is stored row-wise.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_feasibilityRelaxationMethod
Highs_feasibilityRelaxation(highs, global_lower_penalty, global_upper_penalty, global_rhs_penalty, local_lower_penalty, local_upper_penalty, local_rhs_penalty)

Compute the solution corresponding to a (possibly weighted) sum of (allowable) infeasibilities in an LP/MIP.

If local penalties are not defined, pass NULL, and the global penalty will be used. Negative penalty values imply that the bound or RHS value cannot be violated

Parameters

  • highs: A pointer to the Highs instance.
  • const: double global_lower_penalty The penalty for violating lower bounds on variables
  • const: double global_upper_penalty The penalty for violating upper bounds on variables
  • const: double global_rhs_penalty The penalty for violating constraint RHS values
  • const: double* local_lower_penalty The penalties for violating specific lower bounds on variables
  • const: double* local_upper_penalty The penalties for violating specific upper bounds on variables
  • const: double* local_rhs_penalty The penalties for violating specific constraint RHS values

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasicVariablesMethod
Highs_getBasicVariables(highs, basic_variables)

Get the indices of the rows and columns that make up the basis matrix $B$ of a basic feasible solution.

Non-negative entries are indices of columns, and negative entries are -row\_index - 1. For example, {1, -1} would be the second column and first row.

The order of these rows and columns is important for calls to the functions:

Parameters

  • highs: A pointer to the Highs instance.
  • basic_variables: An array of size [num_rows], filled with the indices of the basic variables.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisMethod
Highs_getBasis(highs, col_status, row_status)

Given a linear program with a basic feasible solution, get the column and row basis statuses.

Parameters

  • highs: A pointer to the Highs instance.
  • col_status: An array of length [num_col], to be filled with the column basis statuses in the form of a kHighsBasisStatus constant.
  • row_status: An array of length [num_row], to be filled with the row basis statuses in the form of a kHighsBasisStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseColMethod
Highs_getBasisInverseCol(highs, col, col_vector, col_num_nz, col_index)

Get a column of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisInverseRowMethod
Highs_getBasisInverseRow(highs, row, row_vector, row_num_nz, row_index)

Get a row of the inverse basis matrix $B^{-1}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisSolveMethod
Highs_getBasisSolve(highs, rhs, solution_vector, solution_num_nz, solution_index)

Compute ${x}=B^{-1}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$.
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBasisTransposeSolveMethod
Highs_getBasisTransposeSolve(highs, rhs, solution_vector, solution_nz, solution_index)

Compute ${x}=B^{-T}{b}$ for a given vector ${b}$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays solution_vector and solution_index must have an allocated length of [num_row]. However, check solution_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • rhs: The right-hand side vector $b$
  • solution_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • solution_num_nz: The number of non-zeros in the solution.
  • solution_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValueMethod
Highs_getBoolOptionValue(highs, option, value)

Get a boolean-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getBoolOptionValuesMethod
Highs_getBoolOptionValues(highs, option, current_value, default_value)

Get the current and default values of a bool option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getCallbackDataOutItemMethod
Highs_getCallbackDataOutItem(data_out, item_name)

Get a void* pointer to a callback data item

Parameters

Returns

A void* pointer to the callback data item, or NULL if item_name not valid

source
Highs_getColByNameMethod
Highs_getColByName(highs, name, col)

Get the index of a column from its name.

If multiple columns have the same name, or if no column exists with name, this function returns kHighsStatusError.

Parameters

  • name: A pointer of the name of the column to query.
  • col: A pointer in which to store the index of the column

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColIntegralityMethod
Highs_getColIntegrality(highs, col, integrality)

Get the integrality of a column.

Parameters

  • col: The index of the column to query.
  • integrality: An integer in which the integrality of the column should be placed. The integer is one of the kHighsVarTypeXXX constants.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColNameMethod
Highs_getColName(highs, col, name)

Get the name of a column.

Parameters

  • col: The index of the column to query.
  • name: A pointer in which to store the name of the column. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByMaskMethod
Highs_getColsByMask(highs, mask, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by a mask.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Parameters

  • mask: An array of length [num_col] containing a 1 to get the column and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsByRangeMethod
Highs_getColsByRange(highs, from_col, to_col, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent columns from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Parameters

  • highs: A pointer to the Highs instance.
  • from_col: The first column for which to query data for.
  • to_col: The last column (inclusive) for which to query data for.
  • num_col: An integer populated with the number of columns got from the model (this should equal to\_col - from\_col + 1).
  • costs: An array of size [to_col - from_col + 1] for the column cost coefficients.
  • lower: An array of size [to_col - from_col + 1] for the column lower bounds.
  • upper: An array of size [to_col - from_col + 1] for the column upper bounds.
  • num_nz: An integer to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_col - from_col + 1] with the start indices of each column in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the row indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getColsBySetMethod
Highs_getColsBySet(highs, num_set_entries, set, num_col, costs, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple columns given by an array.

This function is identical to Highs_getColsByRange, except for how the columns are specified.

Parameters

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] with the column indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleInfoValueMethod
Highs_getDoubleInfoValue(highs, info, value)

Get a double-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to a double that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValueMethod
Highs_getDoubleOptionValue(highs, option, value)

Get a double-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDoubleOptionValuesMethod
Highs_getDoubleOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of a double option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualRayMethod
Highs_getDualRay(highs, has_dual_ray, dual_ray_value)

Indicates whether a dual ray that is a certificate of primal infeasibility currently exists, and (at the expense of solving an LP) gets it if it does not and dual_ray_value is not nullptr.

Parameters

  • highs: A pointer to the Highs instance.
  • has_dual_ray: A pointer to an int to store 1 if a dual ray currently exists.
  • dual_ray_value: An array of length [num_row] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getDualUnboundednessDirectionMethod
Highs_getDualUnboundednessDirection(highs, has_dual_unboundedness_direction, dual_unboundedness_direction_value)

Indicates whether a dual unboundedness direction (corresponding to a certificate of primal infeasibility) exists, and (at the expense of solving an LP) gets it if it does not and dual_unboundedness_direction is not nullptr

Parameters

  • highs: A pointer to the Highs instance.
  • has_dual_unboundedness_direction: A pointer to an int to store 1 if the dual unboundedness direction exists.
  • dual_unboundedness_direction_value: An array of length [num_col] filled with the unboundedness direction.
source
Highs_getHessianNumNzMethod
Highs_getHessianNumNz(highs)

Return the number of nonzeroes in the Hessian matrix of the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeroes in the Hessian matrix of the model.

source
Highs_getInfinityMethod
Highs_getInfinity(highs)

Return the value of infinity used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The value of infinity used by HiGHS.

source
Highs_getInfoTypeMethod
Highs_getInfoType(highs, info, type)

Get the type expected by an info item.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • type: An int in which the corresponding kHighsOptionType constant is stored.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getInt64InfoValueMethod
Highs_getInt64InfoValue(highs, info, value)

Get an int64-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an int64 that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntInfoValueMethod
Highs_getIntInfoValue(highs, info, value)

Get an int-valued info value.

Parameters

  • highs: A pointer to the Highs instance.
  • info: The name of the info item.
  • value: A reference to an integer that the result will be stored in.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValueMethod
Highs_getIntOptionValue(highs, option, value)

Get an int-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The location in which the current value of the option should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getIntOptionValuesMethod
Highs_getIntOptionValues(highs, option, current_value, min_value, max_value, default_value)

Get the current and default values of an int option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • min_value: A pointer to the minimum value of the option.
  • max_value: A pointer to the maximum value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getLpMethod
Highs_getLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModelMethod
Highs_getModel(highs, a_format, q_format, num_col, num_row, num_nz, hessian_num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Get the data from a HiGHS model.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getNumCol - Highs_getNumRow - Highs_getNumNz - Highs_getHessianNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getModelStatusMethod
Highs_getModelStatus(highs)

Return the optimization status of the model in the form of a kHighsModelStatus constant.

Parameters

  • highs: A pointer to the Highs instance.

Returns

An integer corresponding to the kHighsModelStatus constant

source
Highs_getNumColMethod
Highs_getNumCol(highs)

Return the number of columns in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the model.

source
Highs_getNumNzMethod
Highs_getNumNz(highs)

Return the number of nonzeros in the constraint matrix of the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the model.

source
Highs_getNumOptionsMethod
Highs_getNumOptions(highs)

Return the number of options

Parameters

  • highs: A pointer to the Highs instance.
source
Highs_getNumRowMethod
Highs_getNumRow(highs)

Return the number of rows in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the model.

source
Highs_getObjectiveOffsetMethod
Highs_getObjectiveOffset(highs, offset)

Get the objective offset.

Parameters

  • highs: A pointer to the Highs instance.
  • offset: The location in which the current objective offset should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveSenseMethod
Highs_getObjectiveSense(highs, sense)

Get the objective sense.

Parameters

  • highs: A pointer to the Highs instance.
  • sense: The location in which the current objective sense should be placed. The sense is a kHighsObjSense constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getObjectiveValueMethod
Highs_getObjectiveValue(highs)

Get the primal objective function value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The primal objective function value

source
Highs_getOptionNameMethod
Highs_getOptionName(highs, index, name)

Get the name of an option identified by index

Parameters

  • highs: A pointer to the Highs instance.
  • index: The index of the option.
  • name: The name of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getOptionTypeMethod
Highs_getOptionType(highs, option, type)

Get the type expected by an option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • type: An int in which the corresponding kHighsOptionType constant should be placed.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedLpMethod
Highs_getPresolvedLp(highs, a_format, num_col, num_row, num_nz, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Get the data from a HiGHS presolved LP.

The input arguments have the same meaning (in a different order) to those used in Highs_passModel.

Note that all arrays must be pre-allocated to the correct size before calling Highs_getModel. Use the following query methods to check the appropriate size: - Highs_getPresolvedNumCol - Highs_getPresolvedNumRow - Highs_getPresolvedNumNz

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getPresolvedNumColMethod
Highs_getPresolvedNumCol(highs)

Return the number of columns in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of columns in the presolved model.

source
Highs_getPresolvedNumNzMethod
Highs_getPresolvedNumNz(highs)

Return the number of nonzeros in the constraint matrix of the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of nonzeros in the constraint matrix of the presolved model.

source
Highs_getPresolvedNumRowMethod
Highs_getPresolvedNumRow(highs)

Return the number of rows in the presolved model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The number of rows in the presolved model.

source
Highs_getPrimalRayMethod
Highs_getPrimalRay(highs, has_primal_ray, primal_ray_value)

Indicates whether a primal ray that is a certificate of primal unboundedness currently exists, and (at the expense of solving an LP) gets it if it does not and primal_ray_value is not nullptr.

Parameters

  • highs: A pointer to the Highs instance.
  • has_primal_ray: A pointer to an int to store 1 if the primal ray exists.
  • primal_ray_value: An array of length [num_col] filled with the unbounded ray.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRangingMethod
Highs_getRanging(highs, col_cost_up_value, col_cost_up_objective, col_cost_up_in_var, col_cost_up_ou_var, col_cost_dn_value, col_cost_dn_objective, col_cost_dn_in_var, col_cost_dn_ou_var, col_bound_up_value, col_bound_up_objective, col_bound_up_in_var, col_bound_up_ou_var, col_bound_dn_value, col_bound_dn_objective, col_bound_dn_in_var, col_bound_dn_ou_var, row_bound_up_value, row_bound_up_objective, row_bound_up_in_var, row_bound_up_ou_var, row_bound_dn_value, row_bound_dn_objective, row_bound_dn_in_var, row_bound_dn_ou_var)

Compute the ranging information for all costs and bounds. For nonbasic variables the ranging information is relative to the active bound. For basic variables the ranging information relates to...

For any values that are not required, pass NULL.

Parameters

  • highs: A pointer to the Highs instance.
  • col_cost_up_value: The upper range of the cost value
  • col_cost_up_objective: The objective at the upper cost range
  • col_cost_up_in_var: The variable entering the basis at the upper cost range
  • col_cost_up_ou_var: The variable leaving the basis at the upper cost range
  • col_cost_dn_value: The lower range of the cost value
  • col_cost_dn_objective: The objective at the lower cost range
  • col_cost_dn_in_var: The variable entering the basis at the lower cost range
  • col_cost_dn_ou_var: The variable leaving the basis at the lower cost range
  • col_bound_up_value: The upper range of the column bound value
  • col_bound_up_objective: The objective at the upper column bound range
  • col_bound_up_in_var: The variable entering the basis at the upper column bound range
  • col_bound_up_ou_var: The variable leaving the basis at the upper column bound range
  • col_bound_dn_value: The lower range of the column bound value
  • col_bound_dn_objective: The objective at the lower column bound range
  • col_bound_dn_in_var: The variable entering the basis at the lower column bound range
  • col_bound_dn_ou_var: The variable leaving the basis at the lower column bound range
  • row_bound_up_value: The upper range of the row bound value
  • row_bound_up_objective: The objective at the upper row bound range
  • row_bound_up_in_var: The variable entering the basis at the upper row bound range
  • row_bound_up_ou_var: The variable leaving the basis at the upper row bound range
  • row_bound_dn_value: The lower range of the row bound value
  • row_bound_dn_objective: The objective at the lower row bound range
  • row_bound_dn_in_var: The variable entering the basis at the lower row bound range
  • row_bound_dn_ou_var: The variable leaving the basis at the lower row bound range

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedColumnMethod
Highs_getReducedColumn(highs, col, col_vector, col_num_nz, col_index)

Compute a column of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays col_vector and col_index must have an allocated length of [num_row]. However, check col_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to compute.
  • col_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • col_num_nz: The number of non-zeros in the column.
  • col_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getReducedRowMethod
Highs_getReducedRow(highs, row, row_vector, row_num_nz, row_index)

Compute a row of $B^{-1}A$.

See Highs_getBasicVariables for a description of the $B$ matrix.

The arrays row_vector and row_index must have an allocated length of [num_row]. However, check row_num_nz to see how many non-zero elements are actually stored.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to compute.
  • row_vector: An array of length [num_row] in which to store the values of the non-zero elements.
  • row_num_nz: The number of non-zeros in the row.
  • row_index: An array of length [num_row] in which to store the indices of the non-zero elements.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowByNameMethod
Highs_getRowByName(highs, name, row)

Get the index of a row from its name.

If multiple rows have the same name, or if no row exists with name, this function returns kHighsStatusError.

Parameters

  • name: A pointer of the name of the row to query.
  • row: A pointer in which to store the index of the row

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowNameMethod
Highs_getRowName(highs, row, name)

Get the name of a row.

Parameters

  • row: The index of the row to query.
  • name: A pointer in which to store the name of the row. This must have length kHighsMaximumStringLength.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByMaskMethod
Highs_getRowsByMask(highs, mask, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by a mask.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Parameters

  • mask: An array of length [num_row] containing a 1 to get the row and 0 otherwise.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsByRangeMethod
Highs_getRowsByRange(highs, from_row, to_row, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple adjacent rows from the model.

To query the constraint coefficients, this function should be called twice.

First, call this function with matrix_start, matrix_index, and matrix_value as NULL. This call will populate num_nz with the number of nonzero elements in the corresponding section of the constraint matrix.

Second, allocate new matrix_index and matrix_value arrays of length num_nz and call this function again to populate the new arrays with their contents.

Parameters

  • highs: A pointer to the Highs instance.
  • from_row: The first row for which to query data for.
  • to_row: The last row (inclusive) for which to query data for.
  • num_row: An integer to be populated with the number of rows got from the smodel.
  • lower: An array of size [to_row - from_row + 1] for the row lower bounds.
  • upper: An array of size [to_row - from_row + 1] for the row upper bounds.
  • num_nz: An integer to be populated with the number of non-zero elements in the constraint matrix.
  • matrix_start: An array of size [to_row - from_row + 1] with the start indices of each row in matrix_index and matrix_value.
  • matrix_index: An array of size [num_nz] with the column indices of each element in the constraint matrix.
  • matrix_value: An array of size [num_nz] with the non-zero elements of the constraint matrix.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRowsBySetMethod
Highs_getRowsBySet(highs, num_set_entries, set, num_row, lower, upper, num_nz, matrix_start, matrix_index, matrix_value)

Get data associated with multiple rows given by an array.

This function is identical to Highs_getRowsByRange, except for how the rows are specified.

Parameters

  • num_set_indices: The number of indices in set.
  • set: An array of size [num_set_entries] containing the row indices to get.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getRunTimeMethod
Highs_getRunTime(highs)

Return the cumulative wall-clock time spent in Highs_run.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The cumulative wall-clock time spent in Highs_run

source
Highs_getSizeofHighsIntMethod
Highs_getSizeofHighsInt(highs)

Return the size of integers used by HiGHS.

Parameters

  • highs: A pointer to the Highs instance.

Returns

The size of integers used by HiGHS.

source
Highs_getSolutionMethod
Highs_getSolution(highs, col_value, col_dual, row_value, row_dual)

Get the primal and dual solution from an optimized model.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col], to be filled with primal column values.
  • col_dual: An array of length [num_col], to be filled with dual column values.
  • row_value: An array of length [num_row], to be filled with primal row values.
  • row_dual: An array of length [num_row], to be filled with dual row values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValueMethod
Highs_getStringOptionValue(highs, option, value)

Get a string-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: A pointer to allocated memory (of at least kMaximumStringLength) to store the current value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_getStringOptionValuesMethod
Highs_getStringOptionValues(highs, option, current_value, default_value)

Get the current and default values of a string option

Parameters

  • highs: A pointer to the Highs instance.
  • current_value: A pointer to the current value of the option.
  • default_value: A pointer to the default value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_githashMethod
Highs_githash()

Return the HiGHS githash.

Returns

The HiGHS githash.

source
Highs_lpCallMethod
Highs_lpCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a linear program using HiGHS.

Parameters

  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of nonzeros in the constraint matrix.
  • a_format: The format of the constraint matrix as a kHighsMatrixFormat constant.
  • sense: The optimization sense as a kHighsObjSense constant.
  • offset: The objective constant.
  • col_cost: An array of length [num_col] with the column costs.
  • col_lower: An array of length [num_col] with the column lower bounds.
  • col_upper: An array of length [num_col] with the column upper bounds.
  • row_lower: An array of length [num_row] with the row lower bounds.
  • row_upper: An array of length [num_row] with the row upper bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • col_value: An array of length [num_col], to be filled with the primal column solution.
  • col_dual: An array of length [num_col], to be filled with the dual column solution.
  • row_value: An array of length [num_row], to be filled with the primal row solution.
  • row_dual: An array of length [num_row], to be filled with the dual row solution.
  • col_basis_status: An array of length [num_col], to be filled with the basis status of the columns in the form of a kHighsBasisStatus constant.
  • row_basis_status: An array of length [num_row], to be filled with the basis status of the rows in the form of a kHighsBasisStatus constant.
  • model_status: The location in which to place the termination status of the model after the solve in the form of a kHighsModelStatus constant.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_mipCallMethod
Highs_mipCall(num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality, col_value, row_value, model_status)

Formulate and solve a mixed-integer linear program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has an additional integrality argument, and that it is missing the col_dual, row_dual, col_basis_status and row_basis_status arguments.

Parameters

  • integrality: An array of length [num_col], containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passColNameMethod
Highs_passColName(highs, col, name)

Pass the name of a column.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The column for which the name is supplied.
  • name: The name of the column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passHessianMethod
Highs_passHessian(highs, dim, num_nz, format, start, index, value)

Set the Hessian matrix for a quadratic objective.

Parameters

  • highs: A pointer to the Highs instance.
  • dim: The dimension of the Hessian matrix. Should be [num_col].
  • num_nz: The number of non-zero elements in the Hessian matrix.
  • format: The format of the Hessian matrix as a kHighsHessianFormat constant. This must be kHighsHessianFormatTriangular.
  • start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form), using q_start, q_index, and q_value.The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form. The sparse matrix consists of three arrays, start, index, and value. start is an array of length [num_col] containing the starting index of each column in index.
  • index: An array of length [num_nz] with indices of matrix entries.
  • value: An array of length [num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLinearObjectivesMethod
Highs_passLinearObjectives(highs, num_linear_objective, weight, offset, coefficients, abs_tolerance, rel_tolerance, priority)

Passes multiple linear objective data to HiGHS, clearing any such data already in HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • weight: A pointer to the weights of the linear objective, with its positive/negative sign determining whether it is minimized or maximized during lexicographic optimization
  • offset: A pointer to the objective offsets
  • coefficients: A pointer to the objective coefficients
  • abs_tolerance: A pointer to the absolute tolerances used when constructing objective constraints during lexicographic optimization
  • rel_tolerance: A pointer to the relative tolerances used when constructing objective constraints during lexicographic optimization
  • priority: A pointer to the priorities of the objectives during lexicographic optimization

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passLpMethod
Highs_passLp(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value)

Pass a linear program (LP) to HiGHS in a single function call.

The signature of this function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program and the integrality vector.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passMipMethod
Highs_passMip(highs, num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality)

Pass a mixed-integer linear program (MILP) to HiGHS in a single function call.

The signature of function is identical to Highs_passModel, without the arguments for passing the Hessian matrix of a quadratic program.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModelMethod
Highs_passModel(highs, num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, integrality)

Pass a model to HiGHS in a single function call. This is faster than constructing the model using Highs_addRow and Highs_addCol.

Parameters

  • highs: A pointer to the Highs instance.
  • num_col: The number of columns.
  • num_row: The number of rows.
  • num_nz: The number of elements in the constraint matrix.
  • q_num_nz: The number of elements in the Hessian matrix.
  • a_format: The format of the constraint matrix to use in the form of a kHighsMatrixFormat constant.
  • q_format: The format of the Hessian matrix to use in the form of a kHighsHessianFormat constant.
  • sense: The optimization sense in the form of a kHighsObjSense constant.
  • offset: The constant term in the objective function.
  • col_cost: An array of length [num_col] with the objective coefficients.
  • col_lower: An array of length [num_col] with the lower column bounds.
  • col_upper: An array of length [num_col] with the upper column bounds.
  • row_lower: An array of length [num_row] with the upper row bounds.
  • row_upper: An array of length [num_row] with the upper row bounds.
  • a_start: The constraint matrix is provided to HiGHS in compressed sparse column form (if a_format is kHighsMatrixFormatColwise, otherwise compressed sparse row form). The sparse matrix consists of three arrays, a_start, a_index, and a_value. a_start is an array of length [num_col] containing the starting index of each column in a_index. If a_format is kHighsMatrixFormatRowwise the array is of length [num_row] corresponding to each row.
  • a_index: An array of length [num_nz] with indices of matrix entries.
  • a_value: An array of length [num_nz] with values of matrix entries.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col]. If the model is linear, pass NULL.
  • q_index: An array of length [q_num_nz] with indices of matrix entries. If the model is linear, pass NULL.
  • q_value: An array of length [q_num_nz] with values of matrix entries. If the model is linear, pass NULL.
  • integrality: An array of length [num_col] containing a kHighsVarType constant for each column.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passModelNameMethod
Highs_passModelName(highs, name)

Pass the name of the model.

Parameters

  • highs: A pointer to the Highs instance.
  • name: The name of the model.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_passRowNameMethod
Highs_passRowName(highs, row, name)

Pass the name of a row.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The row for which the name is supplied.
  • name: The name of the row.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_postsolveMethod
Highs_postsolve(highs, col_value, col_dual, row_dual)

Postsolve a model using a primal (and possibly dual) solution.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • col_dual: An array of length [num_col] with the column dual values, or a null pointer if not known.
  • row_dual: An array of length [num_row] with the row dual values, or a null pointer if not known.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_presolveMethod
Highs_presolve(highs)

Presolve a model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_qpCallMethod
Highs_qpCall(num_col, num_row, num_nz, q_num_nz, a_format, q_format, sense, offset, col_cost, col_lower, col_upper, row_lower, row_upper, a_start, a_index, a_value, q_start, q_index, q_value, col_value, col_dual, row_value, row_dual, col_basis_status, row_basis_status, model_status)

Formulate and solve a quadratic program using HiGHS.

The signature of this method is identical to Highs_lpCall, except that it has additional arguments for specifying the Hessian matrix.

Parameters

  • q_num_nz: The number of nonzeros in the Hessian matrix.
  • q_format: The format of the Hessian matrix in the form of a kHighsHessianStatus constant. If q_num_nz > 0, this must be kHighsHessianFormatTriangular.
  • q_start: The Hessian matrix is provided to HiGHS as the lower triangular component in compressed sparse column form (or, equivalently, as the upper triangular component in compressed sparse row form). The sparse matrix consists of three arrays, q_start, q_index, and q_value. q_start is an array of length [num_col].
  • q_index: An array of length [q_num_nz] with indices of matrix entries.
  • q_value: An array of length [q_num_nz] with values of matrix entries.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readModelMethod
Highs_readModel(highs, filename)

Read a model from filename into highs.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to read.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_readOptionsMethod
Highs_readOptions(highs, filename)

Read the option values from file.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename from which to read the option values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_resetGlobalSchedulerMethod
Highs_resetGlobalScheduler(blocking)

Releases all resources held by the global scheduler instance.

It is not thread-safe to call this function while calling Highs_run or one of the Highs_XXXcall methods on any other Highs instance in any thread.

After this function has terminated, it is guaranteed that eventually all previously created scheduler threads will terminate and allocated memory will be released.

After this function has returned, the option value for the number of threads may be altered to a new value before the next call to Highs_run or one of the Highs_XXXcall methods.

Parameters

  • blocking: If the blocking parameter has a nonzero value, then this function will not return until all memory is freed, which might be desirable when debugging heap memory, but it requires the calling thread to wait for all scheduler threads to wake-up which is usually not necessary.

Returns

No status is returned since the function call cannot fail. Calling this function while any Highs instance is in use on any thread is undefined behavior and may cause crashes, but cannot be detected and hence is fully in the callers responsibility.

source
Highs_resetOptionsMethod
Highs_resetOptions(highs)

Reset all options to their default value.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_runMethod
Highs_run(highs)

Optimize a model. The algorithm used by HiGHS depends on the options that have been set.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleColMethod
Highs_scaleCol(highs, col, scaleval)

Scale a column by a constant.

Scaling a column modifies the elements in the constraint matrix, the variable bounds, and the objective coefficient.

Parameters

  • highs: A pointer to the Highs instance.
  • col: The index of the column to scale.
  • scaleval: The value by which to scale the column. If scaleval < 0, the variable bounds flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_scaleRowMethod
Highs_scaleRow(highs, row, scaleval)

Scale a row by a constant.

Parameters

  • highs: A pointer to the Highs instance.
  • row: The index of the row to scale.
  • scaleval: The value by which to scale the row. If scaleval < 0, the row bounds are flipped.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBasisMethod
Highs_setBasis(highs, col_status, row_status)

Set a basic feasible solution by passing the column and row basis statuses to the model.

Parameters

  • highs: A pointer to the Highs instance.
  • col_status: an array of length [num_col] with the column basis status in the form of kHighsBasisStatus constants
  • row_status: an array of length [num_row] with the row basis status in the form of kHighsBasisStatus constants

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setBoolOptionValueMethod
Highs_setBoolOptionValue(highs, option, value)

Set a boolean-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setCallbackMethod
Highs_setCallback(highs, user_callback, user_callback_data)

Set the callback method to use for HiGHS

Parameters

  • highs: A pointer to the Highs instance.
  • user_callback: A pointer to the user callback
  • user_callback_data: A pointer to the user callback data

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setDoubleOptionValueMethod
Highs_setDoubleOptionValue(highs, option, value)

Set a double-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setIntOptionValueMethod
Highs_setIntOptionValue(highs, option, value)

Set an int-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setLogicalBasisMethod
Highs_setLogicalBasis(highs)

Set a logical basis in the model.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSolutionMethod
Highs_setSolution(highs, col_value, row_value, col_dual, row_dual)

Set a solution by passing the column and row primal and dual solution values.

For any values that are unavailable, pass NULL.

Parameters

  • highs: A pointer to the Highs instance.
  • col_value: An array of length [num_col] with the column solution values.
  • row_value: An array of length [num_row] with the row solution values.
  • col_dual: An array of length [num_col] with the column dual values.
  • row_dual: An array of length [num_row] with the row dual values.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setSparseSolutionMethod
Highs_setSparseSolution(highs, num_entries, index, value)

Set a partial primal solution by passing values for a set of variables

Parameters

  • highs: A pointer to the Highs instance.
  • num_entries: Number of variables in the set
  • index: Indices of variables in the set
  • value: Values of variables in the set

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_setStringOptionValueMethod
Highs_setStringOptionValue(highs, option, value)

Set a string-valued option.

Parameters

  • highs: A pointer to the Highs instance.
  • option: The name of the option.
  • value: The new value of the option.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_startCallbackMethod
Highs_startCallback(highs, callback_type)

Start callback of given type

Parameters

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be started

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_stopCallbackMethod
Highs_stopCallback(highs, callback_type)

Stop callback of given type

Parameters

  • highs: A pointer to the Highs instance.
  • callback_type: The type of callback to be stopped

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_versionMethod
Highs_version()

Return the HiGHS version number as a string of the form "vX.Y.Z".

Returns

The HiGHS version as a char*.

source
Highs_versionMajorMethod
Highs_versionMajor()

Return the HiGHS major version number.

Returns

The HiGHS major version number.

source
Highs_versionMinorMethod
Highs_versionMinor()

Return the HiGHS minor version number.

Returns

The HiGHS minor version number.

source
Highs_versionPatchMethod
Highs_versionPatch()

Return the HiGHS patch version number.

Returns

The HiGHS patch version number.

source
Highs_writeModelMethod
Highs_writeModel(highs, filename)

Write the model in highs to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsMethod
Highs_writeOptions(highs, filename)

Write the current options to file.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeOptionsDeviationsMethod
Highs_writeOptionsDeviations(highs, filename)

Write the value of non-default options to file.

This is similar to Highs_writeOptions, except only options with non-default value are written to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write the options to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writePresolvedModelMethod
Highs_writePresolvedModel(highs, filename)

Write the presolved model in highs to filename.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The filename to write.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionMethod
Highs_writeSolution(highs, filename)

Write the solution information (including dual and basis status, if available) to a file.

See also: Highs_writeSolutionPretty.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_writeSolutionPrettyMethod
Highs_writeSolutionPretty(highs, filename)

Write the solution information (including dual and basis status, if available) to a file in a human-readable format.

The method identical to Highs_writeSolution, except that the printout is in a human-readable format.

Parameters

  • highs: A pointer to the Highs instance.
  • filename: The name of the file to write the results to.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
Highs_zeroAllClocksMethod
Highs_zeroAllClocks(highs)

Reset the clocks in a highs model.

Each highs model contains a single instance of clock that records how much time is spent in various parts of the algorithm. This clock is not reset on entry to Highs_run, so repeated calls to Highs_run report the cumulative time spent in the algorithm. A side-effect is that this will trigger a time limit termination once the cumulative run time exceeds the time limit, rather than the run time of each individual call to Highs_run.

As a work-around, call Highs_zeroAllClocks before each call to Highs_run.

Parameters

  • highs: A pointer to the Highs instance.

Returns

A kHighsStatus constant indicating whether the call succeeded.

source
diff --git a/previews/PR2119/interfaces/cpp/examples/index.html b/previews/PR2119/interfaces/cpp/examples/index.html index 44a2d5fbab..bf4e3c0284 100644 --- a/previews/PR2119/interfaces/cpp/examples/index.html +++ b/previews/PR2119/interfaces/cpp/examples/index.html @@ -1,2 +1,2 @@ -Examples · HiGHS Documentation

Example programs calling HiGHS from C, C++, C#, Fortran and Python are in HiGHS/examples.

+Examples · HiGHS Documentation

Example programs calling HiGHS from C, C++, C#, Fortran and Python are in HiGHS/examples.

diff --git a/previews/PR2119/interfaces/cpp/index.html b/previews/PR2119/interfaces/cpp/index.html index 18bdf542fb..279e368e6e 100644 --- a/previews/PR2119/interfaces/cpp/index.html +++ b/previews/PR2119/interfaces/cpp/index.html @@ -1,4 +1,4 @@ Getting started · HiGHS Documentation

Getting started

HiGHS can be cloned from GitHub with the command

git clone https://github.com/ERGO-Code/HiGHS.git

Building HiGHS from source code

HiGHS uses CMake (minimum version 3.15) as a build system, and can use the following compilers

  • Clang clang
  • GNU g++
  • Intel icc
  • Microsoft MSVC

Instructions for building HiGHS from source code are in HiGHS/cmake/README.md.

The simplest setup is to build HiGHS in a build directory within the root direcory. The name of the build folder is arbitrary but, assuming it is build, the sequence of commands is as follows

cd HiGHS
 cmake -S. -B build 
-cmake --build build --parallel
+cmake --build build --parallel diff --git a/previews/PR2119/interfaces/cpp/library/index.html b/previews/PR2119/interfaces/cpp/library/index.html index 64ec33092e..eb9be6242d 100644 --- a/previews/PR2119/interfaces/cpp/library/index.html +++ b/previews/PR2119/interfaces/cpp/library/index.html @@ -55,4 +55,4 @@ for (int col=0; col < lp.num_col_; col++) model.lp_.integrality_[col] = HighsVarType::kInteger; - highs.passModel(model); + highs.passModel(model); diff --git a/previews/PR2119/interfaces/csharp/index.html b/previews/PR2119/interfaces/csharp/index.html index 89c8993e7c..07d6009dad 100644 --- a/previews/PR2119/interfaces/csharp/index.html +++ b/previews/PR2119/interfaces/csharp/index.html @@ -1,2 +1,2 @@ -CSharp · HiGHS Documentation

CSharp

Build from source

There is a C# example code in examples/call_highs_from_csharp.cs. From the HiGHS root directory, run

cmake -S. -Bbuild -DCSHARP=ON

If a CSharp compiler is available, this builds the example using cmake and generates a binary in the build directory (build/bin/csharpexample).

NuGet

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.9.0

The nuget package contains runtime libraries for

  • win-x64
  • win-x32
  • linux-x64
  • linux-arm64
  • macos-x64
  • macos-arm64

Details for building locally can be found in nuget/README.md.

C# API

The C# API can be called directly. Here are observations on calling the HiGHS C# API from C#:

  • The file HiGHS/src/interfaces/highs_csharp_api.cs contains all the PInvoke you need.
  • Make sure, that the native HiGHS library (highs.dll, libhighs.dll, libhighs.so, ... depending on your platform) can be found at runtime. How to do this is platform dependent, copying it next to your C# executable should work in most cases. You can use msbuild for that. On linux, installing HiGHS system wide should work.
  • Make sure that all dependencies of the HiGHS library can be found, too. For example, if HiGHS was build using Visual C++ make sure that the MSVCRuntime is installed on the machine you want to run your application on.
  • Depending on the name of your HiGHS library, it might be necessary to change the constant "highslibname". See document on writing cross platform P/Invoke code if necessary.
  • Call the Methods in highs_csharp_api.cs and have fun with HiGHS.

This is the normal way to call plain old C from C# with the great simplification that you don't have to write the PInvoke declarations yourself.

+CSharp · HiGHS Documentation

CSharp

Build from source

There is a C# example code in examples/call_highs_from_csharp.cs. From the HiGHS root directory, run

cmake -S. -Bbuild -DCSHARP=ON

If a CSharp compiler is available, this builds the example using cmake and generates a binary in the build directory (build/bin/csharpexample).

NuGet

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.9.0

The nuget package contains runtime libraries for

  • win-x64
  • win-x32
  • linux-x64
  • linux-arm64
  • macos-x64
  • macos-arm64

Details for building locally can be found in nuget/README.md.

C# API

The C# API can be called directly. Here are observations on calling the HiGHS C# API from C#:

  • The file HiGHS/src/interfaces/highs_csharp_api.cs contains all the PInvoke you need.
  • Make sure, that the native HiGHS library (highs.dll, libhighs.dll, libhighs.so, ... depending on your platform) can be found at runtime. How to do this is platform dependent, copying it next to your C# executable should work in most cases. You can use msbuild for that. On linux, installing HiGHS system wide should work.
  • Make sure that all dependencies of the HiGHS library can be found, too. For example, if HiGHS was build using Visual C++ make sure that the MSVCRuntime is installed on the machine you want to run your application on.
  • Depending on the name of your HiGHS library, it might be necessary to change the constant "highslibname". See document on writing cross platform P/Invoke code if necessary.
  • Call the Methods in highs_csharp_api.cs and have fun with HiGHS.

This is the normal way to call plain old C from C# with the great simplification that you don't have to write the PInvoke declarations yourself.

diff --git a/previews/PR2119/interfaces/fortran/index.html b/previews/PR2119/interfaces/fortran/index.html index a0afce2bbc..7690138fa2 100644 --- a/previews/PR2119/interfaces/fortran/index.html +++ b/previews/PR2119/interfaces/fortran/index.html @@ -1,2 +1,2 @@ -Fortran · HiGHS Documentation

Fortran

The interface is in HiGHS/src/interfaces/highs_fortran_api.f90. Its methods are simply bindings to the C API

To include in the build, switch the Fortran CMake parameter on:

cmake -DFORTRAN=ON ..
+Fortran · HiGHS Documentation

Fortran

The interface is in HiGHS/src/interfaces/highs_fortran_api.f90. Its methods are simply bindings to the C API

To include in the build, switch the Fortran CMake parameter on:

cmake -DFORTRAN=ON ..
diff --git a/previews/PR2119/interfaces/julia/index.html b/previews/PR2119/interfaces/julia/index.html index 2d7521b52f..614022fdf9 100644 --- a/previews/PR2119/interfaces/julia/index.html +++ b/previews/PR2119/interfaces/julia/index.html @@ -62,4 +62,4 @@ 1.0 2.0 -julia> Highs_destroy(highs) +julia> Highs_destroy(highs) diff --git a/previews/PR2119/interfaces/other/index.html b/previews/PR2119/interfaces/other/index.html index 817b0941ec..a52272580a 100644 --- a/previews/PR2119/interfaces/other/index.html +++ b/previews/PR2119/interfaces/other/index.html @@ -1,2 +1,2 @@ -Other · HiGHS Documentation

Other Interfaces

Note

Some of the interfaces listed on this page are not officially supported by the HiGHS development team and are contributed by the community.

AMPL

HiGHS can be used via AMPL, see the AMPL Documentation.

GAMS

The interface is available at GAMSlinks, including pre-build libraries.

Javascript

R

Rust

  • HiGHS can be used from rust through the highs crate. The rust linear programming modeler good_lp supports HiGHS.
+Other · HiGHS Documentation

Other Interfaces

Note

Some of the interfaces listed on this page are not officially supported by the HiGHS development team and are contributed by the community.

AMPL

HiGHS can be used via AMPL, see the AMPL Documentation.

GAMS

The interface is available at GAMSlinks, including pre-build libraries.

Javascript

R

Rust

  • HiGHS can be used from rust through the highs crate. The rust linear programming modeler good_lp supports HiGHS.
diff --git a/previews/PR2119/interfaces/python/example-py/index.html b/previews/PR2119/interfaces/python/example-py/index.html index bd9ebec953..f637e97998 100644 --- a/previews/PR2119/interfaces/python/example-py/index.html +++ b/previews/PR2119/interfaces/python/example-py/index.html @@ -99,4 +99,4 @@ print('Iteration count = ', info.simplex_iteration_count) print('Primal solution status = ', h.solutionStatusToString(info.primal_solution_status)) print('Dual solution status = ', h.solutionStatusToString(info.dual_solution_status)) -print('Basis validity = ', h.basisValidityToString(info.basis_validity))
Warning

The following are markers for documentation that has yet to be added

Extract results

Report results

Option values

Get model data

Modify model data

Set solution

Set basis

Presolve/postsolve

Basis solves and tableau calculation

Rays and unboundedness

Multi-objective optimization

+print('Basis validity = ', h.basisValidityToString(info.basis_validity))
Warning

The following are markers for documentation that has yet to be added

Extract results

Report results

Option values

Get model data

Modify model data

Set solution

Set basis

Presolve/postsolve

Basis solves and tableau calculation

Rays and unboundedness

Multi-objective optimization

diff --git a/previews/PR2119/interfaces/python/index.html b/previews/PR2119/interfaces/python/index.html index a5dae6da69..d5d58be175 100644 --- a/previews/PR2119/interfaces/python/index.html +++ b/previews/PR2119/interfaces/python/index.html @@ -5,4 +5,4 @@ filename = 'model.mps' h.readModel(filename) h.run() -print('Model ', filename, ' has status ', h.getModelStatus()) +print('Model ', filename, ' has status ', h.getModelStatus()) diff --git a/previews/PR2119/options/definitions/index.html b/previews/PR2119/options/definitions/index.html index 75e0d8710e..3ffa84f5d9 100644 --- a/previews/PR2119/options/definitions/index.html +++ b/previews/PR2119/options/definitions/index.html @@ -1,2 +1,2 @@ -List of options · HiGHS Documentation

List of options

presolve

  • Presolve option: "off", "choose" or "on"
  • Type: string
  • Default: "choose"

solver

  • Solver option: "simplex", "choose", "ipm" or "pdlp". If "simplex"/"ipm"/"pdlp" is chosen then, for a MIP (QP) the integrality constraint (quadratic term) will be ignored
  • Type: string
  • Default: "choose"

parallel

  • Parallel option: "off", "choose" or "on"
  • Type: string
  • Default: "choose"

run_crossover

  • Run IPM crossover: "off", "choose" or "on"
  • Type: string
  • Default: "on"

time_limit

  • Time limit (seconds)
  • Type: double
  • Range: [0, inf]
  • Default: inf

ranging

  • Compute cost, bound, RHS and basic solution ranging: "off" or "on"
  • Type: string
  • Default: "off"

infinite_cost

  • Limit on |cost coefficient|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1e+15, inf]
  • Default: 1e+20

infinite_bound

  • Limit on |constraint bound|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1e+15, inf]
  • Default: 1e+20

small_matrix_value

  • Lower limit on |matrix entries|: values less than or equal to this will be treated as zero
  • Type: double
  • Range: [1e-12, inf]
  • Default: 1e-09

large_matrix_value

  • Upper limit on |matrix entries|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1, inf]
  • Default: 1e+15

primal_feasibility_tolerance

  • Primal feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

dual_feasibility_tolerance

  • Dual feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

ipm_optimality_tolerance

  • IPM optimality tolerance
  • Type: double
  • Range: [1e-12, inf]
  • Default: 1e-08

primal_residual_tolerance

  • Primal residual tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

dual_residual_tolerance

  • Dual residual tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

objective_bound

  • Objective bound for termination of the dual simplex solver
  • Type: double
  • Range: [-inf, inf]
  • Default: inf

objective_target

  • Objective target for termination of the MIP solver
  • Type: double
  • Range: [-inf, inf]
  • Default: -inf

random_seed

  • Random seed used in HiGHS
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 0

threads

  • Number of threads used by HiGHS (0: automatic)
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 0

user_bound_scale

  • Exponent of power-of-two bound scaling for model
  • Type: integer
  • Range: {-2147483647, 2147483647}
  • Default: 0

user_cost_scale

  • Exponent of power-of-two cost scaling for model
  • Type: integer
  • Range: {-2147483647, 2147483647}
  • Default: 0

simplex_strategy

  • Strategy for simplex solver 0 => Choose; 1 => Dual (serial); 2 => Dual (PAMI); 3 => Dual (SIP); 4 => Primal
  • Type: integer
  • Range: {0, 4}
  • Default: 1

simplex_scale_strategy

  • Simplex scaling strategy: off / choose / equilibration / forced equilibration / max value 0 / max value 1 (0/1/2/3/4/5)
  • Type: integer
  • Range: {0, 5}
  • Default: 1

simplex_dual_edge_weight_strategy

  • Strategy for simplex dual edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/1/2)
  • Type: integer
  • Range: {-1, 2}
  • Default: -1

simplex_primal_edge_weight_strategy

  • Strategy for simplex primal edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/1/2)
  • Type: integer
  • Range: {-1, 2}
  • Default: -1

simplex_iteration_limit

  • Iteration limit for simplex solver when solving LPs, but not subproblems in the MIP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

simplex_update_limit

  • Limit on the number of simplex UPDATE operations
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 5000

simplex_max_concurrency

  • Maximum level of concurrency in parallel simplex
  • Type: integer
  • Range: {1, 8}
  • Default: 8

output_flag

  • Enables or disables solver output
  • Type: boolean
  • Default: "true"

log_to_console

  • Enables or disables console logging
  • Type: boolean
  • Default: "true"

solution_file

  • Solution file
  • Type: string
  • Default: ""

log_file

  • Log file
  • Type: string
  • Default: ""

write_solution_to_file

  • Write the primal and dual solution to a file
  • Type: boolean
  • Default: "false"

write_solution_style

  • 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
  • Type: integer
  • Range: {-1, 4}
  • Default: 0

glpsol_cost_row_location

  • 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
  • Type: integer
  • Range: {-2, 2147483647}
  • Default: 0

write_model_file

  • Write model file
  • Type: string
  • Default: ""

write_model_to_file

  • Write the model to a file
  • Type: boolean
  • Default: "false"

write_presolved_model_file

  • Write presolved model file
  • Type: string
  • Default: ""

write_presolved_model_to_file

  • Write the presolved model to a file
  • Type: boolean
  • Default: "false"

mip_detect_symmetry

  • Whether MIP symmetry should be detected
  • Type: boolean
  • Default: "true"

mip_allow_restart

  • Whether MIP restart is permitted
  • Type: boolean
  • Default: "true"

mip_max_nodes

  • MIP solver max number of nodes
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_stall_nodes

  • MIP solver max number of nodes where estimate is above cutoff bound
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_start_nodes

  • MIP solver max number of nodes when completing a partial MIP start
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 500

mip_improving_solution_save

  • Whether improving MIP solutions should be saved
  • Type: boolean
  • Default: "false"

mip_improving_solution_report_sparse

  • Whether improving MIP solutions should be reported in sparse format
  • Type: boolean
  • Default: "false"

mip_improving_solution_file

  • File for reporting improving MIP solutions: not reported for an empty string \"\"
  • Type: string
  • Default: ""

mip_max_leaves

  • MIP solver max number of leaf nodes
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_improving_sols

  • Limit on the number of improving solutions found to stop the MIP solver prematurely
  • Type: integer
  • Range: {1, 2147483647}
  • Default: 2147483647

mip_lp_age_limit

  • Maximal age of dynamic LP rows before they are removed from the LP relaxation in the MIP solver
  • Type: integer
  • Range: {0, 32767}
  • Default: 10

mip_pool_age_limit

  • Maximal age of rows in the MIP solver cutpool before they are deleted
  • Type: integer
  • Range: {0, 1000}
  • Default: 30

mip_pool_soft_limit

  • Soft limit on the number of rows in the MIP solver cutpool for dynamic age adjustment
  • Type: integer
  • Range: {1, 2147483647}
  • Default: 10000

mip_pscost_minreliable

  • Minimal number of observations before MIP solver pseudo costs are considered reliable
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 8

mip_min_cliquetable_entries_for_parallelism

  • Minimal number of entries in the MIP solver cliquetable before neighbourhood queries of the conflict graph use parallel processing
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 100000

mip_feasibility_tolerance

  • MIP feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-06

mip_heuristic_effort

  • Effort spent for MIP heuristics
  • Type: double
  • Range: [0, 1]
  • Default: 0.05

mip_rel_gap

  • Tolerance on relative gap, |ub-lb|/|ub|, to determine whether optimality has been reached for a MIP instance
  • Type: double
  • Range: [0, inf]
  • Default: 0.0001

mip_abs_gap

  • Tolerance on absolute gap of MIP, |ub-lb|, to determine whether optimality has been reached for a MIP instance
  • Type: double
  • Range: [0, inf]
  • Default: 1e-06

mip_min_logging_interval

  • MIP minimum logging interval
  • Type: double
  • Range: [0, inf]
  • Default: 5

ipm_iteration_limit

  • Iteration limit for IPM solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

pdlp_native_termination

  • Use native termination for PDLP solver: Default = false
  • Type: boolean
  • Default: "false"

pdlp_scaling

  • Scaling option for PDLP solver: Default = true
  • Type: boolean
  • Default: "true"

pdlp_iteration_limit

  • Iteration limit for PDLP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

pdlp_e_restart_method

  • Restart mode for PDLP solver: 0 => none; 1 => GPU (default); 2 => CPU
  • Type: integer
  • Range: {0, 2}
  • Default: 1

pdlp_d_gap_tol

  • Duality gap tolerance for PDLP solver: Default = 1e-4
  • Type: double
  • Range: [1e-12, inf]
  • Default: 0.0001

qp_iteration_limit

  • Iteration limit for QP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

qp_nullspace_limit

  • Nullspace limit for QP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 4000

blend_multi_objectives

  • Blend multiple objectives or apply lexicographically: Default = true
  • Type: boolean
  • Default: "true"
+List of options · HiGHS Documentation

List of options

presolve

  • Presolve option: "off", "choose" or "on"
  • Type: string
  • Default: "choose"

solver

  • Solver option: "simplex", "choose", "ipm" or "pdlp". If "simplex"/"ipm"/"pdlp" is chosen then, for a MIP (QP) the integrality constraint (quadratic term) will be ignored
  • Type: string
  • Default: "choose"

parallel

  • Parallel option: "off", "choose" or "on"
  • Type: string
  • Default: "choose"

run_crossover

  • Run IPM crossover: "off", "choose" or "on"
  • Type: string
  • Default: "on"

time_limit

  • Time limit (seconds)
  • Type: double
  • Range: [0, inf]
  • Default: inf

ranging

  • Compute cost, bound, RHS and basic solution ranging: "off" or "on"
  • Type: string
  • Default: "off"

infinite_cost

  • Limit on |cost coefficient|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1e+15, inf]
  • Default: 1e+20

infinite_bound

  • Limit on |constraint bound|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1e+15, inf]
  • Default: 1e+20

small_matrix_value

  • Lower limit on |matrix entries|: values less than or equal to this will be treated as zero
  • Type: double
  • Range: [1e-12, inf]
  • Default: 1e-09

large_matrix_value

  • Upper limit on |matrix entries|: values greater than or equal to this will be treated as infinite
  • Type: double
  • Range: [1, inf]
  • Default: 1e+15

primal_feasibility_tolerance

  • Primal feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

dual_feasibility_tolerance

  • Dual feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

ipm_optimality_tolerance

  • IPM optimality tolerance
  • Type: double
  • Range: [1e-12, inf]
  • Default: 1e-08

primal_residual_tolerance

  • Primal residual tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

dual_residual_tolerance

  • Dual residual tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-07

objective_bound

  • Objective bound for termination of the dual simplex solver
  • Type: double
  • Range: [-inf, inf]
  • Default: inf

objective_target

  • Objective target for termination of the MIP solver
  • Type: double
  • Range: [-inf, inf]
  • Default: -inf

random_seed

  • Random seed used in HiGHS
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 0

threads

  • Number of threads used by HiGHS (0: automatic)
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 0

user_bound_scale

  • Exponent of power-of-two bound scaling for model
  • Type: integer
  • Range: {-2147483647, 2147483647}
  • Default: 0

user_cost_scale

  • Exponent of power-of-two cost scaling for model
  • Type: integer
  • Range: {-2147483647, 2147483647}
  • Default: 0

simplex_strategy

  • Strategy for simplex solver 0 => Choose; 1 => Dual (serial); 2 => Dual (PAMI); 3 => Dual (SIP); 4 => Primal
  • Type: integer
  • Range: {0, 4}
  • Default: 1

simplex_scale_strategy

  • Simplex scaling strategy: off / choose / equilibration / forced equilibration / max value 0 / max value 1 (0/1/2/3/4/5)
  • Type: integer
  • Range: {0, 5}
  • Default: 1

simplex_dual_edge_weight_strategy

  • Strategy for simplex dual edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/1/2)
  • Type: integer
  • Range: {-1, 2}
  • Default: -1

simplex_primal_edge_weight_strategy

  • Strategy for simplex primal edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/1/2)
  • Type: integer
  • Range: {-1, 2}
  • Default: -1

simplex_iteration_limit

  • Iteration limit for simplex solver when solving LPs, but not subproblems in the MIP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

simplex_update_limit

  • Limit on the number of simplex UPDATE operations
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 5000

simplex_max_concurrency

  • Maximum level of concurrency in parallel simplex
  • Type: integer
  • Range: {1, 8}
  • Default: 8

output_flag

  • Enables or disables solver output
  • Type: boolean
  • Default: "true"

log_to_console

  • Enables or disables console logging
  • Type: boolean
  • Default: "true"

solution_file

  • Solution file
  • Type: string
  • Default: ""

log_file

  • Log file
  • Type: string
  • Default: ""

write_solution_to_file

  • Write the primal and dual solution to a file
  • Type: boolean
  • Default: "false"

write_solution_style

  • 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
  • Type: integer
  • Range: {-1, 4}
  • Default: 0

glpsol_cost_row_location

  • 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
  • Type: integer
  • Range: {-2, 2147483647}
  • Default: 0

write_model_file

  • Write model file
  • Type: string
  • Default: ""

write_model_to_file

  • Write the model to a file
  • Type: boolean
  • Default: "false"

write_presolved_model_file

  • Write presolved model file
  • Type: string
  • Default: ""

write_presolved_model_to_file

  • Write the presolved model to a file
  • Type: boolean
  • Default: "false"

mip_detect_symmetry

  • Whether MIP symmetry should be detected
  • Type: boolean
  • Default: "true"

mip_allow_restart

  • Whether MIP restart is permitted
  • Type: boolean
  • Default: "true"

mip_max_nodes

  • MIP solver max number of nodes
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_stall_nodes

  • MIP solver max number of nodes where estimate is above cutoff bound
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_start_nodes

  • MIP solver max number of nodes when completing a partial MIP start
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 500

mip_improving_solution_save

  • Whether improving MIP solutions should be saved
  • Type: boolean
  • Default: "false"

mip_improving_solution_report_sparse

  • Whether improving MIP solutions should be reported in sparse format
  • Type: boolean
  • Default: "false"

mip_improving_solution_file

  • File for reporting improving MIP solutions: not reported for an empty string \"\"
  • Type: string
  • Default: ""

mip_max_leaves

  • MIP solver max number of leaf nodes
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

mip_max_improving_sols

  • Limit on the number of improving solutions found to stop the MIP solver prematurely
  • Type: integer
  • Range: {1, 2147483647}
  • Default: 2147483647

mip_lp_age_limit

  • Maximal age of dynamic LP rows before they are removed from the LP relaxation in the MIP solver
  • Type: integer
  • Range: {0, 32767}
  • Default: 10

mip_pool_age_limit

  • Maximal age of rows in the MIP solver cutpool before they are deleted
  • Type: integer
  • Range: {0, 1000}
  • Default: 30

mip_pool_soft_limit

  • Soft limit on the number of rows in the MIP solver cutpool for dynamic age adjustment
  • Type: integer
  • Range: {1, 2147483647}
  • Default: 10000

mip_pscost_minreliable

  • Minimal number of observations before MIP solver pseudo costs are considered reliable
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 8

mip_min_cliquetable_entries_for_parallelism

  • Minimal number of entries in the MIP solver cliquetable before neighbourhood queries of the conflict graph use parallel processing
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 100000

mip_feasibility_tolerance

  • MIP feasibility tolerance
  • Type: double
  • Range: [1e-10, inf]
  • Default: 1e-06

mip_heuristic_effort

  • Effort spent for MIP heuristics
  • Type: double
  • Range: [0, 1]
  • Default: 0.05

mip_rel_gap

  • Tolerance on relative gap, |ub-lb|/|ub|, to determine whether optimality has been reached for a MIP instance
  • Type: double
  • Range: [0, inf]
  • Default: 0.0001

mip_abs_gap

  • Tolerance on absolute gap of MIP, |ub-lb|, to determine whether optimality has been reached for a MIP instance
  • Type: double
  • Range: [0, inf]
  • Default: 1e-06

mip_min_logging_interval

  • MIP minimum logging interval
  • Type: double
  • Range: [0, inf]
  • Default: 5

ipm_iteration_limit

  • Iteration limit for IPM solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

pdlp_native_termination

  • Use native termination for PDLP solver: Default = false
  • Type: boolean
  • Default: "false"

pdlp_scaling

  • Scaling option for PDLP solver: Default = true
  • Type: boolean
  • Default: "true"

pdlp_iteration_limit

  • Iteration limit for PDLP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

pdlp_e_restart_method

  • Restart mode for PDLP solver: 0 => none; 1 => GPU (default); 2 => CPU
  • Type: integer
  • Range: {0, 2}
  • Default: 1

pdlp_d_gap_tol

  • Duality gap tolerance for PDLP solver: Default = 1e-4
  • Type: double
  • Range: [1e-12, inf]
  • Default: 0.0001

qp_iteration_limit

  • Iteration limit for QP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 2147483647

qp_nullspace_limit

  • Nullspace limit for QP solver
  • Type: integer
  • Range: {0, 2147483647}
  • Default: 4000

blend_multi_objectives

  • Blend multiple objectives or apply lexicographically: Default = true
  • Type: boolean
  • Default: "true"
diff --git a/previews/PR2119/options/intro/index.html b/previews/PR2119/options/intro/index.html index 9955537616..ae1c18ae67 100644 --- a/previews/PR2119/options/intro/index.html +++ b/previews/PR2119/options/intro/index.html @@ -1,2 +1,2 @@ -Introduction · HiGHS Documentation

Introduction

The options that control HiGHS are of four types: boolean, integer, double and string. Their values can be specified:

  • via the command line when running the Executable
  • via method calls when running HiGHS in an application.

Options file

When running the Executable via the command line, some options values can be set explicitly in the command, and all options can be set by means of an options file.

A sample options file, giving documentation of all the options is written to the console by the command:

$ bin/highs --options_file=""

Option methods

The following code illustrates how to access the HiGHS options in Python. To set the value of option name, call:

status = h.setOptionValue(name, value)

where the value passed can be an identifier of the appropriate type, or an explicit value.

To get the value of option name, call:

[status, value] = h.getOptionValue(name)

To get the type of option name, call:

[status, type] = h.getOptionType(name)

Examples of calls to options methods are given in the examples section.

+Introduction · HiGHS Documentation

Introduction

The options that control HiGHS are of four types: boolean, integer, double and string. Their values can be specified:

  • via the command line when running the Executable
  • via method calls when running HiGHS in an application.

Options file

When running the Executable via the command line, some options values can be set explicitly in the command, and all options can be set by means of an options file.

A sample options file, giving documentation of all the options is written to the console by the command:

$ bin/highs --options_file=""

Option methods

The following code illustrates how to access the HiGHS options in Python. To set the value of option name, call:

status = h.setOptionValue(name, value)

where the value passed can be an identifier of the appropriate type, or an explicit value.

To get the value of option name, call:

[status, value] = h.getOptionValue(name)

To get the type of option name, call:

[status, type] = h.getOptionType(name)

Examples of calls to options methods are given in the examples section.

diff --git a/previews/PR2119/parallel/index.html b/previews/PR2119/parallel/index.html index 14395768ae..e558d22ce1 100644 --- a/previews/PR2119/parallel/index.html +++ b/previews/PR2119/parallel/index.html @@ -1,2 +1,2 @@ -Parallel · HiGHS Documentation

Parallelism

Generally

HiGHS currently has limited opportunities for exploiting parallel computing. These are currently restricted to the dual simplex solver for LP, and the MIP solver. Details of these and future plans are set out below.

By default, when running in parallel, HiGHS will use half the available threads on a machine. This number can be modified by setting the value of the threads option.

Dual simplex

By default, the HiGHS dual simplex solver runs in serial. However, it has a variant allowing concurrent processing. This variant is used when the parallel option is set "on", by specifying --parallel when running the executable via the command line, or by setting it via a library call in an application.

The concurrency used will be the value of simplex_max_concurrency. If this is fewer than the number of threads available, parallel performance may be less than anticipated.

The speed-up achieved using the dual simplex solver is normally bounded by the number of memory channels in the architecture, and typically less than the values achieved by Huangfu and Hall. This is because enhancements to the serial dual simplex solver in recent years have not been propagated to the parallel solver.

Unless an LP has significantly more variables than constraints, the parallel dual simplex solver is unlikely to be worth using.

MIP

The only parallel computation currently implemented in the MIP solver occurs when performing symmetry detection on the model, and when querying clique tables. This parallelism is always advantageous, so is performed regardless of the value of the parallel option.

Future plans

The MIP solver has been written with parallel tree seach in mind, and it is hoped that this will be implemented before the end of 2024. The parallel LP solver will also enhance the MIP solver performance by speeding up the solution of the root node.

Development of a parallel interior point solver will start in 2023, and is expected to be completed by the end of 2024.

+Parallel · HiGHS Documentation

Parallelism

Generally

HiGHS currently has limited opportunities for exploiting parallel computing. These are currently restricted to the dual simplex solver for LP, and the MIP solver. Details of these and future plans are set out below.

By default, when running in parallel, HiGHS will use half the available threads on a machine. This number can be modified by setting the value of the threads option.

Dual simplex

By default, the HiGHS dual simplex solver runs in serial. However, it has a variant allowing concurrent processing. This variant is used when the parallel option is set "on", by specifying --parallel when running the executable via the command line, or by setting it via a library call in an application.

The concurrency used will be the value of simplex_max_concurrency. If this is fewer than the number of threads available, parallel performance may be less than anticipated.

The speed-up achieved using the dual simplex solver is normally bounded by the number of memory channels in the architecture, and typically less than the values achieved by Huangfu and Hall. This is because enhancements to the serial dual simplex solver in recent years have not been propagated to the parallel solver.

Unless an LP has significantly more variables than constraints, the parallel dual simplex solver is unlikely to be worth using.

MIP

The only parallel computation currently implemented in the MIP solver occurs when performing symmetry detection on the model, and when querying clique tables. This parallelism is always advantageous, so is performed regardless of the value of the parallel option.

Future plans

The MIP solver has been written with parallel tree seach in mind, and it is hoped that this will be implemented before the end of 2024. The parallel LP solver will also enhance the MIP solver performance by speeding up the solution of the root node.

Development of a parallel interior point solver will start in 2023, and is expected to be completed by the end of 2024.

diff --git a/previews/PR2119/search/index.html b/previews/PR2119/search/index.html index ed34013761..e96fff6076 100644 --- a/previews/PR2119/search/index.html +++ b/previews/PR2119/search/index.html @@ -1,2 +1,2 @@ -Search · HiGHS Documentation

Loading search...

    +Search · HiGHS Documentation

    Loading search...

      diff --git a/previews/PR2119/solvers/index.html b/previews/PR2119/solvers/index.html index 437b4330ca..af105837a5 100644 --- a/previews/PR2119/solvers/index.html +++ b/previews/PR2119/solvers/index.html @@ -1,2 +1,2 @@ -Solvers · HiGHS Documentation

      Solvers

      LP

      HiGHS has implementations of the three main solution techniques for LP. HiGHS will choose the most appropriate technique for a given problem, but this can be over-ridden by setting the option solver.

      Simplex

      HiGHS has efficient implementations of both the primal and dual simplex methods, although the dual simplex solver is likely to be faster and is more robust, so is used by default. The novel features of the dual simplex solver are described in

      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.

      • Setting the option solver to "simplex" forces the simplex solver to be used
      • The option simplex_strategy determines whether the primal solver or one of the parallel solvers is to be used.

      Interior point

      HiGHS has one interior point (IPM) solver based on the preconditioned conjugate gradient method, as discussed in

      Implementation of an interior point method with basis preconditioning, Mathematical Programming Computation, 12, 603-635, 2020. DOI: 10.1007/s12532-020-00181-8.

      This solver is serial. An interior point solver based on direct factorization is being developed.

      Setting the option solver to "ipm" forces the IPM solver to be used

      Primal-dual hybrid gradient method

      HiGHS includes the cuPDLP-C primal-dual hybrid gradient method for LP (PDLP). Currently this only runs on CPU, so it is unlikely to be competitive with the HiGHS interior point or simplex solvers. Enabling HiGHS to run PDLP on a GPU is work in progress.

      Setting the option solver to "pdlp" forces the PDLP solver to be used

      MIP

      The HiGHS MIP solver uses established branch-and-cut techniques

      QP

      The HiGHS solver for convex QP problems uses an established primal active set method. The new interior point solver will also be able to solve convex QP problems.

      +Solvers · HiGHS Documentation

      Solvers

      LP

      HiGHS has implementations of the three main solution techniques for LP. HiGHS will choose the most appropriate technique for a given problem, but this can be over-ridden by setting the option solver.

      Simplex

      HiGHS has efficient implementations of both the primal and dual simplex methods, although the dual simplex solver is likely to be faster and is more robust, so is used by default. The novel features of the dual simplex solver are described in

      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.

      • Setting the option solver to "simplex" forces the simplex solver to be used
      • The option simplex_strategy determines whether the primal solver or one of the parallel solvers is to be used.

      Interior point

      HiGHS has one interior point (IPM) solver based on the preconditioned conjugate gradient method, as discussed in

      Implementation of an interior point method with basis preconditioning, Mathematical Programming Computation, 12, 603-635, 2020. DOI: 10.1007/s12532-020-00181-8.

      This solver is serial. An interior point solver based on direct factorization is being developed.

      Setting the option solver to "ipm" forces the IPM solver to be used

      Primal-dual hybrid gradient method

      HiGHS includes the cuPDLP-C primal-dual hybrid gradient method for LP (PDLP). Currently this only runs on CPU, so it is unlikely to be competitive with the HiGHS interior point or simplex solvers. Enabling HiGHS to run PDLP on a GPU is work in progress.

      Setting the option solver to "pdlp" forces the PDLP solver to be used

      MIP

      The HiGHS MIP solver uses established branch-and-cut techniques

      QP

      The HiGHS solver for convex QP problems uses an established primal active set method. The new interior point solver will also be able to solve convex QP problems.

      diff --git a/previews/PR2119/structures/classes/HighsHessian/index.html b/previews/PR2119/structures/classes/HighsHessian/index.html index f434a07279..eca8cff253 100644 --- a/previews/PR2119/structures/classes/HighsHessian/index.html +++ b/previews/PR2119/structures/classes/HighsHessian/index.html @@ -1,2 +1,2 @@ -HighsHessian · HiGHS Documentation

      HighsHessian

      A Hessian matrix is communicated via an instance of the HighsHessian class.

      • dim_: Scalar of type integer - Dimension of the Hessian
      • format_: Scalar of HessianFormat type - Format of the Hessian
      • start_: Vector of integer type - Start of each compressed column in the Hessian
      • index_: Vector of integer type - Indices of the nonzeros in the Hessian
      • value_: Vector of double type - Values of the nonzeros in the Hessian
      +HighsHessian · HiGHS Documentation

      HighsHessian

      A Hessian matrix is communicated via an instance of the HighsHessian class.

      • dim_: Scalar of type integer - Dimension of the Hessian
      • format_: Scalar of HessianFormat type - Format of the Hessian
      • start_: Vector of integer type - Start of each compressed column in the Hessian
      • index_: Vector of integer type - Indices of the nonzeros in the Hessian
      • value_: Vector of double type - Values of the nonzeros in the Hessian
      diff --git a/previews/PR2119/structures/classes/HighsLp/index.html b/previews/PR2119/structures/classes/HighsLp/index.html index af02a96cc6..45f1db230a 100644 --- a/previews/PR2119/structures/classes/HighsLp/index.html +++ b/previews/PR2119/structures/classes/HighsLp/index.html @@ -1,2 +1,2 @@ -HighsLp · HiGHS Documentation

      HighsLp

      An LP model is communicated via an instance of the HighsLp class

      • num_col_: Scalar of type integer - Number of columns in the model
      • num_row_: Scalar of type integer - Number of rows in the model
      • col_cost_: Vector of type double - Coefficients of the linear term in the objective function
      • col_lower_: Vector of type double - Lower bounds on the variables
      • col_upper_: Vector of type double - Upper bounds on the variables
      • row_lower_: Vector of type double - Lower bounds on the constraints
      • row_upper_: Vector of type double - Upper bounds on the constraints
      • a_matrix_: Instance of HighsSparseMatrix class - Constraint matrix
      • sense_: Scalar of type ObjSense - Optimization sense of the model
      • offset_: Scalar of type double - Constant term in the objective function
      • model_name_: Scalar of type string - Name of the model
      • objective_name_: Scalar of type string - Name of the objective function
      • col_names_: Vector of type string - Names of the variables
      • row_names_: Vector of type string - Names of the constraints
      • integrality_: Vector of type HighsVarType - Type of each variable
      +HighsLp · HiGHS Documentation

      HighsLp

      An LP model is communicated via an instance of the HighsLp class

      • num_col_: Scalar of type integer - Number of columns in the model
      • num_row_: Scalar of type integer - Number of rows in the model
      • col_cost_: Vector of type double - Coefficients of the linear term in the objective function
      • col_lower_: Vector of type double - Lower bounds on the variables
      • col_upper_: Vector of type double - Upper bounds on the variables
      • row_lower_: Vector of type double - Lower bounds on the constraints
      • row_upper_: Vector of type double - Upper bounds on the constraints
      • a_matrix_: Instance of HighsSparseMatrix class - Constraint matrix
      • sense_: Scalar of type ObjSense - Optimization sense of the model
      • offset_: Scalar of type double - Constant term in the objective function
      • model_name_: Scalar of type string - Name of the model
      • objective_name_: Scalar of type string - Name of the objective function
      • col_names_: Vector of type string - Names of the variables
      • row_names_: Vector of type string - Names of the constraints
      • integrality_: Vector of type HighsVarType - Type of each variable
      diff --git a/previews/PR2119/structures/classes/HighsModel/index.html b/previews/PR2119/structures/classes/HighsModel/index.html index d04fdb91de..dcf57121dd 100644 --- a/previews/PR2119/structures/classes/HighsModel/index.html +++ b/previews/PR2119/structures/classes/HighsModel/index.html @@ -1,2 +1,2 @@ -HighsModel · HiGHS Documentation

      HighsModel

      A QP model is communicated via an instance of the HighsModel class

      • lp_: Instance of HighsLp class - LP components of the model

      • hessian_: Instance of HighsHessian class - Hessian matrix

      +HighsModel · HiGHS Documentation

      HighsModel

      A QP model is communicated via an instance of the HighsModel class

      • lp_: Instance of HighsLp class - LP components of the model

      • hessian_: Instance of HighsHessian class - Hessian matrix

      diff --git a/previews/PR2119/structures/classes/HighsSparseMatrix/index.html b/previews/PR2119/structures/classes/HighsSparseMatrix/index.html index 2a5d516db5..7826a0dab7 100644 --- a/previews/PR2119/structures/classes/HighsSparseMatrix/index.html +++ b/previews/PR2119/structures/classes/HighsSparseMatrix/index.html @@ -1,2 +1,2 @@ -HighsSparseMatrix · HiGHS Documentation

      HighsSparseMatrix

      The constraint matrix of an LP model is communicated via an instance of the HighsSparseMatrix class

      • format_: Scalar of MatrixFormat type - Format of the matrix
      • num_col_ : Scalar of integer type - Number of columns in the matrix
      • num_row_: Scalar of integer type - Number of rows in the matrix
      • start_: Vector of integer type - Start of each compressed vector in the matrix
      • index_: Vector of integer type - Indices of the nonzeros in the matrix
      • value_: Vector of double type - Values of the nonzeros in the matrix
      +HighsSparseMatrix · HiGHS Documentation

      HighsSparseMatrix

      The constraint matrix of an LP model is communicated via an instance of the HighsSparseMatrix class

      • format_: Scalar of MatrixFormat type - Format of the matrix
      • num_col_ : Scalar of integer type - Number of columns in the matrix
      • num_row_: Scalar of integer type - Number of rows in the matrix
      • start_: Vector of integer type - Start of each compressed vector in the matrix
      • index_: Vector of integer type - Indices of the nonzeros in the matrix
      • value_: Vector of double type - Values of the nonzeros in the matrix
      diff --git a/previews/PR2119/structures/classes/index.html b/previews/PR2119/structures/classes/index.html index e4122d8bdf..93d0f11687 100644 --- a/previews/PR2119/structures/classes/index.html +++ b/previews/PR2119/structures/classes/index.html @@ -1,2 +1,2 @@ -Overview · HiGHS Documentation
      +Overview · HiGHS Documentation
      diff --git a/previews/PR2119/structures/enums/index.html b/previews/PR2119/structures/enums/index.html index a06eca95ba..709823e960 100644 --- a/previews/PR2119/structures/enums/index.html +++ b/previews/PR2119/structures/enums/index.html @@ -1,2 +1,2 @@ -Enums · HiGHS Documentation

      Enums

      The members of the fundamental HiGHS enums are defined below. If Enum refers to a particular enum, and Member to a particular member, the members are available as follows.

      • Python: highspy.Enum.Member
      • C++: Enum::Member

      Members for internal use only are not documented.

      HighsStatus

      This is (part of) the return value of most HiGHS methods:

      • kError: The method has exposed an error
      • kOk: The method has completed successfully
      • kWarning: The method has recovered from an unusual event, or has terminated

      due to reaching a time or iteration limit

      MatrixFormat

      This defines the format of a HighsSparseMatrix:

      • kColwise: The matrix is stored column-wise
      • kRowwise: The matrix is stored row-wise

      ObjSense

      This defines optimization sense of a HighsLp:

      • kMinimize: The objective is to be minimized
      • kMaximize: The objective is to be maximized

      HighsVarType

      This defines the feasible values of a variable within a model:

      • kContinuous: The variable can take continuous values between its bounds
      • kInteger: The variable must take integer values between its bounds
      • kSemiContinuous: The variable must be zero or take continuous values between its bounds
      • kSemiInteger: The variable must be zero or take integer values between its bounds

      HessianFormat

      This defines the format of a HighsHessian:

      • kTriangular: The lower triangular component of the Hessian is stored column-wise or, equivalently, the upper triangular component is stored row-wise
      • kSquare: The whole Hessian $Q$ is stored column-wise. This is for input only: internally the lower triangular component of $(Q+Q^T)/2$ will be stored

      SolutionStatus

      This defines the nature of any primal or dual solution information:

      • kSolutionStatusNone: There is no solution information
      • kSolutionStatusInfeasible: The solution is not feasible
      • kSolutionStatusFeasible: The solution is feasible

      BasisValidity

      This defines the nature of any basis information:

      • kBasisValidityInvalid: There is no basisn information
      • kBasisValidityValid: The basis information is valid

      HighsModelStatus

      This defines the status of the model after a call to run

      • kNotset: The model status has not been set
      • kModelError: There is an error in the model
      • kSolveError: There has been an error when solving the model
      • kModelEmpty: The model is empty
      • kOptimal: The model has been solved to optimality
      • kInfeasible: The model is infeasible
      • kUnboundedOrInfeasible: The model is unbounded or infeasible
      • kUnbounded: The model is unbounded
      • kObjectiveBound: The bound on the model objective value has been reached
      • kObjectiveTarget: The target value for the model objective has been reached
      • kTimeLimit: The run time limit has been reached
      • kIterationLimit: The iteration limit has been reached
      • kSolutionLimit: The MIP solver has reached the limit on the number of LPs solved
      • kInterrupt: The solver has been interrupted by the user
      • kMemoryLimit: The solver has been unable to allocate sufficient memory
      • kUnknown: The model status is unknown

      HighsBasisStatus

      This defines the status of a variable (or slack variable for a constraint) in a basis:

      • kLower: The variable is nonbasic at its lower bound (or fixed value)
      • kBasic: The variable is basic
      • kUpper: The variable is at its upper bound
      • kZero: A free variable is nonbasic and set to zero
      • kNonbasic: The variable is nonbasic

      HighsOptionType

      This defines the types of option values that control HiGHS:

      • kBool: The option type is boolean
      • kInt: The option type is integer
      • kDouble: The option type is double
      • kString: The option type is string

      HighsInfoType

      This defines the types of (scalar) information available after a call to run:

      • kInt64: The information type is 64-bit integer
      • kInt: The information type is integer
      • kDouble: The information type is double
      +Enums · HiGHS Documentation

      Enums

      The members of the fundamental HiGHS enums are defined below. If Enum refers to a particular enum, and Member to a particular member, the members are available as follows.

      • Python: highspy.Enum.Member
      • C++: Enum::Member

      Members for internal use only are not documented.

      HighsStatus

      This is (part of) the return value of most HiGHS methods:

      • kError: The method has exposed an error
      • kOk: The method has completed successfully
      • kWarning: The method has recovered from an unusual event, or has terminated

      due to reaching a time or iteration limit

      MatrixFormat

      This defines the format of a HighsSparseMatrix:

      • kColwise: The matrix is stored column-wise
      • kRowwise: The matrix is stored row-wise

      ObjSense

      This defines optimization sense of a HighsLp:

      • kMinimize: The objective is to be minimized
      • kMaximize: The objective is to be maximized

      HighsVarType

      This defines the feasible values of a variable within a model:

      • kContinuous: The variable can take continuous values between its bounds
      • kInteger: The variable must take integer values between its bounds
      • kSemiContinuous: The variable must be zero or take continuous values between its bounds
      • kSemiInteger: The variable must be zero or take integer values between its bounds

      HessianFormat

      This defines the format of a HighsHessian:

      • kTriangular: The lower triangular component of the Hessian is stored column-wise or, equivalently, the upper triangular component is stored row-wise
      • kSquare: The whole Hessian $Q$ is stored column-wise. This is for input only: internally the lower triangular component of $(Q+Q^T)/2$ will be stored

      SolutionStatus

      This defines the nature of any primal or dual solution information:

      • kSolutionStatusNone: There is no solution information
      • kSolutionStatusInfeasible: The solution is not feasible
      • kSolutionStatusFeasible: The solution is feasible

      BasisValidity

      This defines the nature of any basis information:

      • kBasisValidityInvalid: There is no basisn information
      • kBasisValidityValid: The basis information is valid

      HighsModelStatus

      This defines the status of the model after a call to run

      • kNotset: The model status has not been set
      • kModelError: There is an error in the model
      • kSolveError: There has been an error when solving the model
      • kModelEmpty: The model is empty
      • kOptimal: The model has been solved to optimality
      • kInfeasible: The model is infeasible
      • kUnboundedOrInfeasible: The model is unbounded or infeasible
      • kUnbounded: The model is unbounded
      • kObjectiveBound: The bound on the model objective value has been reached
      • kObjectiveTarget: The target value for the model objective has been reached
      • kTimeLimit: The run time limit has been reached
      • kIterationLimit: The iteration limit has been reached
      • kSolutionLimit: The MIP solver has reached the limit on the number of LPs solved
      • kInterrupt: The solver has been interrupted by the user
      • kMemoryLimit: The solver has been unable to allocate sufficient memory
      • kUnknown: The model status is unknown

      HighsBasisStatus

      This defines the status of a variable (or slack variable for a constraint) in a basis:

      • kLower: The variable is nonbasic at its lower bound (or fixed value)
      • kBasic: The variable is basic
      • kUpper: The variable is at its upper bound
      • kZero: A free variable is nonbasic and set to zero
      • kNonbasic: The variable is nonbasic

      HighsOptionType

      This defines the types of option values that control HiGHS:

      • kBool: The option type is boolean
      • kInt: The option type is integer
      • kDouble: The option type is double
      • kString: The option type is string

      HighsInfoType

      This defines the types of (scalar) information available after a call to run:

      • kInt64: The information type is 64-bit integer
      • kInt: The information type is integer
      • kDouble: The information type is double
      diff --git a/previews/PR2119/structures/index.html b/previews/PR2119/structures/index.html index 07c0468d4e..2856291122 100644 --- a/previews/PR2119/structures/index.html +++ b/previews/PR2119/structures/index.html @@ -1,2 +1,2 @@ -Introduction · HiGHS Documentation

      Introduction

      There are several specialist data structures that can be used to interact with HiGHS when using C++ and Python, and they are defined in the sections on enums and classes. The advantage using these classes is that many fewer parameters are needed when passing data to and from HiGHS. However, the use of classes is not necessary for the basic use of highspy. As with the C and Fortran interfaces, there are equivalent methods that use simple scalars and vectors of data.

      +Introduction · HiGHS Documentation

      Introduction

      There are several specialist data structures that can be used to interact with HiGHS when using C++ and Python, and they are defined in the sections on enums and classes. The advantage using these classes is that many fewer parameters are needed when passing data to and from HiGHS. However, the use of classes is not necessary for the basic use of highspy. As with the C and Fortran interfaces, there are equivalent methods that use simple scalars and vectors of data.

      diff --git a/previews/PR2119/structures/structs/HighsBasis/index.html b/previews/PR2119/structures/structs/HighsBasis/index.html index ffddb0f96c..5741a516d7 100644 --- a/previews/PR2119/structures/structs/HighsBasis/index.html +++ b/previews/PR2119/structures/structs/HighsBasis/index.html @@ -1,2 +1,2 @@ -HighsBasis · HiGHS Documentation

      HighsBasis

      The basis of a model is communicated via an instance of the HighsBasis structure

      +HighsBasis · HiGHS Documentation

      HighsBasis

      The basis of a model is communicated via an instance of the HighsBasis structure

      diff --git a/previews/PR2119/structures/structs/HighsInfo/index.html b/previews/PR2119/structures/structs/HighsInfo/index.html index f0a3d5bc9c..bb6fa469ef 100644 --- a/previews/PR2119/structures/structs/HighsInfo/index.html +++ b/previews/PR2119/structures/structs/HighsInfo/index.html @@ -1,2 +1,2 @@ -HighsInfo · HiGHS Documentation

      HighsInfo

      Scalar information about a solved model is communicated via an instance of the HighsInfo structure

      valid

      • Indicates whether the values in a HighsInfo instance are valid
      • Type: bool

      simplex_iteration_count

      • The number of simplex iterations performed
      • Type: integer

      ipm_iteration_count

      • The number of interior point iterations performed
      • Type: integer

      crossover_iteration_count

      • The number of crossover iterations performed
      • Type: integer

      qp_iteration_count

      • The number of QP iterations performed
      • Type: integer

      primal_solution_status

      dual_solution_status

      basis_validity

      • Comparison with BasisValidity gives the status of any basis information
      • Type: integer

      objective_function_value

      • The optimal value of the objective function
      • Type: double

      mip_node_count

      • The number of nodes generated by the MIP solver
      • Type: long integer

      mip_dual_bound

      mip_gap

      • The absolute value of the gap between the primal and bounds, relative to the primal bound.
      • Type: double

      max_integrality_violation

      • The maximum deviation from an integer value over all the discrete variables
      • Type: double

      num_primal_infeasibilities

      max_primal_infeasibility

      • The maximum violation of a bound on a variable
      • Type: double

      sum_primal_infeasibilities

      • The sum of violations of bounds by variables
      • Type: double

      num_dual_infeasibilities

      max_dual_infeasibility

      • The maximum dual feasibility violation
      • Type: double

      sum_dual_infeasibilities

      • The sum of dual feasibility violations
      • Type: double
      +HighsInfo · HiGHS Documentation

      HighsInfo

      Scalar information about a solved model is communicated via an instance of the HighsInfo structure

      valid

      • Indicates whether the values in a HighsInfo instance are valid
      • Type: bool

      simplex_iteration_count

      • The number of simplex iterations performed
      • Type: integer

      ipm_iteration_count

      • The number of interior point iterations performed
      • Type: integer

      crossover_iteration_count

      • The number of crossover iterations performed
      • Type: integer

      qp_iteration_count

      • The number of QP iterations performed
      • Type: integer

      primal_solution_status

      dual_solution_status

      basis_validity

      • Comparison with BasisValidity gives the status of any basis information
      • Type: integer

      objective_function_value

      • The optimal value of the objective function
      • Type: double

      mip_node_count

      • The number of nodes generated by the MIP solver
      • Type: long integer

      mip_dual_bound

      mip_gap

      • The absolute value of the gap between the primal and bounds, relative to the primal bound.
      • Type: double

      max_integrality_violation

      • The maximum deviation from an integer value over all the discrete variables
      • Type: double

      num_primal_infeasibilities

      max_primal_infeasibility

      • The maximum violation of a bound on a variable
      • Type: double

      sum_primal_infeasibilities

      • The sum of violations of bounds by variables
      • Type: double

      num_dual_infeasibilities

      max_dual_infeasibility

      • The maximum dual feasibility violation
      • Type: double

      sum_dual_infeasibilities

      • The sum of dual feasibility violations
      • Type: double
      diff --git a/previews/PR2119/structures/structs/HighsLinearObjective/index.html b/previews/PR2119/structures/structs/HighsLinearObjective/index.html index 5a35043d5e..ff5cf0f44e 100644 --- a/previews/PR2119/structures/structs/HighsLinearObjective/index.html +++ b/previews/PR2119/structures/structs/HighsLinearObjective/index.html @@ -1,2 +1,2 @@ -HighsLinearObjective · HiGHS Documentation

      HighsLinearObjective

      A linear objective for a model is communicated via an instance of the HighsLinearObjective structure

      • weight: Scalar of type double - The weight of this objective when blending
      • offset: Scalar of type double - The offset of this objective
      • coefficients: Vector of type double - The coefficients of this objective
      • abs_tolerance: Scalar of type double - The absolute tolerance on this objective when performing lexicographic optimization
      • rel_tolerance: Scalar of type double - The relative tolerance on this objective when performing lexicographic optimization
      • priority: Scalar of type HighsInt - The priority of this objective when performing lexicographic optimization
      +HighsLinearObjective · HiGHS Documentation

      HighsLinearObjective

      A linear objective for a model is communicated via an instance of the HighsLinearObjective structure

      • weight: Scalar of type double - The weight of this objective when blending
      • offset: Scalar of type double - The offset of this objective
      • coefficients: Vector of type double - The coefficients of this objective
      • abs_tolerance: Scalar of type double - The absolute tolerance on this objective when performing lexicographic optimization
      • rel_tolerance: Scalar of type double - The relative tolerance on this objective when performing lexicographic optimization
      • priority: Scalar of type HighsInt - The priority of this objective when performing lexicographic optimization
      diff --git a/previews/PR2119/structures/structs/HighsSolution/index.html b/previews/PR2119/structures/structs/HighsSolution/index.html index 0f54137dbb..80142b4f95 100644 --- a/previews/PR2119/structures/structs/HighsSolution/index.html +++ b/previews/PR2119/structures/structs/HighsSolution/index.html @@ -1,2 +1,2 @@ -HighsSolution · HiGHS Documentation

      HighsSolution

      The solution of a model is communicated via an instance of the HighsSolution structure

      • value_valid: Scalar of type bool - Indicates whether the column and row values are valid
      • dual_valid: Scalar of type bool - Indicates whether the column and row duals are valid
      • col_value: Vector of type double - Values of the columns (variables)
      • col_dual: Vector of type double - Duals of the columns (variables)
      • row_value: Vector of type double - Values of the rows (constraints)
      • row_dual: Vector of type double - Duals of the rows (constraints)
      +HighsSolution · HiGHS Documentation

      HighsSolution

      The solution of a model is communicated via an instance of the HighsSolution structure

      • value_valid: Scalar of type bool - Indicates whether the column and row values are valid
      • dual_valid: Scalar of type bool - Indicates whether the column and row duals are valid
      • col_value: Vector of type double - Values of the columns (variables)
      • col_dual: Vector of type double - Duals of the columns (variables)
      • row_value: Vector of type double - Values of the rows (constraints)
      • row_dual: Vector of type double - Duals of the rows (constraints)
      diff --git a/previews/PR2119/structures/structs/index.html b/previews/PR2119/structures/structs/index.html index 953e4c97f0..ea3fe122e3 100644 --- a/previews/PR2119/structures/structs/index.html +++ b/previews/PR2119/structures/structs/index.html @@ -1,2 +1,2 @@ -Overview · HiGHS Documentation
      +Overview · HiGHS Documentation
      diff --git a/previews/PR2119/terminology/index.html b/previews/PR2119/terminology/index.html index c1ed480b9b..2e498c626d 100644 --- a/previews/PR2119/terminology/index.html +++ b/previews/PR2119/terminology/index.html @@ -1,2 +1,2 @@ -Terminology · HiGHS Documentation

      Terminology

      Any linear optimization model will have decision variables, a linear or quadratic objective function, and linear constraints and bounds on the values of the decision variables. A mixed-integer optimization model will require some or all of the decision variables to take integer values. The model may require the objective function to be maximized or minimized whilst satisfying the constraints and bounds. By default, HiGHS minimizes the objective function.

      Bounds and the objective function

      The bounds on a decision variable are the least and greatest values that it may take, and infinite bounds can be specified. A linear objective function is given by a set of coefficients, one for each decision variable, and its value is the sum of products of coefficients and values of decision variables. The objective coefficients are often referred to as costs, and some may be zero. When a model has been solved, the optimal values of the decision variables are referred to as the (primal) solution.

      Constraints and the feasible region

      Linear constraints require linear functions of decision variables to lie between bounds, and infinite bounds can be specified. If the bounds are equal, then the constraint is an equation. If the bounds are both finite, then the constraint is said to be boxed or two-sided. The set of points satisfying linear constraints and bounds is known as the feasible region. Geometrically, this is a multi-dimensional convex polyhedron, whose extreme points are referred to as vertices.

      The constraint matrix

      The coefficients of the linear constraints are naturally viewed as rows of a matrix. The constraint coefficients associated with a particular decision variable form a column of the constraint matrix. Hence constraints are sometimes referred to as rows, and decision variables as columns. Constraint matrix coefficients may be zero. Indeed, for large practical models it is typical for most of the coefficients to be zero. When this property can be exploited to computational advantage, the matrix is said to be sparse. When the constraint matrix is not sparse, the solution of large models is normally intractable computationally.

      Optimization outcomes

      It is possible to define a set of constraints and bounds that cannot be satisfied, in which case the model is said to be infeasible. Conversely, it is possible that the value of the objective function can be improved without bound whilst satisfying the constraints and bounds, in which case the model is said to be unbounded. If a model is neither infeasible, nor unbounded, it has an optimal solution. The optimal objective function value for a linear optimization model may be achieved at more than point, in which case the optimal solution is said to be non-unique.

      Primal values

      The values of the decision variables are referred to as primal values to distingush them from dual values.

      Dual values

      When none of the decision variables is required to take integer values, the model is said to be continuous. For continuous models, each variable and constraint has an associated dual variable. The values of the dual variables constitute the dual solution, and it is for this reason that the term primal solution is used to distinguish the optimal values of the decision variables. At the optimal solution of a continuous model, some of the decision variables and values of constraint functions will be equal to their lower or upper bounds. Such a bound is said to be active. If a variable or constraint is at a bound, its corresponding dual solution value will generally be non-zero: when at a lower bound the dual value will be non-negative; when at an upper bound the dual value will be non-positive. When maximizing the objective the required signs of the dual values are reversed. Due to their economic interpretation, the dual values associated with constraints are often referred to as shadow prices or fair prices. Mathematically, the dual values associated with variables are often referred to as reduced costs, and the dual values associated with constraints are often referred to as Lagrange multipliers.

      Basic solution

      An LP model that is neither infeasible, nor unbounded, has an optimal solution at a vertex. At a vertex, the decision variables can be partitioned into as many basic variables as there are constraints, and nonbasic variables. Such a solution is known as a basic solution, and the partition referred to as a basis.

      Sensitivity

      Analysis of the change in optimal objective value of a continuous linear optimization model as the cost coefficients and bounds are changed is referred to in HiGHS as ranging. For an active bound, the corresponding dual value gives the change in the objective if that bound is increased or decreased. This level of analysis is often referred to as sensitivity. In general, the change in the objective is only known for a limited range of values for the active bound. HiGHS will return the limits of these bound ranges ranges, the objective value at both limits and the index of a variable or constraint that will acquire an active bound at both limits. For each variable with an active bound, the solution will remain optimal for a range of values of its cost coefficient. HiGHS will return the values of these cost ranges. For a variable or constraint whose value is not at a bound, HiGHS will return the range of values that the variable or constraint can take, the objective values at the limits of the range, and the index of a variable or constraint with a bound that will become in active at both limits.

      MIP

      When solving a MIP, some or all the variables must take discrete values. In HiGHS there are three types of discrete variables.

      • Integer: those that must take integer values between their bounds
      • Semi-continuous: those that must be zero or take continuous values between their bounds
      • Semi-integer: those that must be zero or take integer values between their bounds

      In the following discussion, for ease of reference to relative objective values, it is assumed that the objective is being minimized

      Any point for which the discrete variables satisfy their requirements, is said to be integer feasible. The objective value at such a point is an upper bound on the optimal objective value. The least such bound is known as the primal bound. The MIP solver generates a sequence of LPs, each of which has bounds on the variables that are tighter than those of the original model. When unsolved, there is a bound on the optimal objective value for each such LP and, the greatest such bound is known as the dual bound. The optimal objective value of the MIP cannot be less than the dual bound. Hence the gap between the primal and dual bounds is a measure of progress of the MIP solver. Although the absolute gap is of some interest, the gap relative to the primal bound is a better measure. When the gap reaches zero then the MIP is solved to optimality. However, it is often preferable to stop the MIP solver when the relative gap is below a specified tolerance.

      +Terminology · HiGHS Documentation

      Terminology

      Any linear optimization model will have decision variables, a linear or quadratic objective function, and linear constraints and bounds on the values of the decision variables. A mixed-integer optimization model will require some or all of the decision variables to take integer values. The model may require the objective function to be maximized or minimized whilst satisfying the constraints and bounds. By default, HiGHS minimizes the objective function.

      Bounds and the objective function

      The bounds on a decision variable are the least and greatest values that it may take, and infinite bounds can be specified. A linear objective function is given by a set of coefficients, one for each decision variable, and its value is the sum of products of coefficients and values of decision variables. The objective coefficients are often referred to as costs, and some may be zero. When a model has been solved, the optimal values of the decision variables are referred to as the (primal) solution.

      Constraints and the feasible region

      Linear constraints require linear functions of decision variables to lie between bounds, and infinite bounds can be specified. If the bounds are equal, then the constraint is an equation. If the bounds are both finite, then the constraint is said to be boxed or two-sided. The set of points satisfying linear constraints and bounds is known as the feasible region. Geometrically, this is a multi-dimensional convex polyhedron, whose extreme points are referred to as vertices.

      The constraint matrix

      The coefficients of the linear constraints are naturally viewed as rows of a matrix. The constraint coefficients associated with a particular decision variable form a column of the constraint matrix. Hence constraints are sometimes referred to as rows, and decision variables as columns. Constraint matrix coefficients may be zero. Indeed, for large practical models it is typical for most of the coefficients to be zero. When this property can be exploited to computational advantage, the matrix is said to be sparse. When the constraint matrix is not sparse, the solution of large models is normally intractable computationally.

      Optimization outcomes

      It is possible to define a set of constraints and bounds that cannot be satisfied, in which case the model is said to be infeasible. Conversely, it is possible that the value of the objective function can be improved without bound whilst satisfying the constraints and bounds, in which case the model is said to be unbounded. If a model is neither infeasible, nor unbounded, it has an optimal solution. The optimal objective function value for a linear optimization model may be achieved at more than point, in which case the optimal solution is said to be non-unique.

      Primal values

      The values of the decision variables are referred to as primal values to distingush them from dual values.

      Dual values

      When none of the decision variables is required to take integer values, the model is said to be continuous. For continuous models, each variable and constraint has an associated dual variable. The values of the dual variables constitute the dual solution, and it is for this reason that the term primal solution is used to distinguish the optimal values of the decision variables. At the optimal solution of a continuous model, some of the decision variables and values of constraint functions will be equal to their lower or upper bounds. Such a bound is said to be active. If a variable or constraint is at a bound, its corresponding dual solution value will generally be non-zero: when at a lower bound the dual value will be non-negative; when at an upper bound the dual value will be non-positive. When maximizing the objective the required signs of the dual values are reversed. Due to their economic interpretation, the dual values associated with constraints are often referred to as shadow prices or fair prices. Mathematically, the dual values associated with variables are often referred to as reduced costs, and the dual values associated with constraints are often referred to as Lagrange multipliers.

      Basic solution

      An LP model that is neither infeasible, nor unbounded, has an optimal solution at a vertex. At a vertex, the decision variables can be partitioned into as many basic variables as there are constraints, and nonbasic variables. Such a solution is known as a basic solution, and the partition referred to as a basis.

      Sensitivity

      Analysis of the change in optimal objective value of a continuous linear optimization model as the cost coefficients and bounds are changed is referred to in HiGHS as ranging. For an active bound, the corresponding dual value gives the change in the objective if that bound is increased or decreased. This level of analysis is often referred to as sensitivity. In general, the change in the objective is only known for a limited range of values for the active bound. HiGHS will return the limits of these bound ranges ranges, the objective value at both limits and the index of a variable or constraint that will acquire an active bound at both limits. For each variable with an active bound, the solution will remain optimal for a range of values of its cost coefficient. HiGHS will return the values of these cost ranges. For a variable or constraint whose value is not at a bound, HiGHS will return the range of values that the variable or constraint can take, the objective values at the limits of the range, and the index of a variable or constraint with a bound that will become in active at both limits.

      MIP

      When solving a MIP, some or all the variables must take discrete values. In HiGHS there are three types of discrete variables.

      • Integer: those that must take integer values between their bounds
      • Semi-continuous: those that must be zero or take continuous values between their bounds
      • Semi-integer: those that must be zero or take integer values between their bounds

      In the following discussion, for ease of reference to relative objective values, it is assumed that the objective is being minimized

      Any point for which the discrete variables satisfy their requirements, is said to be integer feasible. The objective value at such a point is an upper bound on the optimal objective value. The least such bound is known as the primal bound. The MIP solver generates a sequence of LPs, each of which has bounds on the variables that are tighter than those of the original model. When unsolved, there is a bound on the optimal objective value for each such LP and, the greatest such bound is known as the dual bound. The optimal objective value of the MIP cannot be less than the dual bound. Hence the gap between the primal and dual bounds is a measure of progress of the MIP solver. Although the absolute gap is of some interest, the gap relative to the primal bound is a better measure. When the gap reaches zero then the MIP is solved to optimality. However, it is often preferable to stop the MIP solver when the relative gap is below a specified tolerance.