Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>Optimal path for N products &lt;=> optimal path for single product.</li> </ol> <p>Indeed, if we need to optimally assemble N of product X, after we optimally (using current stock) assemble one product, question becomes to optimally assemble (N-1) of product X using remaining stock.</p> <p>=> Therefore, it is sufficient to provide algorithm of optimally assembling ONE product X at a time.</p> <ol> <li>Assume we need components x1,..xn for the product (here we only include components not available as components in stock)</li> </ol> <p>For each component xk, find all products that have this component. We will get a list of products for each component - products A1(1),..,A1(i1) have component x1, products A(1),.., A(i2) have component x2, and so forth (some products can be contained in several lists A1,A2,..,An lists).</p> <p>If any of the lists is empty - there is no solution.</p> <p>We need minimal set of products, such that a product from that set is contained in each of the lists. The simplest, but not computationally efficient solution is by brute force - try all sets and pick minimal:</p> <ul> <li>Take union of A1,..,An - call it A (include only unique products in the union).</li> </ul> <p>a. Take single product from A, if it is contained in all A1,..,An - we need only one disassembly (this product). b. Try all combinations of two products from A, if any combination (a1,a2) satisfies condition that either a1 or a2 is contained in each of the lists A1,..,An - it is a solution.</p> <p>...</p> <p>for sure, there is a solution at depth n - one component from each of the lists A1,..,An. If we found no solution prior, this is the best solution.</p> <p>Now, we only need to think about better strategy then brute force check, which I think is possible - I need to think about it, but this brute force approach for sure finds strictly optimal solution.</p> <hr> <p><strong>EDIT:</strong></p> <p>More accurate solution is to sort lists by length. Then when checking set of K products for being solution - only all possible combinations of 1 item from each list from first K lists need to be checked, if no solution there - there is no minimal set of depth K that solves the problem. That type of check will be also computationally no that bad - perhaps it can work????</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload