e-commerce: Algorithm for calculating discounts
Assuming that: You can compute all available discounts based on your basket Each product can only have a single discount applied to it Each discount can only be used once Then the problem becomes one that is called an assignment problem and can be optimally solved in O(n^3) using the Hungarian algorithm. You will need … Read more