When I write

OPTIONS mipemphasis = 2;

in GAMs. It encounters error:

Error 250 in C:\Users\A\Desktop\CaseB_Block1\BaseCaseBlockB1.gms[ERR:“C:\Users\A\Desktop\CaseB_Block1\BaseCaseBlockB1.gms”,132,21][LST:154]

Unknown option. valid are -

LP = “lpname” ( This works for all other model types as well:

MIP, RMIP, NLP, MCP, MPEC, RMPEC, CNS, DNLP, RMINLP

MINLP, QCP, MIQCP, RMIQCP, EMP )

-no values:

DmpOpt, DmpSym, DmpUserSym, Eject, Measure, MemoryStat, SubSystems

vbnet

Copy code

Hi,

mipemphasis is a GAMS/Cplex option. You need to put it into a Cplex option file. You can read more about how to use solver options here.

You can for example create the Cplex option file on the fly from your code:

```
[...]
myModel /all/;
myModel.optfile = 1;
option solver=cplex;
$onecho > cplex.opt
mipemphasis 2
$offecho
solve mymodel ...;
[...]
```

I hope this helps!

Fred

Thank you very much. I added:

$echo mipemphasis 3 > cplex.opt

PEMS.optfile = 1;

To my code and I did not receive an error. However, when the gap reach to 65%, it would still very slow. I will show a part of log:

I do not know how to accelerate the execution.

Let me share my options to be able to get your precious help:

OPTIONS OPTCR=0.1,LIMCOL=0,LIMROW=0,decimals=4,reslim=604800;

OPTIONS LIMROW=10;

$echo mipemphasis 3 > cplex.opt

PEMS.optfile = 1;

I doubt that there is a silver bullet in the form of a solver option. It is known that MIPs can be very hard to solve or it can be very hard to prove optimality of a solution. That said, there is a chance that you won’t be able to close the gap.

If you need further assistance, I suggest that you share your log file and code here, to give other forum users the chance to experiment with your model to eventually come up with suggestions how to improve performance.

I hope this helps!

Fred

There are hundreds of CPLEX options which you need to play around to find the best solver option for speedup. You can find them here https://www.gams.com/latest/docs/S_CPLEX.html.

Some useful solver options you might be interested in using:

- varsel: variable selection strategy
- scaind: input parameter matrix scaling strategy
- polishafterintsol: solution polishing after feasible solution gets found
- symmetry: cut generation strategy
- …

As Fred noted, it is never trivial to find the best solver options for your model. Good luck.

Best,

Gabriel