Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing a deterministic decision on whether to compute the analytic centre in MIP #2062

Open
wants to merge 42 commits into
base: latest
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fdc149a
Make analytic centre calculation an option - allowing true calculatio…
jajhall Nov 25, 2024
2eb63d3
Now not attempring AC calculation in sub-MIP if it failed (or was not…
jajhall Nov 25, 2024
b62b112
Introduce kkt_iter_limit
jajhall Nov 25, 2024
0bb8cf0
Now to get data on max CG iterations
jajhall Nov 25, 2024
2e180e7
changed iter to iterSum in IPX
jajhall Nov 25, 2024
ddd52b3
Ready to do some testing to identify limit on KKT iterations
jajhall Nov 25, 2024
f3ff0b4
Now to test AC, gathering more data
jajhall Nov 26, 2024
150f4f3
Fixed std::max error in HighsMipSolverDat.cpp:324
jajhall Nov 26, 2024
7feb354
Cast 100 to HighsInt in HighsMipSolverData.cpp
jajhall Nov 26, 2024
57c5f4c
Now to introduce control of kkt iteration limit for phase 1
jajhall Nov 27, 2024
39f712d
Test 100 MIP with proposed cr1 and cr2 limits
jajhall Nov 27, 2024
b981b61
Extract current fill from IPX basis
jajhall Nov 27, 2024
45545b7
Now extracting fill factors for IPX basis factorization
jajhall Nov 27, 2024
b6f29b8
Reporting IPX fill factor, and added timeout to AC solve
jajhall Nov 28, 2024
a201c95
Merge branch 'latest' into fix-2049
jajhall Nov 28, 2024
d05a2d6
Added lp_data/HighsSolutionStats.h
jajhall Nov 28, 2024
4f393aa
Now including simplex stats in IPX
jajhall Nov 29, 2024
54ce3ae
Formatted
jajhall Nov 29, 2024
17c4c8a
Introduced simplex_stats_ and presolved_lp_simplex_stats_ into Highs.h
jajhall Nov 29, 2024
b2115a5
Added invalidateSimplexStats() to Highs.h
jajhall Nov 29, 2024
b7fa6e1
Merged fix-2049 into this branch
jajhall Nov 29, 2024
597b4e7
Added CSV reporting to SimplexStats
jajhall Nov 29, 2024
02d719c
Added CSV reporting to SimplexStats; formatted
jajhall Nov 29, 2024
59d8c02
Root relaxation solve needs debugging
jajhall Nov 29, 2024
a6aacf8
HighsSolutionStats.h is now HighsSolverStats.h
jajhall Nov 30, 2024
5b332f6
Have extracted matrix_nz from depths of basic_lu!
jajhall Nov 30, 2024
877d52e
Gathered IPX stats from ComputeStartingPoint!
jajhall Dec 1, 2024
70ac00f
Now to return INVERT nz from basiclu
jajhall Dec 1, 2024
d45afb2
Now extracting matrix_nz and invert_nz
jajhall Dec 1, 2024
78b268d
Remvoved matrix_nz and invert_nz from kkt
jajhall Dec 1, 2024
aa522b9
Cleaned out unnecessary code, added when guessing how to get matrix_n…
jajhall Dec 1, 2024
47c99e3
Introduced mip_old_analytic_centre_method option, and restricted mip_…
jajhall Dec 2, 2024
0861f04
Corrected IPX stats when kk1 has 0 iterations
jajhall Dec 2, 2024
3c98069
Corrected IPX stats when kk1 has 0 iterations; formatted
jajhall Dec 2, 2024
593ec7b
Suppressing initial_root_node_solve
jajhall Dec 2, 2024
a3d3fb5
Now producing positive terms in simplex cost function
jajhall Dec 5, 2024
42e2b05
Incorporate simplex/IPX/crossover times in solver stats
jajhall Dec 9, 2024
d77061c
Incorporated simplex time in solver stats
jajhall Dec 9, 2024
5d5393c
Gather new stats
jajhall Dec 9, 2024
9546d03
Introduce separate CR1 and CR2 timing
jajhall Dec 10, 2024
0f68c8e
Added Type1, Type2 and Basis0 timing
jajhall Dec 11, 2024
a33f338
Now timing IPX type1 iterations correctly and ensuring IPX time limit…
jajhall Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Corrected IPX stats when kk1 has 0 iterations
  • Loading branch information
jajhall committed Dec 2, 2024
commit 0861f045fed52ec981f1c85c8470b41e0b7c9bde
20 changes: 6 additions & 14 deletions src/ipm/ipx/ipm.cc
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ IPM::IPM(const Control& control) : control_(control) {}
}
}

void IPM::Driver(KKTSolver* kkt, Iterate* iterate, Info* info) {
void IPM::Driver(KKTSolver* kkt, Iterate* iterate, Info* info, const bool diag) {
const Model& model = iterate->model();
const Int m = model.rows();
const Int n = model.cols();
@@ -87,8 +87,7 @@ void IPM::Driver(KKTSolver* kkt, Iterate* iterate, Info* info) {
}
if ((info->errflag = control_.InterruptCheck(info->iter)) != 0)
break;
Int kktiter1 = -info_->kktiter1;
Int kktiter2 = -info_->kktiter2;
Int kktiter = diag ? -info_->kktiter1 : -info_->kktiter2;
kkt->Factorize(iterate, info);
if (info->errflag)
break;
@@ -105,20 +104,13 @@ void IPM::Driver(KKTSolver* kkt, Iterate* iterate, Info* info) {
info->iter++;

// Update IPX stats



kktiter1 += info_->kktiter1;
kktiter2 += info_->kktiter2;
Int cr_type = kktiter1 > 0 ? 1 : 2;
Int kktiter = cr_type == 1 ? kktiter1 : kktiter2;
if (cr_type == 1) assert(kktiter2 == 0);

kktiter += diag ? info_->kktiter1 : info_->kktiter2;
Int cr_type = diag ? 1 : 2;
ipx_stats_->iteration_count++;
ipx_stats_->cr_type.push_back(cr_type);
ipx_stats_->cr_count.push_back(kktiter);
Int matrix_nz = cr_type == 1 ? 0 : kkt_->basis()->matrix_nz();
Int invert_nz = cr_type == 1 ? 0 : kkt_->basis()->invert_nz();
Int matrix_nz = diag ? 0 : kkt_->basis()->matrix_nz();
Int invert_nz = diag ? 0 : kkt_->basis()->invert_nz();
ipx_stats_->factored_basis_num_el.push_back(matrix_nz);
ipx_stats_->invert_num_el.push_back(invert_nz);
// if (cr_type == 2) ipx_stats_->report(stdout, "IPM::Driver()");
2 changes: 1 addition & 1 deletion src/ipm/ipx/ipm.h
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ class IPM {
// IPX_STATUS_no_progress if no progress over a number of iterations,
// IPX_STATUS_time_limit if interrupted by time limit,
// IPX_STATUS_failed if the KKT solver failed with info->errflag.
void Driver(KKTSolver* kkt, Iterate* iterate, Info* info);
void Driver(KKTSolver* kkt, Iterate* iterate, Info* info, const bool diag);

Int maxiter() const { return maxiter_; }
void maxiter(Int i) { maxiter_ = i; }
6 changes: 4 additions & 2 deletions src/ipm/ipx/lp_solver.cc
Original file line number Diff line number Diff line change
@@ -513,7 +513,8 @@ void LpSolver::RunInitialIPM(IPM& ipm) {
} else {
ipm.maxiter(std::min(switchiter, control_.ipm_maxiter()));
}
ipm.Driver(&kkt, iterate_.get(), &info_);
const bool diag = true;
ipm.Driver(&kkt, iterate_.get(), &info_, diag);
switch (info_.status_ipm) {
case IPX_STATUS_optimal:
// If the IPM reached its termination criterion in the initial
@@ -580,7 +581,8 @@ void LpSolver::RunMainIPM(IPM& ipm) {
Timer timer;
ipm.maxiter(control_.ipm_maxiter());
kkt.maxiter(control_.cr2_maxiter());
ipm.Driver(&kkt, iterate_.get(), &info_);
const bool diag = false;
ipm.Driver(&kkt, iterate_.get(), &info_, diag);
info_.time_ipm2 = timer.Elapsed();
}

2 changes: 1 addition & 1 deletion src/lp_data/HighsOptions.h
Original file line number Diff line number Diff line change
@@ -553,7 +553,7 @@ struct HighsOptionsStruct {
icrash_breakpoints(false),
mip_detect_symmetry(false),
mip_allow_restart(false),
mip_old_analytic_centre_method(false);
mip_old_analytic_centre_method(false),
mip_max_nodes(0),
mip_max_stall_nodes(0),
mip_max_start_nodes(0),