Learn R Programming

highs (version 1.9.0-1)

highs_solver: Highs Solver

Description

Create a wrapper around the HiGHS solver. Manly usefull if one wants a low level wrapper around highs with hot-start capabilities.

Usage

highs_solver(model, control = highs_control())

Value

an object of class "highs_solver".

Arguments

model

an object of class "highs_model" created with highs_model().

control

an object of class "highs_control" created with highs_control().

Details

Methods
The following methods are provided by the "highs_solver" class.

  • solve(...) method to be called to solve the optimization problem. Returns an integer giving the status code returned by HiGHS.

  • status() method to obtain the status from the solver.

  • status_message() method to obtain the status message from the solver.

  • solution() method to obtain the solution from the solver.

  • info() info to obtain addtional information from the solver.

  • L(i, v) method to get and set the linear part of the objective.

  • A(i, j, v) method to get and set the constraint matrix coefficients.

  • cbounds(i, lhs, rhs) method to get and set the constraint bounds (left hand-side and right hand-side).

  • types(i, v) method to get and set the variable types.

  • vbounds(i, lower, upper) method to get and set the variable bounds.

  • maximum(maximize) method to get and set the sense of the problem.

Method arguments

  • ... optional control arguments, which can be used to alter the options set via the control argument when initializing the solver.

  • i a vector of integers giving the index (vector index or row index) of the coeficcients to be altered.

  • j a vector of integers giving the index (column index) of the coeficcients to be altered.

  • v a vector of doubles giving the values of the coeficcients to be altered.

  • lhs a vector of doubles giving left hand-side.

  • rhs a vector of doubles giving right hand-side.

  • lower a vector of doubles giving the lower bounds to be altered.

  • upper a vector of doubles giving the upper bounds to be altered.

Examples

Run this code
A <- rbind(c(0, 1), c(1, 2), c(3, 2))
m <- highs_model(L = c(1.0, 1), lower = c(0, 1), upper = c(4, Inf),
                 A = A, lhs = c(-Inf, 5, 6), rhs = c(7, 15, Inf),
                 offset = 3)
solver <- highs_solver(m)

Run the code above in your browser using DataLab