Optimization with minimums and maximums capacity excel
1. Target Company
O p t i m i z a t i o n P r o b l e m
SC0X-MIT
By/ Mostafa Ashour
MM-SCX Student
Excel Solver
Solution Steps
2. Target Company
Target Company is a metal forming company that offers several types of products. One of its
sections produce one product family that consists of three types of products (1) Pin, (2) lock and
(3) coil.
Each type requires a certain number of labor hours and certain amount of steel. The resources
required and profits generated by each type are shown in the table below:
PIN LOCK COIL
LABOR REQ'D 3 hours 5 hours 8 hours
STEEL REQ'D 2 bags 5 bags 8 bags
COST $2K $3K $4K
PRICE $3K $5K $7K
3. Target Company
For the month of January, Target Company has 325 tons of steel and 400 hours of labor available.
Solve this problem optimally so that Target Company profit for January is maximized.
• how many items of the Pin type should Target Company Produce in January?
• how many items of the Lock type should Target Company Produce in January?
• how many items of the Coil type should Target Company Produce in January?
• what is Target Company expected profit for January?
4. Win 10 Excel 365 and Open Solver.
To Solve This problem, We Can Using MS Excel and download Open Solve individually.
Open Solver has been developed for Excel 2007/2010/2013/2016 (including the 64bit versions)
To download open solver
https://opensolver.org/
5. Set-Up Data
Set-Up Variable
Set-Up Objective Function
Set-Up Constrains
Configure Solver
Solve and Check for any errors
Steps of solver
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
6. Step 1 – Set-Up Data
PIN LOCK COIL
LABOR REQ'D 3 hours 5 hours 8 hours
STEEL REQ'D 2 bags 5 bags 8 bags
COST $2K $3K $4K
PRICE $3K $5K $7K
Copy and Format the data can makes
solution easier as we will see.
7. Step 2 – Set-Up Variable
The decision variable is how many
items of each type should
company produce ?
We have Xp, Xl, and Xc
To easier solving decision variable
is the same shape of data
8. Step 3 – Set-Up Objective Function
We need to maximize Profit so, we
calculated Profit (Price-Cost).
Obj.Function is the Profit multiplied by
Decision variable.
So we can write the Obj.Fun as:
=sumproduct(variables_cells,Profits_cell)
9. Step 4 – Set-Up Constrains
In This Part we have two constrains to ensure the available resources.
Using Sum Product function to set up these constrain
We will use this formulas into solver later
10. Step 5 – Configure Solver
Choose Solver from Data tap .
Setting Obj.Fun by its cell.
To>> MAX
Selecting all variable cells
Press add to build constrains
11. Building Constrains
To ensure non negativity of the variables
To set variables as integer
Resource availability constrains
12. Step 5 – Solve and Check for any errors
After setting all constrains, Start solving .
here we can select solving method. But in MILP any
linear engine will do.
13. Now we will do the same steps to continue the problem.
14. Target Company cont.
In February, According to sales department they realized that they should doesn’t produce more
than 40 units of any type and at least 10 units of any type to ensure diversity in March month.
you have decided to both add the new constraints - to ensure diversity and that no more than 40
units of any given type will be offered in the month.
For the month of March, Target Company has 340 tons of Steel and 360 hours of labor available.
PIN LOCK COIL
MIN REQ’D 10 10 10
MAX ALLOWED 40 40 40
15. According To The Optimal solution :
▪ how many units of the Pin type should Target Company offer in March?
▪ how many units of the Lock type should Target Company offer in March?
▪ how many units of the Coil type should Target Company offer in March?
▪ what is Target Company expected profit for March?
16. We have added min and max req. to the data and change the available recourses variables
PIN LOCK COIL
MIN REQ’D 10 10 10
MAX
ALLOWED
40 40 40
Then Add two new constrains to ensure those.
Equal min req. cells
Equal decision variable cells
18. Target Company cont.
In April, The Creative Department of Target Company has figured out a way to add diversity to the
Products, so that Target Company won't get bored doing the same thing over and over, while giving
customers a sense of diversity in the offering. Based on this, the President of the company has
decided to scrap both the mandatory minimum and maximum in the number of Prodcts offered
during April. In other words, these two constraints won't apply any more.
The new acts, however, require renting a special piece of equipment for each type. Because of this,
there is now a fixed cost that Target Company has to pay if they decide to offer a given type of
package in a month. These fixed costs are: $10K a month for the equipment that is rented if any Pin
type are offered, $5K a month for the equipment that is rented if any Lock type are offered, and $1K
a month for the equipment that is rented if any Coil type are offered.
19. Target Company cont.
PIN LOCK COIL
FIXED COST $ 10 $ 5 $ 1
For the month of April, Target Company has 360 tone of steel and 500 hours of labor..
Solve this problem optimally so that Target Company ' profit for April is maximized, while
respecting all the constraints.
20. We have added Fixed cost to the data and change the available recourses variables
PIN LOCK COIL
FIXED COST $ 10 $ 5 $ 1
Adding fixed costs if a type is offered requires the addition of a binary variable.
I recommend set up binary variable in the same shape of integer variable
21. Binary variable is multiplied by the fixed cost of a particular type. Then added on to the objective
function.
It means If the type is used, then the binary constraint is one and the fixed cost is counted in the
objective function. If the type is not used, then the binary constrain is zero and the fixed cost is not
counted in the objective function
Obj.Fun=Sumproduct of the (Profit,
variables) – Sumproduct of the (Fixed
cost,Binary)
22. Binary variable needs to linking constrain to make sure that it properly represents fixed costs.
Here I used 1000 as a big number to establish linking constrains
Xp-1000*y1<=0
y=0 no Xp is used.
y=1 Xp <=1000
and it’s already will.
23. Update your Solver config and solve with the new solution.
Define binary variables Add Linking Constrains (the same way that in previous parts)
Do Not Forget Selecting Binary variable cells with
integer variable as changing decision variables
24.
25. Target Company cont.
he President of Target Company has decided that, to justify paying the fixed costs of renting the
equipment, it makes sense to establish a required minimum number of units of each type. If this
minimum is not offered, it is better - he decides - not to offer any Products of that type.
For the month of May,, Target Company has 400 ton of steel and 460 hours of labor available.
PIN LOCK COIL
FIXED COST $ 10 $ 5 $ 1
MINIMUM IF OFFERED 100 50 10
26. PIN LOCK COIL
FIXED COST $ 10 $ 5 $ 1
MINIMUM IF
OFFERED
100 50 10
Here we will keep fixed cost but also add Minimum if offered constrain.
It means if particular type is produced then minimum amount must be as following.
Min req. is conditioned
by binary. So the
equation will be :
X>=min.req*y
27. Now we have different consideration with different optimal
solutions in order to help manager to decide the best
operating condition