C APÍTULO 3 M ARCO C ONCEPTUAL SOBRE EL D UELO
3.1 Modelos Teóricos sobre el Duelo
3.1.2 El modelo psicoanalítico del duelo en Sigmund Freud
A company produces fiberglass by the cubic meter and wishes to plan its production for the next six weeks. The production capacity is limited, and this limit takes a different value in every time period. The weekly demand is known for the entire planning period. The production and storage costs also take different values depending on the time period. All data are listed in the following table.
Table 8.12:Data per week
Production Demand Production Storage Week capacity (m3) (m3) cost (BC/m3) cost (BC/m3)
1 140 100 5 0.2 2 100 120 8 0.3 3 110 100 6 0.2 4 100 90 6 0.25 5 120 120 7 0.3 6 100 110 6 0.4
Which is the production plan that minimizes the total cost of production and storage?
8.5.1
Model formulation
This problem is not much different from the previous ones and it would be easy to solve it using one of the formulations presented earlier in this chapter. To introduce some variation, we are going to use a transshipment flow formulation. Other models of this family will be discussed in the context of transport problems in Chapter10. To start, we draw a network that represents the problem (Figure8.2). This network consists of six nodes for the production in every time period, and six more nodes for the demand in every time period. In the general case, we obtain a network of 2·NT nodes if NT is the number of time periods.
The production nodes form the upper half of the graph. The have been assigned the odd indices 1 to 11 corresponding to time periods 1 to 6. Every node n has a weight CAPnthat corresponds to the production
100 1 4 120 3 6 7 10 9 12 5 5 8 6 6 7 6 100 90 120 110 140 100 110 100 120 100 11 2 8
Figure 8.2:Representation of the network
capacity of the period. The demand nodes are in the lower half of the graph, with the even indices 2 to 12 equally corresponding to time periods 1 to 6. Every demand node n has a weight DEMnthat corresponds to the demand of the time period. An arc with the cost of the production in a period goes from every production node to the demand node of the same period. A second set of arcs weighted with the storage costs connects every demand node to the demand node of the following time period.
A production plan corresponds to a flow in this network. Let flowmndenote the flow on the arc (m, n). The flow on a vertical arc represents the quantity (in cubic meters) of fiberglass produced in the corresponding time period. The flow on a horizontal arc represents the quantity of product carried over to the next time period (stock level). The aim is to compute the minimum cost flow that satisfies the demands and does not exceed the production capacities. The resulting model is a transshipment problem because there are no capacities on the arcs. With COSTmn the cost of an arc (m, n), we obtain the following objective function (total cost of the flow):
minimize X (m,n)∈ARCS
COSTmn· flowmn (8.5.1)
For every time period, the amount carried over to the next period (stock) equals the stock at the begin- ning of the period plus the production of the period minus the demand of the period. This equation results in the constraint (8.5.2) for the first period since there is no initial stock. In other words, the quan- tity stored at the end of the period (flow on arc (2,4)) equals the amount produced in period 1 (flow on arc (1,2)) minus the demand DEM2.
flow24= flow12− DEM2 (8.5.2)
The general stock balance equation (8.5.3) applies to all other periods but the last. For every even index n, the flow between n − 2 and n represents the production in period n / 2, whilst the flow between n − 1 and
n represents the stock carried over from the preceding period. The flow between n and n + 2 represents
the stock at the end of the current period. LAST denotes the last node in the graph (= node with the largest sequence number).
∀n = 4, . . . , LAST − 2, n even : flown,n+2= flown−2,n+ flown−1,n− DEMn (8.5.3)
For the last period, we do not wish to create any final stock, so we obtain the constraint (8.5.4).
flowLAST−2,LAST+ flowLAST−1,LAST− DEMLAST = 0 (8.5.4)
We also need to fulfill the constraints on the production capacity (8.5.5).
∀n = 1, . . . , LAST − 1, n odd : flown,n+1≤ CAPn (8.5.5)
We obtain the following mathematical model. It is not required to state that the flow variables flowmn are integer since this property is automatically given in the optimal solution to the linear problem (this results from LP theory that is not covered in this book).
minimize X (m,n)∈ARCS
COSTmn· flowmn (8.5.6)
flow24= flow12− DEM2 (8.5.7)
∀n = 4, . . . , LAST − 2, n even : flown,n+2= flown−2,n+ flown−1,n− DEMn (8.5.8)
flowLAST−2,LAST+ flowLAST−1,LAST− DEMLAST = 0 (8.5.9) ∀n = 1, . . . , LAST − 1, n odd : flown,n+1≤ CAPn (8.5.10)
8.5.2
Implementation
The mathematical model leads to the following Mosel program. The demand and capacity data (= node weights) have been grouped into a single array WEIGHT, indexed by the node number. The graph with the cost of the arcs is encoded as a two-dimensional array ARC, an entry ARCmnof which is defined if the arc (m, n) is in the network. The value of the entry corresponds to the cost of the arc. The array ARC is given in sparse format in the data filec5fiber.dat.
model "C-5 Fiberglass" uses "mmxprs"
declarations
NODES: range ! Production and demand nodes ! odd numbers: production capacities ! even numbers: demands
ARC: array(NODES,NODES) of real ! Cost of flow on arcs
WEIGHT: array(NODES) of integer ! Node weights (capacities/demand) flow: array(NODES,NODES) of mpvar ! Flow on arcs
end-declarations
initializations from ’c5fiber.dat’ ARC WEIGHT
end-initializations
forall(m,n in NODES | exists(ARC(m,n))) create(flow(m,n)) ! Objective: total cost of production and storage
Cost:= sum(m,n in NODES | exists(ARC(m,n))) ARC(m,n)*flow(m,n) ! Satisfy demands (flow balance constraints)
forall(n in NODES | isodd(n)=FALSE) if(n<getlast(NODES), flow(n,n+2), 0) =
if(n>2, flow(n-2,n), 0) + flow(n-1,n) - WEIGHT(n) ! Production capacities
forall(n in NODES | isodd(n)) flow(n,n+1) <= WEIGHT(n) ! Solve the problem
minimize(Cost) end-model
In this Mosel program, the variables are defined as a dynamic array and therefore need to be created once their index range is known, that is, after the data defining the arcs of the network has been read from file.
We remind the reader that the use of the functionexistsallows Mosel to enumerate only the defined entries of a sparse array, provided that the index sets are named and are the same as those used for the declaration of the array.
The implementation above introduces two new functions: isoddindicates whether the integer value it is applied to is even or odd.getlastreturns the last entry of an array (that is, the entry with the highest index value).
8.5.3
Results
The optimal solution calculated by the Mosel program is a total cost ofBC3,988 with the quantities of fiberglass to be produced and stored in every period shown in Table8.13.
Table 8.13:Production and storage per week
Week 1 2 3 4 5 6
Production 140 80 110 100 110 100
Stock 40 0 10 20 10 0