Closed chrhansk closed 5 months ago
There's only ever one "basis" in the HiGHS simplex solver, and it is of dimension num_rows
. This is true of any simplex solver except the weird stuff in Soplex and (hence) CPLEX. Hence I didn't feel that it was necessary to specify the dimension of the RHS and solution in these calls.
Given an LP in the format above, HiGHS introduces (implicit) slack variables so that it has an equation system $Ax+y=0$, where $-U\le y\le -L$. A basis is given by a set of num_rows
(basic) variables whose values are solved using the equations once the remaining num_cols
(nonbasic) variables have been fixed - normally at bounds. Hence the only known "invertible representation" is of the matrix of dimension num_rows
formed by the columns of $[A~ I]$ corresponding to the basic variables.
In the example, what you refer to as the "row basis" corresponds to the nonbasic slacks. It has a "kernel" role in Soplex, but isn't identified specifically in HiGHS.
When num_rows
>= num_cols
, it is the matrix $B_0$ in the basis matrix
$$\left[ \begin{matrix} B_0&\ B_1&I \end{matrix}\right] $$
Hence, with HiGHS, it is still possible to solve systems involving this matrix $B_0$ by augmenting the RHS of dimension num_cols
with zero values - whether the regular or transposed system is to be solved.
When num_rows
< num_cols
, the HiGHS basis matrix takes the role of $B_0$ in the above, and the systems involving your matrix can be solved, since the non-trivial part of the solve involves the HiGHS basis matrix.
I an wondering about the documentation specifically of the functions
As far as I see, the type of LPs HiGHs expects to solve are given as
$$ \begin{aligned} \min_{x} & c^{T} x \ \text{s.t. } & L \leq Ax \leq U\ & l \leq x \leq u \end{aligned} $$
where $A$ is
num_rows
timesnum_cols
, $L, U$num_rows
, and $l, u$num_cols
(fornum_cols = Highs_getNumCol()
andnum_rows = Highs_getNumRow()
)As far as I see it, a (row) basis of this problem should consist of
num_cols
of the inequalities and bounds, forming a regular matrix, which, when solved against their respective right hand sides should reproduce the associated basic solution. In particular, if $A$ is empty, the row basis should consist only of variable bounds, and the corresponding matrix should be the identity. This matrix should (?) coincide with the basis matrixB
mentioned in the documentation.I would like to use the functions above in order to solve
B
against a right-hand side, but I am confused regarding the dimensions in the documentation:b
is not specified (I assumed it should benum_rows
as well?)num_rows
entries.I would have thought that input / output have a size equal to the size of the row basis (
num_cols
). I tried to understand the operations using an example:The row basis consists of constraints 2 & 3 at their lower bounds, producing the solution (.5, 2.25). So I would have expected that solving the basis would solve against the corresponding matrix
$$ \begin{pmatrix} 1 & 2 \ 3 & 2 \end{pmatrix}, $$
which would have inputs and outputs in R^2. This does not seem to be the case however as the input and output is in R^3.
Could you explain to me the definition of the basis matrix and the semantics of the two functions?