I am new to this, but getting into math more and have a question regarding combinations and permutations with several variables involved.
I work for a sales company and this question is based on buying wholesale inventory.
Let's say you have a selection of 25 products...
Of those 25 products you have to select 9 (no repetitions)...
All products are divided into 5 sections...
The 5 sections are Refrigerators, Stereos, Monitors, Computers, and TV's...
For each combination of 9, 2 products must be refrigerators, 2 products must be stereos, 2 products must be monitors, 2 products must be computers, and 1 product must be a TV...
Each product has two variables, wholesale cost and review rating...
I want to calculate the highest possible review rating total for all 9 products together with a wholesale cost budget no higher than $60,000.
Here is a sample chart of cost and value:
Refrigerator 1 Cost: $8900 Rating: 40.3
Refrigerator 2 Cost: $8300 Rating: 35
Refrigerator 3 Cost: $7000 Rating: 33.5
Refrigerator 4 Cost: $7000 Rating: 33.2
Refrigerator 5 Cost: $5900 Rating: 27.2
Stereo 1 Cost: $8000 Rating: 41.3
Stereo 2 Cost: $8200 Rating: 35
Stereo 3 Cost: $7600 Rating: 31
Stereo 4 Cost: $6500 Rating: 27.6
Stereo 5 Cost: $6500 Rating: 24.7
Monitor 1 Cost: $11,400 Rating: 45.5
Monitor 2 Cost: $8700 Rating: 41.6
Monitor 3 Cost: $5300 Rating: 29.1
Monitor 4 Cost: $5700 Rating: 26.4
Monitor 5 Cost: $4900 Rating: 24.7
Computer 1 Cost: $10,800 Rating: 49.8
Computer 2 Cost: $6800 Rating: 31
Computer 3 Cost: $6600 Rating: 23.5
Computer 4 Cost: $5300 Rating: 23.2
Computer 5 Cost: $5300 Rating: 23
TV 1 Cost: $7300 Rating: 35.8
TV 2 Cost: $6700 Rating: 30.2
TV 3 Cost: $6000 Rating: 28
TV 4 Cost: $5400 Rating: 21.9
TV 5 Cost: $4300 Rating: 20.3
I'm not exactly sure how to calculate combinations when using variables such as categories allowed and staying under budget. Any help is very much appreciated. Thank you.
I have tackled your problem with MiniZinc:
(see below an alternative solution with lp_solve)
The result:
I have translated the
floattype ratings to integer type ratings to circumvent a problem with float arrays inMiniZinc. Hopefully, there exist more elegant ways to model such problems inMiniZinc.Alternative solution with lp_solve
Writing the problem as linear programming model:
Result:
Actual values of the variables:
The sum of ratings is $286.8$, the sum of costs is \$ $59900$.