I've been thinking about buying many pieces for MOCs I want to make as cheaply as possible as a classic combinatorial optimization problem, like the kind done by businesses with operations research. The cheapest approach is not to order individual pieces on-demand but to buy lots and lots in bulk (ex. 10 lb boxes on ebay) and maintain my own stockpile of pieces. But I don't have the time and money currently to maintain my own inventory. (I think every kid dreams of having a giant drawer warehouse of bricks like in https://www.youtube.com/watch?v=2xcGgfOVpPM) I first thought about this problem when using Bricklink's wanted lists. By default, when clicking "Buy All", the site sorts by stores with unique lots. I think the reasoning is, if I am buying a decent number of lots and I can get it all from one store, then I will only pay for one store's S&H, which has a good chance of being cheaper than buying from two or more stores. Often this is not possible and I need to buy from two, three, four, or more stores. My approach was to buy using a greedy method for unique lots: try to have one store cover say 90% of lots, then have another one or two stores cover the remaining 10%. The idea here is to minimize the number of stores to buy from to minimize S&H costs. But I haven't actually done experiments to see if this is really a good method or not. It could very well be that buying roughly the same proportion of parts from multiple stores ends up cheaper. Then I found about Bricklink's "Easy Buy" option. Whatever algorithm they use, it usually does a good job in keeping costs low while not buying from too many stores. Some BL stores don't list S&H which can drive up costs, especially for international orders. It doesn't consider Lego's own parts shop which I haven't gotten a chance to use. But it is a lot easier than manually trying combinations. What really inspired me to think about this algorithmically is Rebrickable's Multi-Buy option. They give you more options to tune the algorithm by providing three starting points: cheapest stores, largest stores, and minimize delivery (you can put in an estimated average delivery cost). In my experience, minimize delivery (almost the same as minimizing number of stores) gives the best total prices. Unfortunately they don't have an option for setting two different delivery costs, one for domestic and one for international, since domestic costs are usually a lot lower. Although they both have access to BL seller data, BL's Easy Buy still seems to do a better job finding combinations. I wonder if there are any other automatic tools to try to do this price optimization. As a Bricklink seller I have access to their API but I believe that is for my own store. These weighted set cover type problems are computationally hard but with a strict limit on the total number of stores then they become reasonable to solve fairly well (and the trivial O(n^k) solution for choosing k stores from n total). Here's a CS paper on these kinds of problems if you are interested: https://people.cs.umass.edu/~barna/paper/ICDE15_research_131.pdf (I wouldn't have spent so much time thinking about this if Legos weren't so frickin expensive!)