# Products distribution planning model

I have a problem of planning the distribution of products for a month. I have different unique products. A Mandate is provided for each product, and the Mandated quantity for each product is to be delivered during the month while respecting stock levels (cant deliver it all directly cause no stock available). Products are delivered through loading stations to vehicles. I need to minimize the number of vehicles used. I have developed the following model but for some reason variable $$B$$ seeks always to be positive, rendering the problem sometimes infeasible or giving erroneous results. Can anyone help me with catching the issue, any help is very much appreciated. Even if it is some reference to close problem in the literature.

Variables:

$$x_{p,t,j}$$ continuous variable representing the quantity of product $$p$$ to be delivered on day $$t$$ using station $$j$$

$$S_{p,t}$$ quantity of available stock of product $$p$$ at day $$t$$

$$B_{p,t,j}$$ boolean variable equal to 1 if product $$p$$ is scheduled to be delivered on day $$t$$ using station $$j$$

$$Y_{t,j}$$ boolean variable equal to 1 if station $$j$$ is open on day $$t$$

Objective function: $$min \sum_p \sum_t \sum_j B_{p,t,j}$$ Minimize the number of times a product is delivered

Constraints:

$$(1) \sum_t \sum_j x_{p,t,j} = Mandate_p, \forall p$$ $$(2) S_{p,t} = S_{p,t-1} + Feed_{p,t} - \sum_j x_{p,t,j}, \forall p,t$$ $$(3) Min_{p} \le S_{p,t} \le Max_{p}, \forall p, t$$ $$(4)x_{p,t,j} \le M * B_{p,t,j}, \forall p,t,j$$ $$(5) \sum_j B_{p,t,j} \le 1, \forall p,t$$ $$(6) B_{p,t,j} \le Y_{t,j}, \forall p,t,j$$ $$(7) \sum_p \gamma * x_{p,t,j} \le 24 * Y_{t,j}, \forall t,j$$ Constraint (1) is to assure Mandates are fulfilled for all products, constraint (2) is the stock level at time $$t$$, constraint (3) fixes the maximum and minimum allowable stock per product $$p$$, constraint (4) is a fixed-charge model that says that a product is delivered only if it is assigned to a station $$j$$, constraint (5) only one station is used for a product per day, constraint (6) a product $$p$$ is delivered at station $$j$$ if station $$j$$ is open at time $$t$$, constraint (7) is to model the time needed to charge multiple product which needs to be less than 24 hours, and it is allowed in case station $$j$$ is open. $$\gamma$$ is a constant representing speed.

• Does \gamma stand for the product recharge unitary time? Can you give some short instance examples presenting infeasibility and, what you called, erroneous? Aug 13, 2021 at 16:41
• Thank you, yes \gamma is unitary, it is 0.004 for example, so if I have 1000 tonnes of product, it would need 1000*0.004=4 hours. As for intances, I can't find small instances where this is a problem, its is only when I plug the real problem. Maybe the problem is in the way I modelled the relationship between Y and B variables. Aug 13, 2021 at 18:25
• I think about it as a bin packing problem with continuous variable, but couldn't find anything like it on the internet, maybe I am missing something Aug 13, 2021 at 18:27
• Do you have any problem instances that are known to be feasible but make the model infeasible?
– prubin
Aug 13, 2021 at 19:34
• @MarcM, thanks. For checking the infeasibility, it would be possible to replace the current object function with a dummy objective equal to zero to check whether your model can produce a feasible solution. Another staff would be, as you said using Pyomo, this platform can be linked to the Neos server to use some of the state-of-the-art solvers like CPLEX, Gurobi, etc for using some of those advanced functions like IIS to compute which constraints cause the infeasibility. Aug 15, 2021 at 8:50