Dear GAMS-Experts,
I am in a bit of a quandary and desperate for your help. For my Masters Thesis, I created a Facility-Location-Problem (FLP) for a pharmaceutical supply chain. The goal of this model is do determine the effects of disruptive events on the FLP. My current task is to model the mathematical FLP via GAMS and this is where my problem occurs. After weeks of learning about GAMS and programming my model, I am still receiving an “Integer infeasible” error. Now of course I have tried out various things: I started validation of my model with very limited data and then step-by-step filled it with more data (more possible locations, more customers, more periods, etc.). Up until the point of 50 possible locations for each echelon of the supply chain with 9 periods and 10 customers, I received valid results. Enlargening my input data closer to the targeted values (104 primary-, 130 secondary production locations, 75 warehouses, 16 customers, 12 periods), I stumble upon infeasibility all of a sudden.
As I know, this situation would point very strongly towards my data not being correct, especially when it comes to supply, demands and capacities. But i have triple-checked my input data via Excel on whether it makes sense. This is why I’m asking for your help. I have spent days now simply reading through my code, trying out different adjustments and I do not have a single clue what the root of the problem could be. Maybe it’s my lack of expertise in GAMS, maybe it’s a small mistake I don’t see, or maybe I’m acting stupid. Nevertheless, I am on the verge of blowing up my schedule and maybe even in danger of not getting my thesis done at all. I know it’s a big ask, but I’m really desperate right now.
If someone were to help me find the problem in my code and achieve feasible results from my model, I would be forever in their debt.
I have attached my model with the extensive data as well as the smaller version that produced valid results (in German). If any more information is needed, I will provide it at the spot.
Thank you so, so much for your support!
Best regards,
Johannes
GAMSIDE build c5da09e / c5da09e
GAMS Release 30.3.0 rc5da09e WEX-WEI x86 64bit/MS Windows
20220315_Modell_Vereinfacht_V3.gms (35.9 KB)
20220330_Model_English_V1.gms (35.5 KB)
Hi Johannes,
You are most likely suffering from numerical issues due to the poor scaling of the model.
With the latest version of GAMS and different solvers I get the following for 20220315_Modell_Vereinfacht_V3.
- CBC: feasible
- Cplex: integer infeasible
- Gurobi: feasible
- SCIP: infeasible
- Xpress: integer infeasible
This is pretty inconsistent and usually an indicator for a numerically challenging model. Poor model scaling is a potential cause of such odd behavior. If you want to read about scaling, have a look at this chapter in the documentation (originally written for NLP but the basic ideas also apply to other model types) or have a look at the latest McCarl Newsletter.
Some solvers warn about this more explicitly than others. I guess you are using Cplex and with Cplex you could turn on certain model/data checks via option datacheck=2.
With Gurobi we see
Coefficient statistics:
Matrix range [5e-01, 2e+09]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 1e+15]
Warning: Model contains large matrix coefficients
Warning: Model contains large rhs
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
A right hand side of 1e15 is HUGE. Apparently, this comes from the following line:
AN(T,L) Angebot eines Lieferanten j /#t.L1 1000000000000000/
Whatever those guys deliver, 1e15 units of anything seems a lot and you should consider rescaling your data (e.g. use millions if pills instead of pills). Just changing the supply to a more reasonable number like 1e9, I get feasible solutions for both models with Cplex. But still, the objective of “proven optimal solutions” differ dramatically between different solvers, so I suggest to take the hints on model scaling serious and work on the model/data.
I hope this helps!
Fred
PS GAMS and the connected solvers are under constant development and your version is already 2 years old. Especially when working with challenging problems, it is recommended to keep the software up to date to benefit from the latest enhancements.
Hey Fred,
thank you so much for your input. It seems like you were right, as I’m producing valid results with my model now. Thank you so much, I really don’t know what I would have done without your help.
I have another question in regard to my model: I would like to expand the time frame considered by adding more elements to the set t (e.g. instead of t1t12, I would like to have t1t60 or even more).
Now I know that this will take a toll on GAMS as it will largely expand the whole model and the calculations, but I would really like to cover the strategic planning horizon for the facility location.
I started a test with 36 periods instead of 12 and I have produced results, but now (and this is not a surprise), the .lst-file is just getting enormously big, even too big to be opened. I have been reading on the subject for a few hours now, but the most common ideas like limrow:0 and limcol:0 as well as $offlisting did not do the trick. Is there any other ideas that you guys might have in order to drastically reduce the file size?
Thank you again very much for your support.
Best regards,
Johannes
20220330_Model_English_V4.gms (35.5 KB)
Setting limrow and limcol to 0 was already a god idea. In addition you might want to set solprint=0 to suppress the solution listing.
Fred