4 A Complete Problem: Exercise 2

In this second exercise we are going to explore the cost of a given production plan. Suppose we want to manufacture 7 different products. We have 4 identical factories where 5 different machines are installed. 20 different raw products are used to assemble a product. Hence, we have a set of products P = {A,B,C,D,E,F,G}, a set of factories F = {F1,F2,F3,F4}, a set of machines M = {M1,M2,M3,M4,M5}, and a set of raw materials R = {120}. Additionally, various tables are given with p P, f F, m M, r R: A table qp,m defines which product can be manufactured on which machine. The table Rr,p says how many units of raw materials r are used to manufacture a unit of product p. The table Hp,mq(p,m) says how many hours of machine m it takes to manufacture one unit of product p. The table Rcr gives the cost of a unit of raw materials, the table Mcm gives the cost of machine m per hour, and the table Sp is the selling price of product p. Finally, the table Qf,p,mq(p,m) is a given production plan. It says how many units products to manufacture on which machine and in which factory. (We do not discuss here whether this production plan is good or not.) We suppose that all products can be sold, and that a machine can only process one product at the same time. We do not consider any other costs. A concrete data set is given in the LPL code and at the end of this paper (see exercise2).

We now wanted to calculate various amounts:

(1) The total selling value TS is:

              ∑
T S =                    Sp ⋅ Qf,p,m = 383646

      f∈F, p∈P, m∈M |q(p,m )

(2) The total cost of raw material RC is:

                ∑
RC  =                        Rr,p ⋅ Rcr ⋅ Qf,p,m = 305882

      f∈F, p∈P, m∈M, r∈R|q(p,m )

(3) The total machine costs MC is:

             ∑
M C =                   Hp,m ⋅ M cm ⋅ Qf,p,m = 24882
       f∈F, p∈P, m ∈M|qp,m

(4) The total profit TS is:

TP  = T S - RC  - M  C = 52882

(5) The total quantity TQp produced for each product p is:

            ∑                (                                  )
T Qp =              Qf,p,m =   188  228  175   135  89  261  391
       f∈F, m ∈M |qp,m

(6a) How long (in hours) does the production take on each machine m M and in each factory f F?

                                      (                         )
                                        515  312  542  290   330
                ∑                     | 548  224  554  324   273|
T if∈F,m ∈M =          Hp,m  ⋅ Qf,p,m = |(                         |)
              p∈P|q(p,m)                  416  392  309  154   246
                                        472  216  695  154   452

(6b) How long (in hours) does the production take maximally until the last product leaves a factory f F?

             (                      )
                  ∑                      (                    )
TIf∈F =  max (          Hp,m ⋅ Qf,p,m) =  542   554  416  695
         m∈M   p∈P |q(p,m)

(7a) How big is the loss (gain) of each product (LopP )?

                             (                           )
         ∑               ∑     ∑
Lop∈P =     Sp ⋅ Qf,p,m -         Rr,p ⋅ Rcr + Hp,m ⋅ M cm ⋅ Qf,p,m
         f,m       {      f,m    r                                          }
                =   55792  33450   - 6320  - 19305  10769   - 3046  - 18458

(7b) Which products generate a loss (set LOpP )?

                             (                           )
         ∑               ∑     ∑
LOp ∈P =     Sp ⋅ Qf,p,m -          Rr,p ⋅ Rcr + Hp,m ⋅ M cm  ⋅ Qf,p,m < 0
         f,m              f,m    r                              {             }
                                                             =  C   D   F  G

(8) Which machines in which factories work more than 500 hours (set MOfF, mM)?

           ∑
 M  Of,m =     Hp,m ⋅ Qf,p,m > 500
             p
= {(F 1,M  1)  (F 1,M  3)  (F 2,M  1)  (F 2,M  3)  (F4,M  3)}

(9) Which machine and in which factory works more than any other machine (set MAfF, mM)?

M Af,m =             (                )                   (                 )
                       ∑                                    ∑
         f = argmax       Hp,m ⋅ Qf,p,m   ∧   m =  argmax       Hp,m ⋅ Qf,p,m
                f       p                             m      p
                                                                           {         }
                                                                        =   (F 4,M 3)

(10) Which machine and in which factory has the least work to do (in hours) (set MIfF, mM)?

M If,m =             (                )                   (                 )
                       ∑                                    ∑
         f = argmin       Hp,m ⋅ Qf,p,m   ∧   m =  argmin      Hp,m  ⋅ Qf,p,m
                f       p                            m       p
                                                                           {         }
                                                                        =   (F 3,M 4)

It is straightforward to implement this examples in the language LPL. First we declare the given index sets and the tables as follows (the concrete data for the parameter tables can be found in the LPL model):

  set 
    p := [A B C D E F G];     r := [1..20]; 
    m := [M1 M2 M3 M4 M5];    f := [F1 F2 F3 F4]; 
    q{p,m}; 
  parameter 
    Q{f,q};   S{p};   R{r,p};    H{q};    Rc{r};    Mc{m};

Based on these given data, we can then calculate the various expressions as follows:

  parameter 
    TS := sum{f,q[p,m]} Q*S; 
    RC := sum{f,p,m,r} R*Rc * Q; 
    MC := sum{f,p,m} H*Mc * Q; 
    TP := TS - RC - MC; 
    Ti{f,m}:= sum{p} H*Q; 
    TI{f}:= max{m} sum{p} Mc*Q; 
    Lo{p} := sum{f,m} S*Q - sum{f,m}(sum{r} R*Rc + H*Mc)* Q; 
  set 
    LO{p}  := sum{f,m} S*Q - sum{f,m}(sum{r} R*Rc + H*Mc)* Q < 0; 
    MO{f,m}:= sum{p} H*Q > 300; 
    MA{f,m}:= f=argmax{f}(sum{p} Mc*Q) and m=argmax{m}(sum{p} Mc*Q); 
    MI{f,m}:= f=argmin{f}(sum{p} Mc*Q) and m=argmin{m}(sum{p} Mc*Q);