Skip to content

Commit daf829f

Browse files
committed
Update HiGHS header file to 1.9.0
1 parent 7cfffe4 commit daf829f

File tree

13 files changed

+198
-9
lines changed

13 files changed

+198
-9
lines changed

thirdparty/solvers/highs/HConfig.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
/* #undef HIGHS_HAVE_BUILTIN_CLZ */
1313
#define HIGHS_HAVE_BITSCAN_REVERSE
1414

15-
#define HIGHS_GITHASH "4a7f24ac6"
15+
#define HIGHS_GITHASH "66f735e60"
1616
#define HIGHS_VERSION_MAJOR 1
17-
#define HIGHS_VERSION_MINOR 8
18-
#define HIGHS_VERSION_PATCH 1
17+
#define HIGHS_VERSION_MINOR 9
18+
#define HIGHS_VERSION_PATCH 0
1919
#define HIGHS_DIR "E:/HiGHS"
2020

2121
#endif /* HCONFIG_H_ */

thirdparty/solvers/highs/Highs.h

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ class Highs {
150150
HighsStatus passHessian(const HighsInt dim, const HighsInt num_nz,
151151
const HighsInt format, const HighsInt* start,
152152
const HighsInt* index, const double* value);
153+
/**
154+
* @brief Pass multiple linear objectives for the incumbent model
155+
*/
156+
HighsStatus passLinearObjectives(
157+
const HighsInt num_linear_objective,
158+
const HighsLinearObjective* linear_objective);
159+
160+
/**
161+
* @brief Add a linear objective for the incumbent model
162+
*/
163+
HighsStatus addLinearObjective(const HighsLinearObjective& linear_objective,
164+
const HighsInt iObj = -1);
165+
166+
/**
167+
* @brief Clear the multiple linear objective data
168+
*/
169+
HighsStatus clearLinearObjectives();
170+
153171
/**
154172
* @brief Pass a column name to the incumbent model
155173
*/
@@ -183,7 +201,7 @@ class Highs {
183201
HighsStatus presolve();
184202

185203
/**
186-
* @brief Solve the incumbent model according to the specified options
204+
* @brief Run the solver, accounting for any multiple objective
187205
*/
188206
HighsStatus run();
189207

@@ -1197,6 +1215,14 @@ class Highs {
11971215
static void resetGlobalScheduler(bool blocking = false);
11981216

11991217
// Start of advanced methods for HiGHS MIP solver
1218+
1219+
const HighsSimplexStats& getSimplexStats() const {
1220+
return ekk_instance_.getSimplexStats();
1221+
}
1222+
void reportSimplexStats(FILE* file) const {
1223+
ekk_instance_.reportSimplexStats(file);
1224+
}
1225+
12001226
/**
12011227
* @brief Get the hot start basis data from the most recent simplex
12021228
* solve. Advanced method: for HiGHS MIP solver
@@ -1389,6 +1415,8 @@ class Highs {
13891415
ICrashInfo icrash_info_;
13901416

13911417
HighsModel model_;
1418+
std::vector<HighsLinearObjective> multi_linear_objective_;
1419+
13921420
HighsModel presolved_model_;
13931421
HighsTimer timer_;
13941422

@@ -1397,7 +1425,6 @@ class Highs {
13971425
HighsInfo info_;
13981426
HighsRanging ranging_;
13991427
HighsIis iis_;
1400-
14011428
std::vector<HighsObjectiveSolution> saved_objective_and_solution_;
14021429

14031430
HighsPresolveStatus model_presolve_status_ =
@@ -1424,6 +1451,8 @@ class Highs {
14241451

14251452
bool written_log_header = false;
14261453

1454+
HighsStatus solve();
1455+
14271456
void exactResizeModel() {
14281457
this->model_.lp_.exactResize();
14291458
this->model_.hessian_.exactResize();
@@ -1600,6 +1629,10 @@ class Highs {
16001629
HighsInt* iis_col_index, HighsInt* iis_row_index,
16011630
HighsInt* iis_col_bound, HighsInt* iis_row_bound);
16021631

1632+
HighsStatus returnFromLexicographicOptimization(
1633+
const HighsStatus return_status, HighsInt original_lp_num_row);
1634+
HighsStatus multiobjectiveSolve();
1635+
16031636
bool aFormatOk(const HighsInt num_nz, const HighsInt format);
16041637
bool qFormatOk(const HighsInt num_nz, const HighsInt format);
16051638
void clearZeroHessian();
@@ -1623,6 +1656,10 @@ class Highs {
16231656
const bool constraint,
16241657
const double ill_conditioning_bound);
16251658
bool infeasibleBoundsOk();
1659+
bool validLinearObjective(const HighsLinearObjective& linear_objective,
1660+
const HighsInt iObj) const;
1661+
bool hasRepeatedLinearObjectivePriorities(
1662+
const HighsLinearObjective* linear_objective = nullptr) const;
16261663
};
16271664

16281665
// Start of deprecated methods not in the Highs class

thirdparty/solvers/highs/interfaces/highs_c_api.h

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,72 @@ HighsInt Highs_passHessian(void* highs, const HighsInt dim,
557557
const HighsInt* start, const HighsInt* index,
558558
const double* value);
559559

560+
/**
561+
* Passes multiple linear objective data to HiGHS, clearing any such
562+
* data already in HiGHS
563+
*
564+
* @param highs A pointer to the Highs instance.
565+
* @param weight A pointer to the weights of the linear objective, with
566+
* its positive/negative sign determining whether it is
567+
* minimized or maximized during lexicographic optimization
568+
* @param offset A pointer to the objective offsets
569+
* @param coefficients A pointer to the objective coefficients
570+
* @param abs_tolerance A pointer to the absolute tolerances used when
571+
* constructing objective constraints during lexicographic
572+
* optimization
573+
* @param rel_tolerance A pointer to the relative tolerances used when
574+
* constructing objective constraints during lexicographic
575+
* optimization
576+
* @param priority A pointer to the priorities of the objectives during
577+
* lexicographic optimization
578+
*
579+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
580+
*/
581+
582+
HighsInt Highs_passLinearObjectives(const void* highs,
583+
const HighsInt num_linear_objective,
584+
const double* weight, const double* offset,
585+
const double* coefficients,
586+
const double* abs_tolerance,
587+
const double* rel_tolerance,
588+
const HighsInt* priority);
589+
590+
/**
591+
* Adds linear objective data to HiGHS
592+
*
593+
* @param highs A pointer to the Highs instance.
594+
* @param weight The weight of the linear objective, with its
595+
* positive/negative sign determining whether it is
596+
* minimized or maximized during lexicographic
597+
* optimization
598+
* @param offset The objective offset
599+
* @param coefficients A pointer to the objective coefficients
600+
* @param abs_tolerance The absolute tolerance used when constructing an
601+
* objective constraint during lexicographic optimization
602+
* @param rel_tolerance The relative tolerance used when constructing an
603+
* objective constraint during lexicographic optimization
604+
* @param priority The priority of this objective during lexicographic
605+
* optimization
606+
*
607+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
608+
*/
609+
610+
HighsInt Highs_addLinearObjective(const void* highs, const double weight,
611+
const double offset,
612+
const double* coefficients,
613+
const double abs_tolerance,
614+
const double rel_tolerance,
615+
const HighsInt priority);
616+
617+
/**
618+
* Clears any multiple linear objective data in HiGHS
619+
*
620+
* @param highs A pointer to the Highs instance.
621+
*
622+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
623+
*/
624+
625+
HighsInt Highs_clearLinearObjectives(const void* highs);
560626
/**
561627
* Pass the name of a row.
562628
*
@@ -945,7 +1011,7 @@ HighsInt Highs_getDualRay(const void* highs, HighsInt* has_dual_ray,
9451011
* filled with the unboundedness
9461012
* direction.
9471013
*/
948-
HighsInt getDualUnboundednessDirection(
1014+
HighsInt Highs_getDualUnboundednessDirection(
9491015
const void* highs, HighsInt* has_dual_unboundedness_direction,
9501016
double* dual_unboundedness_direction_value);
9511017

thirdparty/solvers/highs/lp_data/HStruct.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,28 @@ struct HighsIllConditioning {
144144
void clear();
145145
};
146146

147+
struct HighsLinearObjective {
148+
double weight;
149+
double offset;
150+
std::vector<double> coefficients;
151+
double abs_tolerance;
152+
double rel_tolerance;
153+
HighsInt priority;
154+
void clear();
155+
};
156+
157+
struct HighsSimplexStats {
158+
bool valid;
159+
HighsInt iteration_count;
160+
HighsInt num_invert;
161+
HighsInt last_invert_num_el;
162+
HighsInt last_factored_basis_num_el;
163+
double col_aq_density;
164+
double row_ep_density;
165+
double row_ap_density;
166+
double row_DSE_density;
167+
void report(FILE* file, const std::string message = "") const;
168+
void initialise(const HighsInt iteration_count_ = 0);
169+
};
170+
147171
#endif /* LP_DATA_HSTRUCT_H_ */

thirdparty/solvers/highs/lp_data/HighsOptions.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ struct HighsOptionsStruct {
348348
// Options for IIS calculation
349349
HighsInt iis_strategy;
350350

351+
// Option for multi-objective optimization
352+
bool blend_multi_objectives;
353+
351354
// Advanced options
352355
HighsInt log_dev_level;
353356
bool log_githash;
@@ -485,6 +488,8 @@ struct HighsOptionsStruct {
485488
pdlp_d_gap_tol(0.0),
486489
qp_iteration_limit(0),
487490
qp_nullspace_limit(0),
491+
iis_strategy(0),
492+
blend_multi_objectives(false),
488493
log_dev_level(0),
489494
log_githash(false),
490495
solve_relaxation(false),
@@ -1120,6 +1125,12 @@ class HighsOptions : public HighsOptionsStruct {
11201125
kIisStrategyMax);
11211126
records.push_back(record_int);
11221127

1128+
record_bool = new OptionRecordBool(
1129+
"blend_multi_objectives",
1130+
"Blend multiple objectives or apply lexicographically: Default = true",
1131+
advanced, &blend_multi_objectives, true);
1132+
records.push_back(record_bool);
1133+
11231134
// Fix the number of user settable options
11241135
num_user_settable_options_ = static_cast<HighsInt>(records.size());
11251136

thirdparty/solvers/highs/mip/HighsCutGeneration.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ class HighsCutGeneration {
7373
bool preprocessBaseInequality(bool& hasUnboundedInts, bool& hasGeneralInts,
7474
bool& hasContinuous);
7575

76+
void flipComplementation(HighsInt index);
77+
78+
void removeComplementation();
79+
80+
void updateViolationAndNorm(HighsInt index, double aj, double& violation,
81+
double& norm) const;
82+
83+
bool tryGenerateCut(std::vector<HighsInt>& inds, std::vector<double>& vals,
84+
bool hasUnboundedInts, bool hasGeneralInts,
85+
bool hasContinuous, double minEfficacy,
86+
bool onlyInitialCMIRScale = false,
87+
bool allowRejectCut = true, bool lpSol = true);
88+
7689
public:
7790
HighsCutGeneration(const HighsLpRelaxation& lpRelaxation,
7891
HighsCutPool& cutpool);

thirdparty/solvers/highs/presolve/HPresolve.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,16 @@ class HPresolve {
315315

316316
Result singletonCol(HighsPostsolveStack& postsolve_stack, HighsInt col);
317317

318+
void substituteFreeCol(HighsPostsolveStack& postsolve_stack, HighsInt row,
319+
HighsInt col, bool relaxRowDualBounds = false);
320+
318321
Result rowPresolve(HighsPostsolveStack& postsolve_stack, HighsInt row);
319322

320323
Result colPresolve(HighsPostsolveStack& postsolve_stack, HighsInt col);
321324

325+
Result detectDominatedCol(HighsPostsolveStack& postsolve_stack, HighsInt col,
326+
bool handleSingletonRows = true);
327+
322328
Result initialRowAndColPresolve(HighsPostsolveStack& postsolve_stack);
323329

324330
HighsModelStatus run(HighsPostsolveStack& postsolve_stack);
@@ -356,6 +362,11 @@ class HPresolve {
356362

357363
Result detectParallelRowsAndCols(HighsPostsolveStack& postsolve_stack);
358364

365+
template <typename RowStorageFormat>
366+
Result equalityRowAddition(HighsPostsolveStack& postsolve_stack,
367+
HighsInt stayrow, HighsInt removerow, double scale,
368+
const HighsMatrixSlice<RowStorageFormat>& vector);
369+
359370
Result sparsify(HighsPostsolveStack& postsolve_stack);
360371

361372
void setRelaxedImpliedBounds();

thirdparty/solvers/highs/simplex/HApp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ inline HighsStatus solveLpSimplex(HighsLpSolverObject& solver_object) {
112112
// return
113113
resetModelStatusAndHighsInfo(solver_object);
114114

115+
// Initialise the simplex stats
116+
ekk_instance.initialiseSimplexStats();
117+
115118
// Assumes that the LP has a positive number of rows, since
116119
// unconstrained LPs should be solved in solveLp
117120
bool positive_num_row = solver_object.lp_.num_row_ > 0;

thirdparty/solvers/highs/simplex/HEkk.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ class HEkk {
156156
const vector<double>& rowLower,
157157
const vector<double>& rowUpper);
158158

159+
const HighsSimplexStats& getSimplexStats() const { return simplex_stats_; }
160+
void initialiseSimplexStats() { simplex_stats_.initialise(iteration_count_); }
161+
void reportSimplexStats(FILE* file, const std::string message = "") const {
162+
simplex_stats_.report(file, message);
163+
}
164+
159165
// Make this private later
160166
void chooseSimplexStrategyThreads(const HighsOptions& options,
161167
HighsSimplexInfo& info);
@@ -255,6 +261,8 @@ class HEkk {
255261
std::vector<HighsSimplexBadBasisChangeRecord> bad_basis_change_;
256262
std::vector<double> primal_phase1_dual_;
257263

264+
HighsSimplexStats simplex_stats_;
265+
258266
private:
259267
bool isUnconstrainedLp();
260268
void initialiseForSolve();

thirdparty/solvers/highs/simplex/HighsSimplexAnalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ class HighsSimplexAnalysis {
251251
void reportFactorTimer();
252252
void updateInvertFormData(const HFactor& factor);
253253
void reportInvertFormData();
254+
HighsInt numInvert() { return num_invert; }
254255

255256
// Control methods to be moved to HEkkControl
256257
void dualSteepestEdgeWeightError(const double computed_edge_weight,

0 commit comments

Comments
 (0)