Body: <p>Assuming I have designed a MOC and thus have a list of parts that I need for it: Is there a software that helps me determine which (quantity of which) &quot;sets&quot; I need to buy?</p>
  <p>In particular, the requirements I see are as follows:</p>
  <ul>
  <li>Input: A list of parts, as in, some unique way of identifying each part by name or so, along with a colour, and required number.</li>
  <li>Input: Eligible &quot;sets&quot; - actually, these sets can simply be part lists of their own. It must be possible to customize the list of eligible sets, as I would like to include e.g. Bluebrixx part packs for certain standard parts instead of relying exclusively on official Lego sets. Also, I might like to list individual pieces from Bricks &amp; Pieces as individual &quot;sets&quot;.</li>
  <li>Input: Pricing information on sets. It must be possible to customize this information, so the prices can be adapted to current offers and discounts.</li>
  <li>Among all eligible sets, the quantity of each &quot;set&quot; selected. Based on this, we could get the ...</li>
  <li>... output: Based on the selected &quot;sets&quot;, I should get an overview of what parts are still missing for the target list, which ones would be left unused, and how much it would cost.</li>
  </ul>
  <p>Optional bonus requirements:</p>
  <ul>
  <li>Some optimization feature that finds the best (= cheapest total, with least surplus parts) list of &quot;sets&quot; automatically. (But I am aware this is computationally hard, if not unsolveable other than by brute force in some cases.)</li>
  <li>Some import facility to automatically retrieve parts lists at least for official Lego sets from some up to date source.</li>
  <li>Part equivalency lists - some parts are just slight variations of other parts with some refinements done to the molds. In practice, though, it doesn't really matter for most models whether a given tile has a groove or not, whether a given brick or panel comes with open or closed studs on top, or whether the negative studs on the underside of a given part have a certain optimized shape. Thus, if parts can be marked as &quot;equivalent&quot; for a given set of parts list, they should be treated as if they were the same part.</li>
  </ul>
  <p>Surely, MOC builders already routinely do this on paper or otherwise manually, but is there already any tool like this available?</p>
  <hr />
  <p>EDIT: Here are some UI sketches that illustrate what I am after:</p>
  <p>Consider, for instance, these input/output tables:</p>
  <p><a href="https://i.sstatic.net/TcLXB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TcLXB.png" alt="UI sketch 1" /></a></p>
  <p>In there, I have listed the required parts for my MOC (obviously, only an example here for the sake of demonstration).</p>
  <p>Also, I have assembled a list of sets to (possibly) buy, along with current pricing information.
  In the same table, I now want to be able to indicate how many copies of each set I'd like to buy.</p>
  <p>The tool should now output the total cost.
  At the same time, it determines which parts I would get beyond the ones from the <em>Required Parts</em> list.</p>
  <p>Note how the resulting output changes based on modifying the count of set copies to buy:</p>
  <p><a href="https://i.sstatic.net/dUEOD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dUEOD.png" alt="UI sketch 2" /></a></p>
  <p>If the selected sets to buy do not cover the entire list of required parts, the tool should notice this:</p>
  <p><a href="https://i.sstatic.net/UyZ3W.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UyZ3W.png" alt="UI sketch 3 with missing parts" /></a></p>
  <hr />
  <p>I have tried to determine whether <strong>Rebrickable</strong> could fulfil these requirements.</p>
  <p>What I could find was that I can compare a given parts list (of a MOC) to another set.
  Alternatively, I can compare such a parts list to another custom parts list.</p>
  <p>Neither of these fulfils the requirement to compare against multiple sets (where &quot;set&quot; can simply mean &quot;a package containing X &gt; 1 times part Y&quot;), and then see what additional parts remain.</p>
  <p>Also, I could not find any way to supply custom price information (based on the particular discount offers that might currently be available where I can conveniently buy) to consider for such a comparison.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T21:40:28.613Z
Comments.Text: https://rebrickable.com/about/
Comments.UserDisplayName: Michael Verschaeve
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-09T21:42:54.253Z
Comments.Text: Does this answer your question? [Is there a software which finds alternate models for owned sets?](https://bricks.stackexchange.com/questions/11484/is-there-a-software-which-finds-alternate-models-for-owned-sets)
Comments.UserDisplayName: Michael Verschaeve
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-10T05:09:44.860Z
Comments.Text: @MichaelVerschaeve: I did suspect Rebrickable can do this, but even after signing up, I could not yet find out how. I found the feature to create custom lists (even though it's limited to just 10 in the free account), but it seems the *Compare Sets* function then only compares the individual parts in those lists, not the sets/MOCs I added. Also, at least so far, I could not find a way to supply a custom price for a given set or even for a certain subset of parts within a list. Thus, I am not convinced Rebrickable is an answer to this question.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-10T09:59:49.427Z
Comments.Text: Consider using pick-a-brick and bricklink to acquire parts individually. There's rarely a need to acquire parts only from sets.
Comments.UserDisplayName: IvanSanchez
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-10T10:45:51.653Z
Comments.Text: @IvanSanchez: My question already contains this among the requirements: 'I would like to include e.g. Bluebrixx part packs for certain standard parts instead of relying exclusively on official Lego sets. Also, I might like to list individual pieces from Bricks & Pieces as individual "sets".'
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-10T16:22:37.860Z
Comments.Text: Unless you create a MOC from single set's elements (an alternate model) there is no easy way to list sets that could be acquired to create your model. Simply because there's usually quite a few unique, obscure, not very common parts. So, instead of buying one set and missing parts you may need to acquire 5+ easily. Also  Rebrickable's "Compare LEGO Sets/Lists" option allows you to compare with Custom lists. I just checked and there is an additional drop list.
Comments.UserDisplayName: Alex
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-10T17:19:22.893Z
Comments.Text: @Alex: I have seen that I can compare with custom lists, but can I somehow subdivide these lists or compare to multiple custom lists at a time? Otherwise, I don't quite understand how I would indicate that I'd buy e.g. [this set](https://www.bluebrixx.com/de/panels/607733/BPP24593-flat-silver-Wall-1-2-circle-2x4x2-w-cutout-X-20-BB-Part-Packs) twice. I think I'm going to edit my question later on by adding an example to better illustrate my use case.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-11T20:34:40.490Z
Comments.Text: @Alex: I have added some example illustrations that hopefully help to understand what I am looking for.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T08:29:44.597Z
Comments.Text: I don't know of any database that contains inventories of non-LEGO sets. Any such resource would be quite useful for (partial) set identification questions regarding non-LEGO sets, so if you know of such a database, by all means please let us know.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T08:51:46.567Z
Comments.Text: @zovits: In this question, I'm not asking for any such database (although it sure would make for a useful import dataset for a tool like the one I'm asking for here). Maybe you can post your own question to ask for such a database; I'd be somewhat interested in that, as well.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T18:15:41.737Z
Comments.Text: I understand - I'm only saying a database would be a requirement for any such tool, but since even that doesn't exist (AFAIK), there's no chance for this tool.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T18:31:06.130Z
Comments.Text: @zovits: I don't think so. The way I've outlined the tool in my question would work well without any comprehensive database. I'd enter the parts lists for the sets manually, because I don't need the entire product range, just the handful of sets I have actually pre-selected to contain any relevant parts.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T19:30:29.903Z
Comments.Text: This is going to be an [optimization / integer programming](https://en.wikipedia.org/wiki/Integer_programming) problem. You want to solve a system of linear equations (or inequalities, in the sense of "at least X") with integral coefficients and integer solutions.
Comments.UserDisplayName: shoover
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T21:55:03.897Z
Comments.Text: @shoover: *If* there were an automated routine to find a good distribution of sets. But as listed in the question, I see that as an optional feature. Primarily, I'd already be happy with the simple addition/subtraction per part and colour required to get an overview based on sets I have picked myself.
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-13T08:16:09.670Z
Comments.Text: @F-H Your example has the 1x10 plates as required parts and the set BPP4477 as suggested "set to buy". How should the tool know what parts are included in any set without a database of sets and parts?
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-13T13:46:08.257Z
Comments.Text: @zovits: As a user, I know that BPP4477 is a possible source of the required parts for my set. Thus, I make this one set known to the tool (as in, within the tool, I add a "set" record and list the parts contained in that set). Same for the other two sets in the "Sets to Buy" list. It's not the tool that picks these sets from some all-encompassing database of sets, it's the user that enters or imports them (parts lists of individual sets are sometimes available e.g. as CSV files or similar).
Comments.UserDisplayName: F-H
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-16T08:12:10.103Z
Comments.Text: @F-H So there should be an additional table in the example above with a list of sets as keys and the contained types and amounts of parts as entries? In that case the question is basically a variant of the multiple-knapsack problem - with a minimum sum limit instead of a maximum.
Comments.UserDisplayName: zovits
Tags: <software><part-database><inventory>
Title: Software to determine sets required to get all parts from a list
UserDisplayName: F-H
ThreadText: # Software to determine sets required to get all parts from a list
  
  (Asked by: username_0 on 2023-10-09)
  
  Assuming I have designed a MOC and thus have a list of parts that I need for it: Is there a software that helps me determine which (quantity of which) "sets" I need to buy?
  
  In particular, the requirements I see are as follows:
  
  * Input: A list of parts, as in, some unique way of identifying each part by name or so, along with a colour, and required number.
  * Input: Eligible "sets" - actually, these sets can simply be part lists of their own. It must be possible to customize the list of eligible sets, as I would like to include e.g. Bluebrixx part packs for certain standard parts instead of relying exclusively on official Lego sets. Also, I might like to list individual pieces from Bricks & Pieces as individual "sets".
  * Input: Pricing information on sets. It must be possible to customize this information, so the prices can be adapted to current offers and discounts.
  * Among all eligible sets, the quantity of each "set" selected. Based on this, we could get the ...
  * ... output: Based on the selected "sets", I should get an overview of what parts are still missing for the target list, which ones would be left unused, and how much it would cost.
  
  Optional bonus requirements:
  
  * Some optimization feature that finds the best (= cheapest total, with least surplus parts) list of "sets" automatically. (But I am aware this is computationally hard, if not unsolveable other than by brute force in some cases.)
  * Some import facility to automatically retrieve parts lists at least for official Lego sets from some up to date source.
  * Part equivalency lists - some parts are just slight variations of other parts with some refinements done to the molds. In practice, though, it doesn't really matter for most models whether a given tile has a groove or not, whether a given brick or panel comes with open or closed studs on top, or whether the negative studs on the underside of a given part have a certain optimized shape. Thus, if parts can be marked as "equivalent" for a given set of parts list, they should be treated as if they were the same part.
  
  Surely, MOC builders already routinely do this on paper or otherwise manually, but is there already any tool like this available?
  
  ---
  
  EDIT: Here are some UI sketches that illustrate what I am after:
  
  Consider, for instance, these input/output tables:
  
  [![UI sketch 1](https://i.sstatic.net/TcLXB.png)](https://i.sstatic.net/TcLXB.png)
  
  In there, I have listed the required parts for my MOC (obviously, only an example here for the sake of demonstration).
  
  Also, I have assembled a list of sets to (possibly) buy, along with current pricing information.
  In the same table, I now want to be able to indicate how many copies of each set I'd like to buy.
  
  The tool should now output the total cost.
  At the same time, it determines which parts I would get beyond the ones from the *Required Parts* list.
  
  Note how the resulting output changes based on modifying the count of set copies to buy:
  
  [![UI sketch 2](https://i.sstatic.net/dUEOD.png)](https://i.sstatic.net/dUEOD.png)
  
  If the selected sets to buy do not cover the entire list of required parts, the tool should notice this:
  
  [![UI sketch 3 with missing parts](https://i.sstatic.net/UyZ3W.png)](https://i.sstatic.net/UyZ3W.png)
  
  ---
  
  I have tried to determine whether **Rebrickable** could fulfil these requirements.
  
  What I could find was that I can compare a given parts list (of a MOC) to another set.
  Alternatively, I can compare such a parts list to another custom parts list.
  
  Neither of these fulfils the requirement to compare against multiple sets (where "set" can simply mean "a package containing X > 1 times part Y"), and then see what additional parts remain.
  
  Also, I could not find any way to supply custom price information (based on the particular discount offers that might currently be available where I can conveniently buy) to consider for such a comparison.
  
  **Tags:** software, part-database, inventory
  > **Comments:**
  > **username_1**: https://rebrickable.com/about/  
  > **username_1**: Does this answer your question? [Is there a software which finds alternate models for owned sets?](https://bricks.stackexchange.com/questions/11484/is-there-a-software-which-finds-alternate-models-for-owned-sets)  
  > **username_0**: @MichaelVerschaeve: I did suspect Rebrickable can do this, but even after signing up, I could not yet find out how. I found the feature to create custom lists (even though it's limited to just 10 in the free account), but it seems the *Compare Sets* function then only compares the individual parts in those lists, not the sets/MOCs I added. Also, at least so far, I could not find a way to supply a custom price for a given set or even for a certain subset of parts within a list. Thus, I am not convinced Rebrickable is an answer to this question.  
  > **username_2**: Consider using pick-a-brick and bricklink to acquire parts individually. There's rarely a need to acquire parts only from sets.  
  > **username_0**: @IvanSanchez: My question already contains this among the requirements: 'I would like to include e.g. Bluebrixx part packs for certain standard parts instead of relying exclusively on official Lego sets. Also, I might like to list individual pieces from Bricks & Pieces as individual "sets".'  
  > **username_3**: Unless you create a MOC from single set's elements (an alternate model) there is no easy way to list sets that could be acquired to create your model. Simply because there's usually quite a few unique, obscure, not very common parts. So, instead of buying one set and missing parts you may need to acquire 5+ easily. Also  Rebrickable's "Compare LEGO Sets/Lists" option allows you to compare with Custom lists. I just checked and there is an additional drop list.  
  > **username_0**: @Alex: I have seen that I can compare with custom lists, but can I somehow subdivide these lists or compare to multiple custom lists at a time? Otherwise, I don't quite understand how I would indicate that I'd buy e.g. [this set](https://www.bluebrixx.com/de/panels/607733/BPP24593-flat-silver-Wall-1-2-circle-2x4x2-w-cutout-X-20-BB-Part-Packs) twice. I think I'm going to edit my question later on by adding an example to better illustrate my use case.  
  > **username_0**: @Alex: I have added some example illustrations that hopefully help to understand what I am looking for.  
  > **username_4**: I don't know of any database that contains inventories of non-LEGO sets. Any such resource would be quite useful for (partial) set identification questions regarding non-LEGO sets, so if you know of such a database, by all means please let us know.  
  > **username_0**: @zovits: In this question, I'm not asking for any such database (although it sure would make for a useful import dataset for a tool like the one I'm asking for here). Maybe you can post your own question to ask for such a database; I'd be somewhat interested in that, as well.  
  > **username_4**: I understand - I'm only saying a database would be a requirement for any such tool, but since even that doesn't exist (AFAIK), there's no chance for this tool.  
  > **username_0**: @zovits: I don't think so. The way I've outlined the tool in my question would work well without any comprehensive database. I'd enter the parts lists for the sets manually, because I don't need the entire product range, just the handful of sets I have actually pre-selected to contain any relevant parts.  
  > **username_5**: This is going to be an [optimization / integer programming](https://en.wikipedia.org/wiki/Integer_programming) problem. You want to solve a system of linear equations (or inequalities, in the sense of "at least X") with integral coefficients and integer solutions.  
  > **username_0**: @shoover: *If* there were an automated routine to find a good distribution of sets. But as listed in the question, I see that as an optional feature. Primarily, I'd already be happy with the simple addition/subtraction per part and colour required to get an overview based on sets I have picked myself.  
  > **username_4**: @F-H Your example has the 1x10 plates as required parts and the set BPP4477 as suggested "set to buy". How should the tool know what parts are included in any set without a database of sets and parts?  
  > **username_0**: @zovits: As a user, I know that BPP4477 is a possible source of the required parts for my set. Thus, I make this one set known to the tool (as in, within the tool, I add a "set" record and list the parts contained in that set). Same for the other two sets in the "Sets to Buy" list. It's not the tool that picks these sets from some all-encompassing database of sets, it's the user that enters or imports them (parts lists of individual sets are sometimes available e.g. as CSV files or similar).  
  > **username_4**: @F-H So there should be an additional table in the example above with a list of sets as keys and the contained types and amounts of parts as entries? In that case the question is basically a variant of the multiple-knapsack problem - with a minimum sum limit instead of a maximum.  
  
  ---
  
  ## 0 answers
  
  