Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Setup
One of key difference between threshold discounts and non-threshold discounts is that you can apply threshold discount only once per checkout cart. For example, say you see a threshold discount of $10 off if you buy $100+. If you have $200+ in the cart that can be split into two groups, each of $100+, we still give you $10 total. In other words, we do not split the products to apply them more than once.
How to apply the threshold discount when it is the only discount for the checkout cart?
It is straightforward to figure out the discount and allocation, following the threshold discount definition.
Threshold discount competes with non-thresholds.
Threshold discount is not fit for knapsack problem in that it would drag down the performance of any knapsack problem because it can generate tons of basic discount applications. Take a checkout cart of 10 different products, each of quantity 1, and ignore the threshold qualification for a second, how many basic discount applications can you have?
Secondly, the result may not be intuitive. For example, two exclusive discounts: a simple discount of $1 off for one keyboard, and a threshold discount of $10 off if you spend more than $100. If you buy 10 keyboards with $20 each. To get the best deal out of the knapsack problem, we would split 20 keyboards into two groups: one group of quantity 15 for simple discount and another group of quantity 5 for threshold discounts.
The recommendation is to leave threshold discounts out of non-threshold discount knapsack problem, and evaluate them after we have evaluated non-threshold discounts.
Threshold discount competes with other threshold discounts.
Strictly speaking, the competition between threshold discounts is a knapsack problem, but it is different from the one between non-threshold discounts.
I do not think the traditional knapsack algorithm is a good fit. Instead, functionally, it make more sense to rank them in some way, and apply in that order. Technically, it is superior too.
Compounding
Let me just say it is big relief for threshold discount compounding, comparing to non-threshold compounding.
Rounding
Rounding is not easy. Forgive me for just leaving it like that for now.
Please sign in to use this experience.
Sign in