MIP Start with CPLEX from a file

 User
 Posts: 108
 Joined: 2 years ago
Re: MIP Start with CPLEX from a file
Hmm, we are now in the realm of official help, your question is valid. My guess is that this option was fully implemented in the newer GAMS versions. I will expect an answer with you
Re: MIP Start with CPLEX from a file
Peter,
The reason you have no other options than mipstart=1 available is probably that you use an outdated GAMS system. Values >= 2 for CPLEX option mipstart were introduced in version 24.7.4 (release notes: https://www.gams.com/latest/docs/RN_247 ... 474_CPLEXD). You can download the latest version from https://www.gams.com/download/.
As already mentioned by Claudio, you might want to test whether your provided initial values actually allow for a feasible solution. An easy way to test that is to fix the variables instead of just setting the levels:
Even if it turns out that x_Initial and y_Initial allow a feasible solution in general, there is still no guarantee that CPLEX accepts them as a MIP starting point. As you already mentioned, you provide only the levels for *some* of the variables. Hence, this is at best a partial solution. CPLEX spends limited resources on constructing a full solution for the entire problem but if it fails to find one quickly, Cplex might reject your MIP start.
I hope this helps!
Best,
Fred
The reason you have no other options than mipstart=1 available is probably that you use an outdated GAMS system. Values >= 2 for CPLEX option mipstart were introduced in version 24.7.4 (release notes: https://www.gams.com/latest/docs/RN_247 ... 474_CPLEXD). You can download the latest version from https://www.gams.com/download/.
As already mentioned by Claudio, you might want to test whether your provided initial values actually allow for a feasible solution. An easy way to test that is to fix the variables instead of just setting the levels:
Code: Select all
x.fx(t, household) = x_Initial(t, household);
y.fx(t, household) = y_Initial(t, household);
I hope this helps!
Best,
Fred
Re: MIP Start with CPLEX from a file
Thanks Fred for your help, especially regarding how to test if a solution if feasible.
Now  even with the old GAMS version  I can start the problem with a feasible solution.
Is it also possible to start the model with several feasible solutions?
Now  even with the old GAMS version  I can start the problem with a feasible solution.
Is it also possible to start the model with several feasible solutions?
Re: MIP Start with CPLEX from a file
Hi Peter,
Currently, there is no way to provide multiple MIP starts to CPLEX via GAMS. If you think, being able to provide multiple MIP starts would be a significant benefit for you model, could you please provide the following to support@gams.com?
 The different solution points you want to use as MIP starting values stored in gdx files (e.g. created with option savepoint: https://www.gams.com/latest/docs/UG_Gam ... OSavePoint)
 The model (and all the files needed to run it) for which you want to use the mipstarts (e.g. saved in a dump file (run with command line parameter dumpopt=11 https://www.gams.com/latest/docs/UG_Gam ... SAODumpOpt))
Best,
Fred
Currently, there is no way to provide multiple MIP starts to CPLEX via GAMS. If you think, being able to provide multiple MIP starts would be a significant benefit for you model, could you please provide the following to support@gams.com?
 The different solution points you want to use as MIP starting values stored in gdx files (e.g. created with option savepoint: https://www.gams.com/latest/docs/UG_Gam ... OSavePoint)
 The model (and all the files needed to run it) for which you want to use the mipstarts (e.g. saved in a dump file (run with command line parameter dumpopt=11 https://www.gams.com/latest/docs/UG_Gam ... SAODumpOpt))
Best,
Fred
Re: MIP Start with CPLEX from a file
Thanks Fred for your answer,
no, I do not think that multiple solutions would change the performance significantly. I justed wanted to know if that is possible or not. Anyways, thanks for your help
no, I do not think that multiple solutions would change the performance significantly. I justed wanted to know if that is possible or not. Anyways, thanks for your help
Re: MIP Start with CPLEX from a file
Hi,
it's me again having a question regarding a MIP start (sorry to bother you with my questions but I do not have that much experience with GAMS and I have no one to ask except this forum; I am really thankful for your help and appreciate it).
I have a solution which I think is feasible. To check the solution I entered  as suggested by Fred  the following lines:
x and y are binary variables. However I get an error message: "Infeasible column 'temperature_level_bufferTank(4.household_4)'."
The problem is that the violation of this contrain is not understandable for me if you have a look at the variables x and y. In the results file you see that there are no values for all equations (except the equation for the objective function) and there are no entries for the variable except the variable that causes the infeasibility (according to CPLEX) "temperature_level_bufferTank". But for this variable only the inital value is correct (at 30) and then all other values are 0 which cannot be the case according to x and y. I use an updating equation for temperature_level_bufferTank which looks like this:
Unfortunately the values are not updated when fixing x(t, household). Could someone imaging a reason for this problem? The model itself is okay. When not fixing the values of the variable evertything is alright and both the equations and the variables are created and updated. Also the input parameters x_Initial(t, household), and y_Initial(t, household); are read correctly according to the result file.
it's me again having a question regarding a MIP start (sorry to bother you with my questions but I do not have that much experience with GAMS and I have no one to ask except this forum; I am really thankful for your help and appreciate it).
I have a solution which I think is feasible. To check the solution I entered  as suggested by Fred  the following lines:
Code: Select all
x.fx(t, household) = x_Initial(t, household);
y.fx(t, household) = y_Initial(t, household);
The problem is that the violation of this contrain is not understandable for me if you have a look at the variables x and y. In the results file you see that there are no values for all equations (except the equation for the objective function) and there are no entries for the variable except the variable that causes the infeasibility (according to CPLEX) "temperature_level_bufferTank". But for this variable only the inital value is correct (at 30) and then all other values are 0 which cannot be the case according to x and y. I use an updating equation for temperature_level_bufferTank which looks like this:
Code: Select all
eq_temperature_level_bufferTank(t, household) $(ord(t)>1)..
temperature_level_bufferTank(t, household)
=e=
temperature_level_bufferTank (t1, household) + ((x(t, household) * electricalPower(household) * timeResolution * cop_BufferTank(t, household)  demand_heating(t, household)* timeResolution  standingLoss_BufferTank(household) * timeResolution) /((VolumeOfBufferTank(household)/1000) * DensityOfWater * SpecificHeatCapacityOfWater));
Re: MIP Start with CPLEX from a file
Peter,
It seems there is no way to assign a value to variable temperature_level_bufferTank(4.household_4) such that the solution is feasible. That can have many reasons. For example your initial solution may force the level of temperature_level_bufferTank(4.household_4) to be outside the corresponding variable bounds or the values of different variables implied by your start "solution" are inconsistent because some constraints (like temperature_level_bufferTank) cannot be satisfied.
As mentioned before, there is little chance that users can tell you what is wrong with your model if you don't share your model. If you do not want to share your code, you can also generate a scalar model (https://support.gams.com/conversion_of_ ... ms_support).
If the infeasible "solution" you get back from CPLEX does not make sense to you (e.g. because infeasibilty was determined at an early stage), you may want to rerun with Cplex option feasopt (https://www.gams.com/latest/docs/S_CPLE ... LEXfeasopt). That way you should get a minimumcost relaxation to make an infeasible model feasible and the infeasibilities should be reported in the lst file.
I hope this helps!
Best,
Fred
It seems there is no way to assign a value to variable temperature_level_bufferTank(4.household_4) such that the solution is feasible. That can have many reasons. For example your initial solution may force the level of temperature_level_bufferTank(4.household_4) to be outside the corresponding variable bounds or the values of different variables implied by your start "solution" are inconsistent because some constraints (like temperature_level_bufferTank) cannot be satisfied.
As mentioned before, there is little chance that users can tell you what is wrong with your model if you don't share your model. If you do not want to share your code, you can also generate a scalar model (https://support.gams.com/conversion_of_ ... ms_support).
If the infeasible "solution" you get back from CPLEX does not make sense to you (e.g. because infeasibilty was determined at an early stage), you may want to rerun with Cplex option feasopt (https://www.gams.com/latest/docs/S_CPLE ... LEXfeasopt). That way you should get a minimumcost relaxation to make an infeasible model feasible and the infeasibilities should be reported in the lst file.
I hope this helps!
Best,
Fred
Re: MIP Start with CPLEX from a file
Thanks Fred for your answer and your help,
now I got a feasible solution which I tested by
So this solution is feasible and GAMS also accepts this solution. However when I want to do a MIP start with this solution I get the (previously mentioned) message from CPLEX:
I also tried each of the 6 mipstart levels of the CPLEX option file, but all yield the same result. Can anyone of you think about a reason why this is happening (the solution is doubtlessly feasible)?
now I got a feasible solution which I tested by
Code: Select all
x.fx(t, household) = x_Initial(t, household);
y.fx(t, household) = y_Initial(t, household);
I set the values of the variables with:Processing 1 MIP starts.
MIP start 'm1' defined no solution.
Warning: No solution found from 1 MIP starts.
Code: Select all
x.L(t, household) = x_Initial(t, household);
y.L(t, household) = y_Initial(t, household);

 User
 Posts: 108
 Joined: 2 years ago
Re: MIP Start with CPLEX from a file
So, running with fixed variables finishes in "optimal solution" ? Are you initializing all variables in your problem ?
Remember that, because of your GAMS version you don't have full access to mipstart options.
I'm just rehashing this post by Fred, but you don't specify if it is a full solution, and if you have updated GAMS in your last one.
Claudio
Remember that, because of your GAMS version you don't have full access to mipstart options.
I'm just rehashing this post by Fred, but you don't specify if it is a full solution, and if you have updated GAMS in your last one.
BestFred wrote: ↑11 months agoThe reason you have no other options than mipstart=1 available is probably that you use an outdated GAMS system. Values >= 2 for CPLEX option mipstart were introduced in version 24.7.4 (release notes: https://www.gams.com/latest/docs/RN_247 ... 474_CPLEXD). You can download the latest version from https://www.gams.com/download/.
Even if it turns out that x_Initial and y_Initial allow a feasible solution in general, there is still no guarantee that CPLEX accepts them as a MIP starting point. As you already mentioned, you provide only the levels for *some* of the variables. Hence, this is at best a partial solution. CPLEX spends limited resources on constructing a full solution for the entire problem but if it fails to find one quickly, Cplex might reject your MIP start.
Claudio
Re: MIP Start with CPLEX from a file
Thanks cladelpino for your answer,
"Proven optimal solution.
MIP Solution: 609212.489503 (0 iterations, 0 nodes)
Final Solve: 609212.489503 (0 iterations)
Best possible: 609212.489503
Absolute gap: 0.000000
Relative gap: 0.000000"
Well GAMS says that it is an optimal solution (but of course this is not an optimal solution; it is just a feasible solution that I generated using a heuristic approach). And I have not specified the values for all variables; only for my binary variables x(t, household) and y(t, household). Here is what GAMS reports when running the model with the fixed variables:So, running with fixed variables finishes in "optimal solution" ? Are you initializing all variables in your problem ?
"Proven optimal solution.
MIP Solution: 609212.489503 (0 iterations, 0 nodes)
Final Solve: 609212.489503 (0 iterations)
Best possible: 609212.489503
Absolute gap: 0.000000
Relative gap: 0.000000"
It is not a full solution (see explanation above) and meanwhile I am using the latest GAMS and CPLEX version (and the new editor GAMS studio). So I tested every mipstart option of CPLEX. Some of them are supposed to cope with incomplete solution. However I always get the same error message telling me that m1 does not define a solutionRemember that, because of your GAMS version you don't have full access to mipstart options.
I'm just rehashing this post by Fred, but you don't specify if it is a full solution, and if you have updated GAMS in your last one.