Infeasible Solution

Problems with modeling
Post Reply
AndiL.
User
User
Posts: 3
Joined: 2 weeks ago

Infeasible Solution

Post by AndiL. » 2 weeks ago

Hey all,

i need your help. I spent a lot of time to find a solution for this model, but i didn't find anything.
I want to minimize a splitqoute. A split exists, when a customer order is serve from more than one warehouse. In this model there exists only two.
As a basis for this model, I have simulated 1000 sales orders, which should serve as the basis of the distribution of the articles.
I can read these from the Excel file in GAMS, but I can not get the modeling of an equation that serves as the basis for the distribution of the articles.
In addition, the program tells me after the current release of the model that it is infeasible.
The files are attached!

Please help me!!

Thanks in advance and best regards
Andreas
Model1.gms
(3.4 KiB) Downloaded 8 times
customerorders.xlsx
(68.56 KiB) Downloaded 5 times
Articleinformation.xlsx
(10.5 KiB) Downloaded 5 times

User avatar
bussieck
Moderator
Moderator
Posts: 106
Joined: 1 year ago

Re: Infeasible Solution

Post by bussieck » 2 weeks ago

Hi,

Dealing with infeasibilities is difficult. Make a small example and find a solution by hand. Initialize your variables (.l attribute) to the known solution and look at the equation listing () if the equations are all feasible. If not you have logical errors in your algebra. Make your model in a way that is can always get a feasible solution (e.g. by leaving some demand unfilled, let go production over capacity and penalize this "violation"). Only true physical constraint, e.g. flow conservation, etc should stay hard. There is a nice blog post and newsletter entry by Bruce McCarl on dealing with infeasibilities: https://www.gams.com/blog/article/news/ ... e635ad1235

I looked at the model and there are a lot of rookie mistakes. Basically your model is a MIP. Don't use non-linear algebra if you don't have to. ifthen and ceil can be easily reformulated in a linear fashion. For example:

Code: Select all

LKW.. LKWs =e= ceil(sum(i, AP(i))/20);
with LKWs, and AP positive variables. Just make LKWs an integer variable and write

Code: Select all

LKW.. LKWs =g= sum(i, AP(i))/20;
The minimzation will make LKWs as small as possible automatically.

Another one:

Code: Select all

SdK(k).. S(k) =e= ifthen(KA(k,"1")=1 AND KA(k,"2")=1,1,0);
with S and KA binary variables. What you try to do it S(K) =e= KA(k,"1") AND KA(k,"2"); This can be easily linearized by

Code: Select all

S(k) =l= KA(k,"1");
S(k) =l= KA(k,"2");
S(k) =g= KA(k,"1")+KA(k,"2")-1;
Often one part (either =l= or =g=) can be left out because of the optimization direction, but I can't easily decide if that's the case here. These things should be taught in class. You also find help in HP Williams book "Model Building in Mathematical Programming" https://books.google.de/books/about/Mod ... &q&f=false

The MINLP/MIP is independent of the way to treat the infeasibility.

Hope this helps,
-Michael

AndiL.
User
User
Posts: 3
Joined: 2 weeks ago

Re: Infeasible Solution

Post by AndiL. » 2 weeks ago

Thank you for your help.

AndiL.
User
User
Posts: 3
Joined: 2 weeks ago

Re: Infeasible Solution

Post by AndiL. » 2 weeks ago

Good Morning Michael,

now the model runs, but it finds no feasible solution.

I think the problem might be the missing equation for the customer orders, but i have no idea how to implement them in this model. Do you have a solution for this problem?
It is quite important for me, because this is for my master thesis and my deadline is the 24th of may....

Thanks in advance and best regards
Andreas

User avatar
bussieck
Moderator
Moderator
Posts: 106
Joined: 1 year ago

Re: Infeasible Solution

Post by bussieck » 2 weeks ago

Andreas,

I would go to your advisor and get help. That's what they are paid for!

-Michael

Post Reply