I have a list of items that I want to buy. Items are offered at different stores and at different prices. The stores have individual shipping costs. I am looking for an optimal purchase strategy (and maintain its java library) to buy all items with a minimum total price.
Example:
- Item1 is offered at Shop1 for $ 100, at Shop2 for $ 111.
- Item2 is offered at Shop1 for $ 90, at Shop2 for $ 85.
- Shipping cost Shop1: $ 10, if the total order is <$ 150; $ 0 otherwise
- Shipping cost Shop2: $ 5 if total order <$ 50; $ 0 otherwise
- If I buy Item1 and Item2 at Shop1, the total cost is $ 100 + $ 90 + $ 0 = $ 190.
- If I buy Item1 and Item2 at Shop2, the total cost is $ 111 + $ 85 + $ 0 = $ 196.
- If I buy Item1 in Shop1 and Item2 in Shop2, the total cost is $ 100 + $ 10 + $ 85 + $ 0 = 195.
I get a minimum price if I order Item1 and Item2 in Shop1: $ 190
Question
I need some tips on which algorithms can help me solve this kind of optimization problem for the number of items around 100 and the number of stores around 20.
I already looked at apache-math and its optimization package , but I have no idea which algorithm to look for.
Here is the next question.
source
share