Hi everyone,
I have a rather large QCP model and noticed that the Q extraction algorithms take quite long. I have already switched from ThreePass to DoubleForward, which for my model lead to a ~40% decrease in the Q extraction time. However, it still takes a long time - in a smaller test run roughly as long as the actual solving time (Edit: it can be much worse, see reply). See the relevant output below.
First of all, I am wondering what exactly these algorithms even do. I have a strong suspicion that they determine the Q matrix in the quadratic form x^TQx of the QCP. But what’s not clear to me is why, from where, and how it is extracted. A few quick google searches did not lead anywhere.
Secondly, I am wondering if it may be possible to reformulate constraints in a way which would help the algorithm to extract the quadratic parts.
Cheers,
Gereon
Processor information: 1 socket(s), 14 core(s), and 20 thread(s) available
--- Starting compilation
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(67) 53 Mb
--- Starting execution: elapsed 0:00:00.014
--- Generating QCP model esma
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(806) 135 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1022) 156 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1044) 189 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1044) 197 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1077) 227 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1077) 234 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1099) 271 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1110) 280 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1121) 293 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1132) 293 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1168) 305 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 306 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 320 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 309 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 312 Mb
--- 911,524 rows 813,029 columns 3,031,608 non-zeroes
--- 730,080 nl-code 216,000 nl-non-zeroes
--- Range statistics (absolute non-zero finite values)
--- RHS [min, max] : [ 1.908E-03, 2.909E+04] - Zero values observed as well
--- Bound [min, max] : [ 1.103E-04, 8.386E+04] - Zero values observed as well
--- Matrix [min, max] : [ 1.001E-03, 2.336E+02] - Zero values observed as well
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 312 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 307 Mb
--- Executing CPLEX (Solvelink=5): elapsed 0:00:02.285
--- Warning: SolveOpt is set to REPLACE (0).
--- Empty equations are not passed to the solver
--- and will be cleared when reading the solution.
IBM ILOG CPLEX 47.4.1 4b675771 Aug 13, 2024 WEI x86 64bit/MS Window
--- GAMS/CPLEX licensed for continuous and discrete problems.
Reading parameter(s) from "C:\Users\rech_ge\AppData\Local\Temp\tmpuq05hh_o\cplex.123"
>> threads 6
>> lpmethod 4
>> predual -1
>> solutiontype 2
>> barepcomp 1e-06
>> barqcpepcomp 1e-06
>> names no
>> qextractalg 2
Finished reading from "C:\Users\rech_ge\AppData\Local\Temp\tmpuq05hh_o\cplex.123"
--- GMO Q Extraction (DoubleForward): 84.77s
--- GMO setup time: 84.77s
--- GMO memory 442.28 Mb (peak 455.44 Mb)
--- Dictionary memory 0.00 Mb
--- Cplex 22.1.1.0 link memory 25.94 Mb (peak 77.49 Mb)
--- Starting Cplex
Version identifier: 22.1.1.0 | 2022-11-27 | 9160aff4d
CPXPARAM_Advance 0
CPXPARAM_Preprocessing_Dual -1
CPXPARAM_LPMethod 4
CPXPARAM_Threads 6
CPXPARAM_Parallel 1
CPXPARAM_SolutionType 2
CPXPARAM_MIP_Display 4
CPXPARAM_MIP_Pool_Capacity 0
CPXPARAM_MIP_Tolerances_AbsMIPGap 0
CPXPARAM_Barrier_ConvergeTol 9.9999999999999995e-07
CPXPARAM_Barrier_QCPConvergeTol 9.9999999999999995e-07
Tried aggregator 1 time.
QCP Presolve eliminated 203887 rows and 134023 columns.
Aggregator did 64079 substitutions.
Reduced QCP has 1352909 rows, 876287 columns, and 3264288 nonzeros.
Reduced QCP has 187920 quadratic constraints.
Presolve time = 2.27 sec. (2506.09 ticks)
Parallel mode: using up to 6 threads for barrier.
***NOTE: Found 145 dense columns.
Number of nonzeros in lower triangle of A*A' = 11598928
Using Nested Dissection ordering
Total time for automatic ordering = 3.30 sec. (4828.48 ticks)
Summary statistics for Cholesky factor:
Threads = 6
Rows in Factor = 1353054
Integer space required = 4884361
Total non-zeros in factor = 47038393
Total FP ops to factor = 12116570487
Itn Primal Obj Dual Obj Prim Inf Upper Inf Dual Inf Inf Ratio
0 1.9973228e+04 7.3185902e-12 1.55e+08 0.00e+00 1.74e+06 1.00e+00
[removed intermediate iterations]
72 8.9960489e+03 8.9960409e+03 8.27e+01 0.00e+00 9.26e-01 2.53e+04
--- QCP status (1): optimal.
--- Cplex Time: 89.62sec (det. 111177.80 ticks)
Optimal solution found
Objective: 8996.048872
--- Reading solution for model esma
***
*** Reading with solveopt=REPLACE (0)
***
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 307 Mb 265 secs
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1197) 309 Mb 265 secs
--- Executing after solve: elapsed 0:04:27.203
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1201) 309 Mb
--- _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms(1259) 309 Mb
--- GDX File C:\Users\rech_ge\AppData\Local\Temp\tmpuq05hh_o\_6b21d2db-d34d-4fef-9729-4182830ad6dcout.gdx
*** Status: Normal completion
--- Job _6b21d2db-d34d-4fef-9729-4182830ad6dc.gms Stop 09/02/24 12:04:02 elapsed 0:04:27.470