Let’s take a concrete example: The present production plan say to manufacture 40 units of the second product (B) in factory F1 with machine M3, that is, we have: Q_{F1,B,M3} = 40. These 40 units could also have been manufactured by machine M1, such that Q_{F1,B,M3} becomes 0 and Q_{F1,B,M1} becomes 61. Doing this, implies that the total machine costs MC would now be reduced to:
instead of 24882, which is a cost reduction of 1080 units. We could use probably other reassignment of the production plan in order to reduce the cost even further. However, we would like to do this not on an experimental level, but on a systematic way. Hence, the question is: How should the production plan be, in order to minimize the total machine costs? (Note that the raw material costs do not change, supposing that the quantities of products manufactured do not change.) Expressed in another way: how should the production plan, that is the matrix Q_{f,p,m}, be assigned in order to make the machine costs as small as possible.
At this point, thing become interesting: From the mathematical point of view, we now have a model in which some data are unknown, that is the matrix Q_{f,p,m} becomes an unknown, because we want to know how this matrix has to be filled to attain our goal (the minimizing of costs). Our model is as follows:
Let us introduce a new variable (that is the unknown matrix) to represent the new production plan as follows: QQ_{f,p,m∣qp,m} ≥ 0, where QQ_{f,p,m} is the (unknown) quantity of product p to be manufactured at factory f by the means of the machine m
We would like to minimize the total machine costs
We also would like to produce the same quantity of each product as in the previous plan
There three conditions could be translated into the following mathematical model. This model has to be solved to find the minimizing cost production plan. The model is as follows:
subject to
The formulation of this model in LPL is as following (see exercise2a for a complete code):
....
integer variable QQ{f,q};
constraint CA{p}: sum{f,m} QQ = sum{f,m} Q;
minimize obj1: sum{f,p,m} H*Mc * QQ;
....
The new assigned (optimal, that is “cost minimal”) production plan QQ is as follows:

And the total machine costs are:
This is a substantial machine cost reduction of more than 35% compared to the initial (somewhat arbitrary) production plan of Exercise 2 (from 24882 units to 16006 units).
However, there is no need to use the mathematical models approach to find this trivial result! We could have found it by a simple thought: “One should assign as much work as possible to the cheapest machine!” For example, machine M4 only costs 4 to manufacture one unit of product C, while machine M1 costs 14, the only alternative to produce C. Furthermore it is not important in which factory the product is manufactured, since they are all identical. Hence, the total quantity 175 of product C should be manufactured by the means of machine M4. The idea is similar for the other products.
To find the cheapest unit cost for each product and the machine that generates this, we can use two indexed expressions as follows:
(1) Calculate the cheapest amount of machine cost to manufacture a particular product p (Table Cw_{p}).

(2) What is the machine m that manufactures the cheapest product p (Table CW_{p,m}) ?

Nevertheless, from a practical point of view there might be a problem with this solution. It is certainly the cost minimizing production plan, however the occupation time of the 5 machine in factory F1 is now as follows:

Machine M1 in factory F1 is heavily occupied while all machines in the other factories are idle! (Well, we might evenly distribute the production between the four factories by dividing the quantities QQ_{f,p,m} by four. If the division results not in integers, then we shall round up two and round down two.) Nevertheless, some machines are idle and others are heavily occupied.