Optimization GBD
Optimization GBD
From Wikipedia
• A Farmer owns 45 hectares of arable land. He would like to produce Wheat and Corn.
• Each Ton of Wheat and Corn can be sold at 200 euros and 300 euros respectively
• Each ha of Wheat requires 2 Tons of fertilizer, and 3 hours of labor. Each ha of Corn, in turns, demand 4
LP Example 1 •
Tons of fertilizer, and 2 hours of labor.
The labor unit cost per worker is 10 euros, and the fertilizer costs 50 euros/Kg.
• Each hectare of Wheat can produce 4 Tons, and each hectare of Corn can produce 4 Tons
• The farmer would like to know which amount of land to assign to the production of each product, to obtain
the greatest possible benefit.
• However, there are some limitations:
• The number of total labor hours available are 100
• The amount of fertilizer available is 120 Tons
• For example, if we arbitrarely set the number of ha for Wheat and Corn to
20 and 25, and replace all the values in the equations, we have that:
Please, verify if these constraints are met, with our initial values of W
and C (20 and 25)
Solution:
. W+C=45 ➔ OK (<= 45)
. 3 x 20+ 2 x 25= 110 ➔ NOT OK (should be <=100 hours)
. 2 x 20 + 4 x 25= 140 ➔ NOT OK (should be<=120 Kg)
We have to iterate, setting new pairs of values (W;C), see if the constraints
are met, and if the Objective Function is maximized.
Allowable Increase/Decrease:
Maximum amount that the
objective coefficients (70, 80)
can increase or decrease,
without changing the present
Solution given by solution (W=20, C=20).
Solver (The obj.function will change,
but not the solution)
Slack represents the difference between the available
resource and the amount of that resource that is actually
utilized in the solution. Slack represents the difference
between the available resource and the amount of that
Shadow Price: The amount that
the objective function would
resource that is actually utilized in the solution.
increase, if the constraint limit
increases one unit (e.g. Labor
from 100 to 101)
Multiple Changes – the 100% Rule
Example: Increase Labor Labor max allowable increase: 20 Fertilizer max allowable decrease: 53.3
Constraint, from 100 to 110, Suggested increase=10, i.e. 50% of Suggested decrease=20, i.e. 38% of the
and decrease Fertilizer´s the max allowable max allowable
from 120 to 100
50% + 38% = 88% <= 100% ➔OK
Definitions
Objective Function: is a performance metric we want to maximize or minimize.
In this example, profit is the objective function to be maximized:
Profit = Sales – Costs
Sales= Tons of Wheat x Price of Wheat +
Tons of Corn x Price of Corn
Costs= Labor Costs + Fertilizer Costs
Labor Costs = (Hours of labor for Wheat + Hours of Labor for Corn) x Labor unit cost
For example, if we arbitrarely set the number of ha for Wheat and Corn to 20 and
25, and replace all the values in the equations, we have that:
For example, if we arbitrarely set the number of ha for Wheat and Corn to 20 and
25, and replace all the values in the equations, we have that:
The goal is to have the highest profit posible, within the present restrictions.
Product A Product B
Price 800 1100
Variable Costs 600 850
Gross Margin 200 250
Manufacturing Hours req. Per unit 10 14
Objective Function:
Total Gross Margin = PA x 200 + PB x 250 (Maximize)
PA = Number units of Product A manufactured
PB = Number units of Product A manufactured
Problem: Fractions of Units?
How do we fix that?
Optimizing - Non Linear cases
The XYZ2 Company manufactures and sells two products: A,
and B.
Product A sells for 500 euros, and B for 600.
The variable costs (which are the costs of the consumable
needed to produce the units) follow a Discount scheme such
as the one in this Table :
The first two columns represent the range of the purchase of the materials. For instance,
for Product A, the cost of purchase of one unit, when buying 50 or less units, is 300
euros.
If the compamy buys 120 units, for example, the unit cost will be 270 euros, and so
forth…
◆ The Retail must receive a MINIMUM quantity each, as specified in the following Table:
Minimum To Be Shipped
Retail Center In (tons)
R1 15
R2 20
R3 25
R4 15
R5 30
R1 Decision Variables:
≥ 15 R5
≥ 30
25 WA
R2
30
≥ 20
WB
R3
45
≥ 25
WC R4
Tons to be shipped
From / To R1 R2 R3 R4 R5 TOTAL ≥ 15
WA XA1 XA2 XA3 XA4 XA5 25
WB XB1 XB2 XB3 XB4 XB5 30
WC XC1 XC2 XC3 XC4 XC5 45
TOTAL >= 15 17 20 15 10
R1 Decision Variables:
≥ 15 R5
≥ 30
25 WA
R2
30
≥ 20
WB
R3
45
≥ 25
WC R4
Tons to be shipped
From / To R1 R2 R3 R4 R5 TOTAL ≥ 15
WA XA1 XA2 XA3 XA4 XA5 25
WB XB1 XB2 XB3 XB4 XB5 30
WC XC1 XC2 XC3 XC4 XC5 45
TOTAL >= 15 17 20 15 10
R1 Decision Variables:
≥ 15 R5
≥ 30
25 WA
R2
30
≥ 20
WB
R3
45
≥ 25
WC R4
Tons to be shipped
From / To R1 R2 R3 R4 R5 TOTAL ≥ 15
X
WA XA1 XA2 XA3 XA4 XA5 25
WB XB1 XB2 XB3 XB4 XB5 30
WC XC1 XC2 XC3 XC4 XC5 45
TOTAL >= 15 17 20 15 10
Objective Function
Transportation costs
From / To R1 R2 R3 R4 R5
Minimum To Be
Retail Center Shipped In (tons)
Tons to be
Warehouse shipped R1 15
R2 17
A 25
R3 20
B 30
R4 15
C 45 R5 10