Imagine you have a room X metres long. You have different parts P of diverse lenghts L and importances I. However, the quantity Q of each part is limited and different. You want to fit in as many of these parts as possible while also prioritizing those with higher importances. ¿How do you do it?
I've been trying to find a better way to resolve this than testing all combinations, but without success. ¿Any suggestions? (And by the way, if this kind of problem has a name, please post it as a comment or a reply)
Example:
Lenth of room: 5m
Number of parts: 4
Part data:Part 1: 0.75m, 1 Units, 2 Importance
Part 2: 1m, 3 Unit, 0.75 Importance
Part 3: 0.47m, 4 Units, 1 Importance
Part 4: 1.33m, 2 Units, 3 ImportanceNow as X, P, L, Q:
X = 5;
P.Lenght = 4;P0.L = 0.75;
P0.Q = 1;
P0.I = 2;P1.L = 1;
P1.Q = 3;
P1.I = 0.75;P2.L = 0.47;
P2.Q = 4;
P2.I = 1;P3.L = 1.33;
P3.Q = 2;
P3.I = 3;