Skip to content

Commit 8b13060

Browse files
committed
Merge branch 'latest' into py-hipo
2 parents 30aeda2 + cc5b4e1 commit 8b13060

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+838
-961
lines changed

check/TestIis.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,23 @@ TEST_CASE("lp-get-iis", "[iis]") {
207207
highs.setOptionValue("output_flag", dev_run);
208208
highs.passModel(lp);
209209
HighsIis iis;
210-
REQUIRE(highs.getIis(iis) == HighsStatus::kOk);
211-
REQUIRE(highs.getModelStatus() == HighsModelStatus::kInfeasible);
212-
REQUIRE(iis.col_index_.size() == 2);
213-
REQUIRE(iis.row_index_.size() == 1);
214-
REQUIRE(iis.col_index_[0] == 0);
215-
REQUIRE(iis.col_index_[1] == 1);
216-
REQUIRE(iis.row_index_[0] == 2);
217-
210+
const HighsLp& highs_lp = highs.getLp();
211+
// First pass with incumbent matrix colwise; second with it
212+
// rowwise
213+
highs.ensureColwise();
214+
REQUIRE(highs_lp.a_matrix_.isColwise());
215+
for (HighsInt k = 0; k < 2; k++) {
216+
REQUIRE(highs.getIis(iis) == HighsStatus::kOk);
217+
REQUIRE(highs.getModelStatus() == HighsModelStatus::kInfeasible);
218+
REQUIRE(iis.col_index_.size() == 2);
219+
REQUIRE(iis.row_index_.size() == 1);
220+
REQUIRE(iis.col_index_[0] == 0);
221+
REQUIRE(iis.col_index_[1] == 1);
222+
REQUIRE(iis.row_index_[0] == 2);
223+
highs.clearSolver();
224+
highs.ensureRowwise();
225+
REQUIRE(highs_lp.a_matrix_.isRowwise());
226+
}
218227
highs.resetGlobalScheduler(true);
219228
}
220229

@@ -397,7 +406,7 @@ void testMps(std::string& model, const HighsInt iis_strategy,
397406
std::string model_file =
398407
std::string(HIGHS_DIR) + "/check/instances/" + model + ".mps";
399408
Highs highs;
400-
highs.setOptionValue("output_flag", dev_run);
409+
// highs.setOptionValue("output_flag", dev_run);
401410

402411
REQUIRE(highs.readModel(model_file) == HighsStatus::kOk);
403412
// if (iis_strategy == kIisStrategyFromRayRowPriority ||

check/TestMipSolver.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,3 +1279,16 @@ TEST_CASE("row-fixed-lp", "[highs_test_mip_solver]") {
12791279

12801280
h.resetGlobalScheduler(true);
12811281
}
1282+
1283+
TEST_CASE("issue-2585", "[highs_test_mip_solver]") {
1284+
std::string filename =
1285+
std::string(HIGHS_DIR) + "/check/instances/issue-2585.lp";
1286+
Highs highs;
1287+
highs.setOptionValue("output_flag", dev_run);
1288+
highs.setOptionValue("mip_rel_gap", 0);
1289+
highs.setOptionValue("mip_abs_gap", 0);
1290+
highs.readModel(filename);
1291+
const HighsModelStatus require_model_status = HighsModelStatus::kOptimal;
1292+
const double optimal_objective = -175.91;
1293+
solve(highs, kHighsOnString, require_model_status, optimal_objective);
1294+
}

check/instances/issue-2585.lp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Minimize -24 a + 5 b + 7.4 c + 9 d
2+
Subject To
3+
96.55 a - 32.45 c + 88.78 d <= 1216.06
4+
-3.14 a - 78.02 b <= -50.5404
5+
11.8 b - 21.94 c <= 3.422
6+
91.59 c - 10.58 d <= -35.25
7+
79.17 a + 1.73 b - 73.23 d <= 411.403
8+
-10.61 a - 94.66 b + 76.88 d <= 195.69
9+
Bounds
10+
-100 <= a <= 100
11+
-100 <= b <= 100
12+
-100 <= c <= 100
13+
-100 <= d <= 100
14+
Generals
15+
c d
16+
End

cmake/sources.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ set(hipo_sources
184184
ipm/hipo/ipm/Iterate.cpp
185185
ipm/hipo/ipm/LogHighs.cpp
186186
ipm/hipo/ipm/Model.cpp
187+
ipm/hipo/ipm/Refine.cpp
187188
ipm/hipo/ipm/Solver.cpp)
188189

189190
set(hipo_headers

docs/make.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
* *
33
* This file is part of the HiGHS linear optimization suite *
44
* *
5-
* Written and engineered 2008-2024 by Julian Hall, Ivet Galabova, *
6-
* Leona Gottwald and Michael Feldmeier *
7-
* *
85
* Available as open-source under the MIT License *
96
* *
107
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *=#
@@ -68,7 +65,8 @@ Documenter.makedocs(
6865
"structures/classes/HighsSparseMatrix.md",
6966
"structures/classes/HighsLp.md",
7067
"structures/classes/HighsHessian.md",
71-
"structures/classes/HighsModel.md"
68+
"structures/classes/HighsModel.md",
69+
"structures/classes/HighsIis.md"
7270
],
7371
"Structures" => Any[
7472
"structures/structs/index.md",

docs/src/guide/advanced.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,34 @@ and
2929
yield a specific row or column of ``B^{-1}A``. In all cases,
3030
HiGHS can return the number and indices of the nonzeros in the result.
3131

32+
## [Irreducible infeasibility system (IIS) detection](@id highs-iis)
33+
34+
An Irreducible infeasibility system (IIS) consists of a set of
35+
variables and a set of constraints in a model, together with
36+
variable/constraint bound information, that cannot be satisfied (so is
37+
infeasible). It is irreducible in that if any constraint or variable
38+
bound is removed, then the system can be satisfied (so is feasible).
39+
40+
HiGHS has an IIS facility that is under development. Currently it can
41+
only be used for LPs. The full IIS calculation is expensive, since it
42+
requires the solution of multiple LPs. Although there is a prototype
43+
implementation, it is not as robust or efficient as it will
44+
be. Otherwise, there is a simple, cheap test that looks for
45+
infeasibility due to incompatible variable oe constraint bounds, or
46+
constraint bounds that cannot be satisfied given the range of values
47+
on the constraint activity implied by bounds on variables.
48+
49+
The choice of IIS strategy is defined by the [iis_strategy](@id option-iis-strategy) option, which can take the value
50+
51+
- `kIisStrategyLight` = 0: The cheap test
52+
- `kIisStrategyFromLpRowPriority` = 1: The full IIS calculation, aiming to have a minimal number of rows in the IIS
53+
- `kIisStrategyFromLpColPriority` = 2: The full IIS calculation, aiming to have a minimal number of columns in the IIS
54+
55+
### IIS-related methods in the `Highs` class
56+
57+
- `const HighsLp& getIisLp()`: Return a const reference to the internal IIS LP instance
58+
- `HighsStatus getIis(HighsIis& iis)`: Try to find an IIS for the incumbent model. Gets the internal [HighsIis](@ref) instance, returning `HighsStatus::kError` if the calculation failed. Note that if the incumbent model is found to be feasible, this is a "success", and `HighsStatus::kOk` is returned.
59+
- ` HighsStatus writeIisModel(const std::string& filename = "")`: Write out the internal IIS LP instance to a file.
60+
61+
62+

docs/src/guide/further.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ linear objective is represented by the following data, held in the
125125

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

128-
- [addLinearObjective](@ref Multi-objective-optimization] - Add a single `HighsLinearObjective` instance to any already stored in HiGHS
129-
- [clearLinearObjectives](@ref Multi-objective-optimization] - Clears any linear objectives stored in HiGHS
128+
- [addLinearObjective](@ref Multi-objective-optimization) - Add a single `HighsLinearObjective` instance to any already stored in HiGHS
129+
- [clearLinearObjectives](@ref Multi-objective-optimization) - Clears any linear objectives stored in HiGHS
130130

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

docs/src/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ git checkout 521-ts
3939

4040
Then build with
4141
```
42-
cmake -S. -B build
43-
-DGKLIB_PATH=/path_to_METIS_repo/GKlib
42+
cmake -S. -B build \
43+
-DGKLIB_PATH=/path_to_METIS_repo/GKlib \
4444
-DCMAKE_INSTALL_PREFIX=path_to_installs_dir
4545
cmake --build build
4646
cmake --install build

docs/src/options/definitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
- Range: [0, inf]
487487
- Default: 1e-07
488488

489-
## iis\_strategy
489+
## [iis\_strategy](@id option-iis-strategy)
490490
- Strategy for IIS calculation: Light test / Full and prioritise rows / Full and prioritise columns (0/1/2)
491491
- Type: integer
492492
- Range: {0, 2}

docs/src/structures/classes/HighsHessian.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
A Hessian matrix is communicated via an instance of the HighsHessian class.
44

5-
- dim_: Scalar of type integer - Dimension of the Hessian
6-
- format\_: Scalar of [HessianFormat](@ref) type - Format of the Hessian
7-
- start\_: Vector of integer type - Start of each compressed column in the Hessian
8-
- index\_: Vector of integer type - Indices of the nonzeros in the Hessian
9-
- value\_: Vector of double type - Values of the nonzeros in the Hessian
5+
- `dim_`: Scalar of type integer - Dimension of the Hessian
6+
- `format_`: Scalar of [HessianFormat](@ref) type - Format of the Hessian
7+
- `start_`: Vector of integer type - Start of each compressed column in the Hessian
8+
- `index_`: Vector of integer type - Indices of the nonzeros in the Hessian
9+
- `value_`: Vector of double type - Values of the nonzeros in the Hessian

0 commit comments

Comments
 (0)