Speeding up running time


I’m working on a large-scale LP problem in AMPL, structured as follows:

model ETEM.mod;
data _EtemData.txt;
data SAS_modification.txt;
option solver amplcplex;
option cplex_options 'display=1 clocktype=2 startalgorithm=4';

The problem has 2,615,940 variables and 2,368,400 constraints. To speed up the process, I’ve attempted several strategies:

  1. Upgrading the computer’s hardware.
  2. Switching the algorithm in CPLEX from 1 to 4 (barrier method).
  3. Decreasing the number of variables and constraints.

Despite these efforts, it still requires 6 to 10 hours to complete. I’m seeking advice on reducing the computation time.

Could you suggest any methods to make it run faster? Additionally, would utilizing a warm start be beneficial, and if so, how can I generate a .dat file for a problem of this magnitude?

Thanks in advance for your assistance.

To be sure that you are getting complete log output from AMPL and CPLEX, use these options:

option show_stats 1;
option cplex_options 'display=1 bardisplay=1 mipdisplay=2 clocktype=2 startalgorithm=4';

Then copy all of the output into a text file, and attach the file to your reply. (To create an attachment, click on the upload icon in the Discourse editor window.)

long-runnig-time.txt (1.9 KB)

Thank you for your advice. I’ve attached the initial part of the run, as it lasts about 8 hours and I’m not continuously connected to the server. Please inform me if additional information is required.

Additionally, I have a question regarding the warm start. I’ve experimented with various formats for the warm start file. Could you advise which format the variable values should follow:

  1. let VAR_COM ['1','H0','MTL', 'AGRTECH','LFO']:=0.006377
  2. activity ['1','H0','MTL','AGRTECH'] := 0.339210?

If you have any examples, could you kindly share them so I can understand the format better?

Thank you so much.

Any of the methods of specifying data values for AMPL params can also be used to specify values for the variables — which will be used in a warmstart. Thus one possibility is to use “let” statements as in your option 1 (with a ; at the end of each statement). But that can get tedious; you can alternatively use, for example, the AMPL .dat file format, with the keyword “param” replaced by “var”.

Warmstarts are not as useful for linear programming as one might think, however, especially for the barrier method. So that we can provide more specific advice, can you also show the last 100 or so lines of the listing?

long-run-2hrs.txt (90.2 KB)

Fortunately, I could reduce running time to about 2 hrs, and I am still looking to reduce it more.

I have attached the full iterations.

I appreciate your guidance in this regard.

CPLEX is running the primal simplex, dual simplex, and barrier methods in parallel. It finishes with the message

Dual simplex solved model.

which means that that dual simplex method was the first one to find a solution. You can speed up the solve somewhat by specifying

option cplex_options "dualopt display=1 clocktype=2";

which avoids some system overhead by running only the dual simplex method. (Because you have no integer variables, the mipdisplay=2 and startalgorithm=4 options are ignored.)

Also try running with different settings of CPLEX’s dgradient option:

dgradient  Pricing algorithm for dual simplex (default 0):
              0 = choose automatically
              1 = standard dual pricing
              2 = steepest-edge pricing
              3 = steepest-edge pricing in slack space
              4 = steepest-edge with unit initial norms
              5 = devex pricing.

These offer different tradeoffs between time per iteration and number of iterations, and sometimes one of them works substantially better than CPLEX’s automatic choice (which is the default).