However, if I run this model. It returns “infeasible”. It is even stranger because when I limit the index of the last constraint on ord(r)>1 or ord(r)<10 for instance, the model is running as it should.

Do you have an idea from where this bug is coming?

I have also try to build alternative extended formulation but it is always the same problem, it does not run when r=1 (or r=10) is define.

Thank you for help and take care!

Regards,

Page 1 / 1

Hello @amadeodum , you can have the index domain of Production(s,r) as

Production(s,r)|s <= r

, so that you can manufacture for period r in only those periods s which are before period r.

You will need the Backlog term in your flow constraint in case demand is more than your production capabilities. Something like below.

If you were unable to produce enough goods to meet demand in period r, you will have a backlog in that period. This will typically happen in the initial periods (as you don’t have enough time to buildup stock), so your model being infeasible when you include period-1 makes sense.

Inventory will be below. Note that I reversed the positions of r and s in Production. As s and r are indices in same set, you can interchange them. Sum of all production you did in r, but for future periods s.

Forall r,

sum s|s > r, Production(r,s)] = Inventory( r)

You don’t need to carry over Inventory like in the original flow constraint as you have a summation of all production in the past. Inventory variable will help if you want to calculate inventory holding costs.

See this example. If you can produce at most 20 units in a time period, but period-1 has a demand for 30. So you have a backlog of 10. In period-2, demand is only 10 but you still produce 10 (10 for period-2 and 10 for period-3), that extra 10 will be held in inventory until period-3. In period-4, you are only producing for period-5, so all 20 units are in inventory.

If you need to make sure that past backlogs should be satisfied, then you will need to carry that over. Something like

It returns infeasibe when I implement this constraint. I have defined the other flow constraint for r>1.

Regards,

@mohansx In fact the situation is even more complicated. I simplified the problem in order to make it understandable but now I have 2 other problems that need a bit more explainations. It is a mutli-level problem representing the supply chain of a brewery.

This first and the second levels are representing respectively the fermentation and the packaging of the beer. They are expressed in half-days (t and u).

The last level is the distribution and is expressed in weeks (my initial question was based on it).

The O.F. is still to minimize to total costs (inventory after the second level (at plant) and inventory and backlog at the third level (at the DCs)).

I already have a standard model which is running perfectly but I have some difficulties to implement an extended formulation at each level to strenghten it. With your previous answer, I manage to implement the extended formulation at the third level.

However, I have difficulties for the 2 first.

In the first level, the standard flow constraint is:

dj(s) is a parameter making a link between the half day and his corresponding week

PlantInv(l,m,s) is the stock of liquid m packed in m at week s

QtySent(d,l,m,s) is the quantity of liquid l sent to DC d in a packaging m at week s

I assume that if I want to build an extended formulation, I will have to create the variable

GoPackExt(l,m,t,s)|ReturnWeek(t)<=s

Representing the quantity packed at half day t for week of demand s. ReturnWeek(t) would be a parameter returning the week of an half day t. For this step, i will also have initial and final inventories such as in level 1.

I hope you have understand my problems. Thank you for the attention that you will give to this message.

I wish you a nice day.

Regards,

@amadeodum , I answer your questions below. May I ask why you need an additional time index like Packaging(s, r) instead of Packaging(s) ? One reason I guess is that the beer has to be fresh enough, so the time limit for perishable/expiry date. However, you could use constraints like below to model the same behavior. In your case, say s is the half days and r is weeks .. This is similar to the flow balance equation you wrote in your part 2..

#1 Boundary constraints. Two options here - 1st half day of entire period and last half day of entire period is where you need the starting and ending stock conditions. In this case, quite similar as before:

We sum over u because in t-1, you could be producing for w-1 or w-2 or w-3 or so on.

Similarly, final stock is below. By using t=last(t) instead ord(t) = 140, you ensure your model works if data changes and you have more or less than 140 half days. t = first(t) is equivalent to ord(t) = 1.

forall(l,t)|t = last(t)

sum

Another option is, you want the inventory at end of each week to be >= a safety stock of 50 units or so. Let me know if that is the case and we can discuss because that’ll mean many more possible configurations.. Depending on your answer for why you need to keep track of the (u, t) half day-week combination, you will need to extend GoPackaging or not. Extending GoPackaging but not QReady is a possibility, extending both is also possibility but they will give different solutions.

Hi @amadeodum

Did Mohan’s answers to your questions and suggestions help you with your problem?

Best

Reply

Sign up

Already have an account? Login Please use your business or academic e-mail address to register