I was working on an assignment in the domain of E-commerce.
Admin user can create promotions. If promotion applied, the price of an will be item reduced.
A Promotion:
- has many items
- has some conditions which must be fulfilled in order to apply it on items.
- will be on a group of items. After applying promotion, the price of the individual item will be decreased.
Goal: Shopping cart total must be minimized so the user gets the maximum discount. We need to choose a promotion which gives more discount to the user.
What I tried so far:
1) I find item wise promotions. Then select the best promotion for that item. But in some cases, cart total is not minimum.
2) The second approach, prepare the group of items based on promotions, but somehow not able to fix which promotion is the best in terms of the discount.
Which algorithm strategy fits to solve this problem? I have seen Knapsack problem, Traveling Salesman problem, Linear Programming, but somehow not able to figure out.
Example is attached here:
Any pointers will be helpful.