Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is NP-complete for the general case. This can be shown via a reduction of 3-partition (which is a still strong NP-complete version of bin packing).</p> <p>Let <em>w<sub>1</sub>, ..., w<sub>n</sub></em> be the weights of objects of the 3-partition instance, let <em>b</em> be the bin size, and <em>k = n/3</em> the number of bins that are allowed to be filled. Hence, there is a 3-partition if objects can be partitioned such that there are exactly 3 objects per bin.</p> <p>For the reduction, we set N=<em>kb</em> and each bin is represented by <em>b</em> price labels of the same price (think of P<sub><em>i</em></sub> increasing every <em>b</em>th label). Let <em>t<sub>i</sub></em>, 1≤<em>i</em>≤<em>k</em>, be the price of the labels corresponding to the <em>i</em>th bin. For each <em>w<sub>i</sub></em> we have one product S<sub><em>j</em></sub> of quantity <em>w<sub>i</sub> + 1</em> (lets call this the root product of <em>w<sub>i</sub></em>) and another <em>w<sub>i</sub> - 1</em> products of quantity 1 which are required to be cheaper than S<sub><em>j</em></sub> (call these the leave products).</p> <p>For <em>t<sub>i</sub></em> = (2b + 1)<sup>i</sup>, 1≤<em>i</em>≤<em>k</em>, there is a 3-partition if and only if Bob can sell for <em>2b</em>Σ<sub>1≤<em>i</em>≤<em>k</em></sub> <em>t<sub>i</sub></em>:<ul> <li>If there is a solution for 3-partition, then all the <em>b</em> products corresponding to objects <em>w<sub>i</sub></em>, <em>w<sub>j</sub></em>, <em>w<sub>l</sub></em> that are assigned to the same bin can be labeled with the same price without violating the restrictions. Thus, the solution has cost <em>2b</em>Σ<sub>1≤<em>i</em>≤<em>k</em></sub> <em>t<sub>i</sub></em> (since the total quantity of products with price <em>t<sub>i</sub></em> is <em>2b</em>).<br> <li>Consider an optimal solution of Bob's Sale. First observe that in any solution were more than 3 root products share the same price label, for each such root product that is "too much" there is a cheaper price tag which sticks on less than 3 root products. This is worse than any solution were there are exactly 3 root products per price label (if existent).<br> Now there can still be a solution of Bob's Sale with 3 root labels per price, but their leave products do not wear the same price labels (the bins sort of flow over). Say the most expensive price label tags a root product of <em>w<sub>i</sub></em> which has a cheaper tagged leave product. This implies that the 3 root labels <em>w<sub>i</sub></em>, <em>w<sub>j</sub></em>, <em>w<sub>l</sub></em> tagged with the most expensive price do not add up to <em>b</em>. Hence, the total cost of products tagged with this price is at least <em>2b+1</em>.<br> Hence, such a solution has cost <em>t<sub>k</sub>(2b+1)</em> + some other assignment cost. Since the optimal cost for an existent 3-partition is <em>2b</em>Σ<sub>1≤<em>i</em>≤<em>k</em></sub> <em>t<sub>i</sub></em> , we have to show that the just considered case is worse. This is the case if <em>t<sub>k</sub> > 2b</em> Σ<sub>1≤<em>i</em>≤<em>k-1</em></sub> <em>t<sub>i</sub></em> (note that it's <em>k-1</em> in the sum now). Setting <em>t<sub>i</sub></em> = (2b + 1)<sup>i</sup>, 1≤<em>i</em>≤<em>k</em>, this is the case. This also holds if not the most expensive price tag is the "bad" one, but any other. </ul></p> <p>So, this is the destructive part ;-) However, if the number of different price tags is a constant, you can use dynamic programming to solve it in polynomial time.</p>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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