I'm looking for an algorithm for the following problem:
I have a set of x distinct components and a set of y supplier for those components. I know the price p(x,y) for each component from each supplier. I also know the shipping cost s(y) for each supplier, which is obviously cheaper if you just buy from just a few suppliers. Not all suppliers have each component available. I want to buy all components once, but need to get the cheapest total price or at least a very closed small value.
The straight forward approach would be to try each combination, which could take some time if x and y get very large, although it could be parallelized. Any suggestions are appreciated.
For simplicity let's say x = 100, y = 1000.
Thanks for all the comments. They pointed me in the right direction, to formulate the problem like displayed below.
Minimize the sum of all items plus shipping costs:
p(0,0)*x00 + p(0,2)*x02 + p(1,2)*x12 + ... + ship(0)*y0 + ship(1)*y1 + ...
with x and y in [0,1], p(n,m) is the price of item n for supplier m and ship(m) is the shipping cost for supplier m
Subject to: