Skip to content

Commit

Permalink
Added documentation on the use of presolve when solving an incumbent …
Browse files Browse the repository at this point in the history
…model, and clarifying the use of the method .
  • Loading branch information
jajhall committed Sep 26, 2024
1 parent f8b01c8 commit b1a8a8c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
4 changes: 4 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Methods receiving matrix data where only small values are explicit zeros (so rem

Now multiplying by pre-computed reciprocals rather than performing divisions in loops in simplex solver: LP performance improvement ~2.5%

Added documentation on the use of presolve when solving an incumbent model, and clarifying the use of the method `Highs::presolve`.






Expand Down
30 changes: 26 additions & 4 deletions docs/src/guide/further.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ is [changeRowsBounds](@ref Modify-model-data). An individual matrix coefficient
is changed by passing its row index, column index and new value to
[changeCoeff](@ref Modify-model-data).

### [Hot start](@id hot-start)
## [Hot start](@id 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
### LP

To run HiGHS from a user-defined solution or basis, this is passed to HiGHS
using the methods [setSolution](@ref Set-solution) or [setBasis](@ref Set-basis). The basis passed to HiGHS need not be complete
Expand All @@ -71,7 +71,7 @@ using the methods [setSolution](@ref Set-solution) or [setBasis](@ref Set-basis)
* For nonbasic variables, it is unnecessary to specify whether they
are at their lower or upper bound unless they are "boxed" variables.

#### MIP
### MIP

If a (partial) feasible assignment of the integer variables is known,
this can be passed to HiGHS via [setSolution](@ref Set-solution). If
Expand All @@ -81,4 +81,26 @@ 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](@id guide-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](@ref option-presolve) option to
"off".

HiGHS has a method [presolve](@ref Presolve/postsolve) 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](@ref Presolve/postsolve)
methods, according to whether there are just solution values, or also
a basis.
17 changes: 17 additions & 0 deletions docs/src/interfaces/python/example-py.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,20 @@ print('Basis validity = ', h.basisValidityToString(info.basis_validity))
## Set basis

* `setBasis`

## Presolve/postsolve

* `presolve`
* `getPresolvedLp`
* `getPresolvedModel`
* `getPresolveLog`
* `getPresolveOrigColsIndex`
* `getPresolveOrigRowsIndex`
* `getModelPresolveStatus`
* `writePresolvedModel`
* `presolveStatusToString`
* `presolveRuleTypeToString`
* `postsolve`



2 changes: 1 addition & 1 deletion docs/src/options/definitions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [List of options](@id option-definitions)

## presolve
## [presolve](@id option-presolve)
- Presolve option: "off", "choose" or "on"
- Type: string
- Default: "choose"
Expand Down
4 changes: 3 additions & 1 deletion src/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ class Highs {
HighsStatus readBasis(const std::string& filename);

/**
* @brief Presolve the incumbent model
* @brief Presolve the incumbent model, allowing the presolved model
* to be extracted. Subsequent solution of the incumbent model will
* only use presolve if there is no valid basis
*/
HighsStatus presolve();

Expand Down

0 comments on commit b1a8a8c

Please sign in to comment.