I have a request to purchase the product from a customer.
I'd like to change that product to the best set of products and buy it at the lowest price.
Please let me know if you have a good algorithm.
Example)
Customer Purchase Request
Item A 20 unit price 200 yen Total price 4000 yen
Item B Unit price 300 yen Total price 3000 yen
Set item
Product AB Set Price 450 Yen
Breakdown
Product A 1 ea
Item B 1p
In the above case, it is best for the customer to purchase 10 units of product AB set and 10 units of product A as a single item.
Please let me know if there is a good algorithm to choose the best combination like this.
It does not matter what language the program is in.
Thank you for your cooperation.
Additional
I looked it up myself, but I thought I could get it if I used dynamic planning, but I don't know how to apply it.
I would appreciate it if you could let me know whether it is dynamic or otherwise.
Example item
Product A 2p set price 400 yen
Product B 2p set price 600 yen
Product C 2p set price 450 yen
Set the sum of the weights with the number as weight and the price as value.
Wouldn't it be best to use dynamic planning for 0-1 knapsack problems?
© 2024 OneMinuteCode. All rights reserved.