2. The company SchoolDesk produces desks of different sizes for kindergartens, p
ID: 3352238 • Letter: 2
Question
2. The company SchoolDesk produces desks of different sizes for kindergartens, primary and secondary schools, and colleges. The legs of the desks all have the same diameter, with different lengths: 40 cm for the smallest ones, for medium height, and 70ch for the largest ones. These legs are cut from steel bars of 1.5 meters. The company has received an order for 108 small, 125 medium and 100 large desks. How should this order be produced if the company wishes to minimize the trim loss? a. Find all possible cutting patterns. b. Write an integer programming model in order to find the optimal solution.Explanation / Answer
VARIABLES
patterns - different cutting patterns
demand - different length demand
loss - each pattern loss
lengths - length
patterns = [ 0 0 2 0 2 3 0 0 1 3 0 5;...
0 1 0 2 1 0 1 2 0 0 3 0;...
2 1 1 0 0 0 2 1 2 1 0 0];
demand = [108;125;100]*4;
loss = [10 20 0 30 10 30 0 10 20 10 20 0];
lengths = [150;200];
p = size(patterns,2);
use = tom('use',p,1,'int');
% Bounds
bnds = {use >= 0};
% Minimum demand must be met
con = {pattern*use >= demand};
% Objective
objective = sum(lengths(1)*use(1:end/2) + lengths(2)*use(end/2+1:end));
% Constant to be deducted from objective
objective = objective - 75200;
constraints = {bnds,con};
options = struct;
options.solver = 'cplex';
options.name = 'cutting steel bars';
sol = ezsolve(objective,constraints,[],options);
loss = sum(sol.use.*loss);
Prilev = 1;
if Prilev > 0
x = sol.use;
idx = find(x);
order = [x(idx) idx];
disp(['a minimum loss of' num2str(loss) ' is found with this combination
for i = 1:length(idx),
disp(['cut' num2str([order(i,1)]) ' bar(s) in pattern ' num2str([order(i,1)]
end
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.