Skip to content

Commit 89d9bd8

Browse files
committed
Updated documentation of HighsOptions and HighsInfo
1 parent 3a458de commit 89d9bd8

File tree

5 files changed

+163
-16
lines changed

5 files changed

+163
-16
lines changed

FEATURES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ Scaling the tolerance in forcing row reduction to avoid use of rows with small c
3636

3737
Fixed bug when calculating a coefficient in one of the cuts in `separateImpliedBounds` in `highs/mip/HighsImplications.cpp`
3838

39-
Added `CSECTION` to the exceptions for keywords that are followed by text, and thus cannot be used as names of columns, RHS, ranges, bounds etc,
39+
Added `CSECTION` to the exceptions for keywords that are followed by text, and thus cannot be used as names of columns, RHS, ranges, bounds etc.
40+
41+
Introduced the following KKT error measures to `HighsInfo`: `num_relative_primal_infeasibilities`; `max_relative_primal_infeasibility`; `num_relative_dual_infeasibilities`; `max_relative_dual_infeasibility`; `num_primal_residual_errors`; `max_primal_residual_error`; `num_dual_residual_errors`; `max_dual_residual_error`; `num_relative_primal_residual_errors`; `max_relative_primal_residual_error`; `num_relative_dual_residual_errors`; `max_relative_dual_residual_error`; `num_complementarity_violations`; `max_complementarity_violation`; `primal_dual_objective_error.` The relative values are used to assess whether a solution deemed to be optimal by the first order LP solver `cuPDLP-C` or interior point solver `IPX` (without crossover) is truly acceptable. They also enable users to determine whether a solution corresponding to `HighsModelStatus::kUnknown` is acceptable to them as optimal. Also introduced options `complementarity_tolerance` used to assess whether the (relative) primal-dual objective error is acceptable, and `kkt_tolerance` which, if set to a value other than `kDefaultKktTolerance = 1e-7` is used as the tolerance for all the KKT error measures. The HiGHS documentation has been updated to reflect the new options and `HighsInfo` data, and logging messages indicate when KKT error measures are not satisfied, despite the solver considering the LP solution to be optimal.
4042

4143

4244

app/RunHighs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ int main(int argc, char** argv) {
7575
// call this first so that printHighsVersionCopyright uses reporting
7676
// settings defined in any options file.
7777
highs.passOptions(loaded_options);
78-
// highs.writeOptions("Options.md");
7978
highs.writeOptions("", true);
8079

80+
// Lines to write out documentation of HighsOptions and HighsInfo
81+
// highs.writeOptions("Options.md");
82+
// highs.writeInfo("Info.md");
83+
8184
// Load the model from model_file
8285
HighsStatus read_status = highs.readModel(cmd_options.model_file);
8386
if (read_status == HighsStatus::kError) {
@@ -107,8 +110,6 @@ int main(int argc, char** argv) {
107110
HighsStatus run_status = highs.run();
108111
if (run_status == HighsStatus::kError) return int(run_status);
109112

110-
// highs.writeInfo("Info.md");
111-
112113
// Shut down task executor for explicit release of memory.
113114
// Valgrind still reachable otherwise.
114115
highs.resetGlobalScheduler(true);

docs/src/options/definitions.md

Lines changed: 78 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
- Range: [1, inf]
5656
- Default: 1e+15
5757

58+
## kkt\_tolerance
59+
- KKT tolerance
60+
- Type: double
61+
- Range: [1e-10, inf]
62+
- Default: 1e-07
63+
5864
## primal\_feasibility\_tolerance
5965
- Primal feasibility tolerance
6066
- Type: double
@@ -79,6 +85,12 @@
7985
- Range: [1e-10, inf]
8086
- Default: 1e-07
8187

88+
## complementarity\_tolerance
89+
- Primal-dual objective error tolerance
90+
- Type: double
91+
- Range: [1e-10, inf]
92+
- Default: 1e-07
93+
8294
## dual\_residual\_tolerance
8395
- Dual residual tolerance
8496
- Type: double
@@ -130,8 +142,8 @@
130142
## simplex\_scale\_strategy
131143
- Simplex scaling strategy: off / choose / equilibration (default) / forced equilibration / max value (0/1/2/3/4)
132144
- Type: integer
133-
- Range: {0, 5}
134-
- Default: 1
145+
- Range: {0, 4}
146+
- Default: 2
135147

136148
## simplex\_dual\_edge\_weight\_strategy
137149
- Strategy for simplex dual edge weights: Choose / Dantzig / Devex / Steepest Edge (-1/0/1/2)
@@ -200,11 +212,31 @@
200212
- Range: {-2, 2147483647}
201213
- Default: 0
202214

215+
## read\_solution\_file
216+
- Read solution file
217+
- Type: string
218+
- Default: ""
219+
220+
## read\_basis\_file
221+
- Read basis file
222+
- Type: string
223+
- Default: ""
224+
203225
## write\_model\_file
204226
- Write model file
205227
- Type: string
206228
- Default: ""
207229

230+
## solution\_file
231+
- Write solution file
232+
- Type: string
233+
- Default: ""
234+
235+
## write\_basis\_file
236+
- Write basis file
237+
- Type: string
238+
- Default: ""
239+
208240
## write\_model\_to\_file
209241
- Write the model to a file
210242
- Type: boolean
@@ -230,6 +262,11 @@
230262
- Type: boolean
231263
- Default: "true"
232264

265+
## mip\_allow\_feasibility\_jump
266+
- Whether MIP feasibility jump is permitted
267+
- Type: boolean
268+
- Default: "true"
269+
233270
## mip\_max\_nodes
234271
- MIP solver max number of nodes
235272
- Type: integer
@@ -263,6 +300,17 @@
263300
- Type: string
264301
- Default: ""
265302

303+
## mip\_root\_presolve\_only
304+
- Whether MIP presolve is only applied at the root node
305+
- Type: boolean
306+
- Default: "false"
307+
308+
## mip\_lifting\_for\_probing
309+
- Level of lifting for probing that is used
310+
- Type: integer
311+
- Range: {-1, 2147483647}
312+
- Default: -1
313+
266314
## mip\_max\_leaves
267315
- MIP solver max number of leaf nodes
268316
- Type: integer
@@ -306,7 +354,7 @@
306354
- Default: 100000
307355

308356
## mip\_feasibility\_tolerance
309-
- MIP feasibility tolerance
357+
- MIP integrality tolerance
310358
- Type: double
311359
- Range: [1e-10, inf]
312360
- Default: 1e-06
@@ -317,6 +365,31 @@
317365
- Range: [0, 1]
318366
- Default: 0.05
319367

368+
## mip\_heuristic\_run\_rins
369+
- Run RINS heuristic: Default = true
370+
- Type: boolean
371+
- Default: "true"
372+
373+
## mip\_heuristic\_run\_rens
374+
- Run RENS heuristic: Default = true
375+
- Type: boolean
376+
- Default: "true"
377+
378+
## mip\_heuristic\_run\_root\_reduced\_cost
379+
- Run rootReducedCost heuristic: Default = true
380+
- Type: boolean
381+
- Default: "true"
382+
383+
## mip\_heuristic\_run\_zi\_round
384+
- Run ZI Round heuristic: Default = false
385+
- Type: boolean
386+
- Default: "false"
387+
388+
## mip\_heuristic\_run\_shifting
389+
- Run Shifting heuristic: Default = false
390+
- Type: boolean
391+
- Default: "false"
392+
320393
## mip\_rel\_gap
321394
- Tolerance on relative gap, |ub-lb|/|ub|, to determine whether optimality has been reached for a MIP instance
322395
- Type: double
@@ -364,10 +437,10 @@
364437
- Default: 1
365438

366439
## pdlp\_d\_gap\_tol
367-
- Duality gap tolerance for PDLP solver: Default = 1e-4
440+
- Duality gap tolerance for PDLP solver
368441
- Type: double
369442
- Range: [1e-12, inf]
370-
- Default: 0.0001
443+
- Default: 1e-07
371444

372445
## qp\_iteration\_limit
373446
- Iteration limit for QP solver

docs/src/structures/structs/HighsInfo.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Scalar information about a solved model is communicated via an instance of the H
1818
- The number of crossover iterations performed
1919
- Type: integer
2020

21+
## pdlp\_iteration\_count
22+
- The number of PDLP iterations performed
23+
- Type: integer
24+
2125
## qp\_iteration\_count
2226
- The number of QP iterations performed
2327
- Type: integer
@@ -71,10 +75,74 @@ Scalar information about a solved model is communicated via an instance of the H
7175
- Type: integer
7276

7377
## max\_dual\_infeasibility
74-
- The maximum dual feasibility violation
78+
- The maximum violation of dual feasibility
7579
- Type: double
7680

7781
## sum\_dual\_infeasibilities
78-
- The sum of dual feasibility violations
82+
- The sum of violations of dual feasibility
83+
- Type: double
84+
85+
## num\_relative\_primal\_infeasibilities
86+
- The number of variables violating a bound by relatively more than the [primal feasibility tolerance](@ref primal_feasibility_tolerance).
87+
- Type: integer
88+
89+
## max\_relative\_primal\_infeasibility
90+
- The maximum relative violation of a bound on a variable
91+
- Type: double
92+
93+
## num\_relative\_dual\_infeasibilities
94+
- The number of variables violating dual feasibility by relatively more than the [dual feasibility tolerance](@ref dual_feasibility_tolerance).
95+
- Type: integer
96+
97+
## max\_relative\_dual\_infeasibility
98+
- The maximum relative violation of dual feasibility
99+
- Type: double
100+
101+
## num\_primal\_residual\_errors
102+
- The number of primal equations violated by more than the [primal residual tolerance](@ref primal_residual_tolerance).
103+
- Type: integer
104+
105+
## max\_primal\_residual\_error
106+
- The maximum violation of primal equations
107+
- Type: double
108+
109+
## num\_dual\_residual\_errors
110+
- The number of dual equations violated by more than the [dual residual tolerance](@ref dual_residual_tolerance).
111+
- Type: integer
112+
113+
## max\_dual\_residual\_error
114+
- The maximum violation of dual equations
115+
- Type: double
116+
117+
## num\_relative\_primal\_residual\_errors
118+
- The number of primal equations violated by relatively more than the [primal residual tolerance](@ref primal_residual_tolerance).
119+
- Type: integer
120+
121+
## max\_relative\_primal\_residual\_error
122+
- The maximum relative violation of primal equations
123+
- Type: double
124+
125+
## num\_relative\_dual\_residual\_errors
126+
- The number of dual equations violated by relatively more than the [dual residual tolerance](@ref dual_residual_tolerance).
127+
- Type: integer
128+
129+
## max\_relative\_dual\_residual\_error
130+
- The maximum relative violation of dual equations
131+
- Type: double
132+
133+
## num\_complementarity\_violations
134+
- The number of violations of primal-dual complementarity
135+
- Type: integer
136+
137+
## max\_complementarity\_violation
138+
- The maximum primal-dual complementarity violation
139+
- Type: double
140+
141+
## primal\_dual\_objective\_error
142+
- The relative difference between the primal and dual objective values (LP only)
143+
- Type: double
144+
145+
## primal\_dual\_integral
146+
- The primal-dual integral for MIPs
79147
- Type: double
80148

highs/lp_data/HighsOptions.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,11 @@ class HighsOptions : public HighsOptionsStruct {
726726
advanced, &large_matrix_value, 1e0, 1e15, kHighsInf);
727727
records.push_back(record_double);
728728

729-
record_double = new OptionRecordDouble("kkt_tolerance", "KKT tolerance",
730-
advanced, &kkt_tolerance, 1e-10,
731-
kDefaultKktTolerance, kHighsInf);
729+
record_double = new OptionRecordDouble(
730+
"kkt_tolerance",
731+
"If not set to 1e-7, this KKT tolerance is used for all feasibility "
732+
"and optimality measures",
733+
advanced, &kkt_tolerance, 1e-10, kDefaultKktTolerance, kHighsInf);
732734
records.push_back(record_double);
733735

734736
record_double = new OptionRecordDouble(
@@ -754,8 +756,9 @@ class HighsOptions : public HighsOptionsStruct {
754756
records.push_back(record_double);
755757

756758
record_double = new OptionRecordDouble(
757-
"complementarity_tolerance", "Complementarity tolerance", advanced,
758-
&complementarity_tolerance, 1e-10, kDefaultKktTolerance, kHighsInf);
759+
"complementarity_tolerance", "Primal-dual objective error tolerance",
760+
advanced, &complementarity_tolerance, 1e-10, kDefaultKktTolerance,
761+
kHighsInf);
759762
records.push_back(record_double);
760763

761764
record_double = new OptionRecordDouble(

0 commit comments

Comments
 (0)