1
$\begingroup$

Given the input data:

  1. Stock[pl,p][t] where pl is plant, p is product, t is time horizon.
  2. Cost[p,pl]['Cost'] where pl is plant, p is product.
  3. Price[c,p]['Price'] where c is cost, p is product.
  4. Order[o,p,t]['Quantity'] where o is Sales orders, p is product, t is time horizon. Here the t is delivery dates.
$\endgroup$
2
  • $\begingroup$ What is your question at all? It is just a list of input data, it looks like you edited it and erased something by wrong. $\endgroup$ Commented Feb 8, 2023 at 8:57
  • $\begingroup$ User removed I think $\endgroup$ Commented Feb 8, 2023 at 22:54

1 Answer 1

1
$\begingroup$

(As you have done)
$Delv_{pl,p,t} \le Stck_{pl,p,t} $

$O_{c,p,t}^k (\delta_{k,pl}-1) \le \sum_p \tau_{c,pl}Delv_{pl,p,t} \le \sum_p O_{c,p,t}^k \delta_{k,pl} \ \ \forall pl \in Pl \ \ \forall t \in T \ \ \forall c \in C \ \forall k \in$ Orders

$ \sum_{pl} \delta_{k,pl} \le 1 \ \ \forall k \in $Orders

where $\delta_{k,pl} =1$ if plant $pl$ is selected for order# $k$, else 0 and $ \tau_{c,pl}=1$ if Pl is among those where customer $c$ sources from.

$\delta$ is a binary variable while $\tau$ is given. You can use set membership logic as well like $ C_pl = \{pl: pl \in $ Customer sources for C}

In your case you are using length of set in Constraint (3)

I don't think any of your constraints are addressing this in this way. Constraint (2) is saying 'get product $p$ from one or all (that what sum does) plants'. Trying replacing $=$ with $\le$ as there's a chance that a product in an order will not be delivered from the plant chosen. Constraint (3) is then attempting to restrict number of plants involved in every order to 1 but there in the constraint you are coding p_ == o.

$\endgroup$
3
  • $\begingroup$ updated the code with a check constraint, still the solution is infeasible. Here is the input data: docs.google.com/spreadsheets/d/… I feel not all of these constraints may be infact required as well. What do you think? $\endgroup$
    – user11162
    Commented Jan 31, 2023 at 20:19
  • $\begingroup$ I'd suggest use the previous code (you were perhaps on same track as my formulation) and there instead of where you used p_==o, correct it as p_==p and correct the constraint about the summing across products instead of plants. $\endgroup$ Commented Jan 31, 2023 at 20:29
  • $\begingroup$ I have reverted the code. correct the constraint about the summing across products instead of plants. - Are you referring to constraint 4? The constraint 2 sums across products to check if quantity of all products in a sales order come from same location is same as quantity requested in sales order. $\endgroup$
    – user11162
    Commented Jan 31, 2023 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.