Sorry about the title. Not sure what to call this question.
I am trying to calculate the lowest total cost of lets say a box, circle and square over n amount of suppliers. Each supplier charges a delivery charge for any order. (Very difficult to explain so here's an example)
Supplier A B C Box 10 7 1 Circle 7 9 11 Square 10 8 12 Delivery 5 6 6
If I were to order a single box, circle and square from each supplier, the total order would be
Total 32 30 30
So clearly I would order it from B or C.
However! If I were to order a box from C and the rest from A, then (1 + 6) + (7 + 10 + 5) = 29. So I would be saving myself £1.
The way I figured that out was good ole AAA, BBB, CCC, AAB, AAC, ABC, ACB etc etc and to compare the final result of each selecting the lowest, but I figure there must be a formula out there!?
Some other factors to take into consideration:
- Delivery is dependent on weight, the heavier the order, the more the delivery charge. so 5kg = £5, 10kg = £10. So it may be that ordering two items from supplier A actually causes double the delivery rate.
- There may be more than one of an item, for example, 2 circles, 1 box, 3 squares.
- One supplier might not have all items, for example, supplier C might not have any squares.
- An item may have to be split over suppliers. For example, you want 10 boxes but each supplier only has 5
Welcome to my nightmare :(