diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-10 05:50:32 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 06:55:15 -0500 |
commit | fe3eac084d43fdd7d1b806a9e346480bc34a5379 (patch) | |
tree | 2bd3e61cb29cfeaee77c43b7ac0fd50abb9188f0 | |
parent | 67c3193f1773e05df33b2316cb063652bf6652ff (diff) |
Set GLPK options to improve solving speed
With GLPK v4.43, we are seeing the following solving speends on
wks-50-12 with testmain.
single:
lp_dpcp_bounds::cpu_costs: total=338281ms last=561.457ms average=560.996ms count=603
lp_dflp_bounds::cpu_costs: total=109988ms last=183.426ms average=182.401ms count=603
single+GLP_DUALP:
lp_dpcp_bounds::cpu_costs: total=27461.7ms last=397.327ms average=397.996ms count=69
lp_dflp_bounds::cpu_costs: total=31928.1ms last=461.537ms average=462.726ms count=69
single + GLP_DUALP + GLP_PT_STD:
lp_dpcp_bounds::cpu_costs: total=16134.9ms last=404.367ms average=403.373ms count=40
lp_dflp_bounds::cpu_costs: total=18827.3ms last=487.815ms average=470.683ms count=40
single + GLP_PT_STD:
lp_dpcp_bounds::cpu_costs: total=28215.7ms last=511.512ms average=503.852ms count=56
lp_dflp_bounds::cpu_costs: total=9944.36ms last=177.432ms average=177.578ms count=56
bsingle + GLP_RT_STD:
lp_dpcp_bounds::cpu_costs: total=105168ms last=562.115ms average=559.402ms count=188
lp_dflp_bounds::cpu_costs: total=34179ms last=182.362ms average=181.803ms count=188
single + GLP_RT_STD + GLP_PT_STD:
lp_dpcp_bounds::cpu_costs: total=190591ms last=510.497ms average=509.602ms count=374
lp_dflp_bounds::cpu_costs: total=65934.2ms last=176.804ms average=176.295ms count=374
With merged LPs, it's unbearably slow:
lp_dpcp_bounds::cpu_costs: total=30727.3ms last=15253.7ms average=10242.4ms count=3
lp_dflp_bounds::cpu_costs: total=6389.68ms last=2128.94ms average=2129.89ms count=3
-rw-r--r-- | native/src/linprog/glpk.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/native/src/linprog/glpk.cpp b/native/src/linprog/glpk.cpp index 9ddf2c6..7a9a0d9 100644 --- a/native/src/linprog/glpk.cpp +++ b/native/src/linprog/glpk.cpp | |||
@@ -91,7 +91,14 @@ void GLPKSolution::solve(double var_lb, double var_ub) | |||
91 | 91 | ||
92 | glp_init_smcp(&glpk_params); | 92 | glp_init_smcp(&glpk_params); |
93 | 93 | ||
94 | /* Set solver options. The presolver is essential. The other two | ||
95 | * options seem to make the solver slightly faster. | ||
96 | * | ||
97 | * Tested with GLPK 4.43 on wks-50-12. | ||
98 | */ | ||
94 | glpk_params.presolve = GLP_ON; | 99 | glpk_params.presolve = GLP_ON; |
100 | glpk_params.pricing = GLP_PT_STD; | ||
101 | glpk_params.r_test = GLP_RT_STD; | ||
95 | 102 | ||
96 | solved = glp_simplex(glpk, &glpk_params) == 0 && | 103 | solved = glp_simplex(glpk, &glpk_params) == 0 && |
97 | glp_get_status(glpk) == GLP_OPT; | 104 | glp_get_status(glpk) == GLP_OPT; |