سؤال

Assume that $A$ is the set of objects such that each object $x_i \in A$ has value $w_i$. We wish to pack these objects into group, each pack containing at least $k$ objects. Our goal is to minimize the maximum difference between the maximum and minimum value of each packs. in other words, our goal is to minimize $L$ with the constraint that all packs should have more than $k$ object in them.

$$L = \max_{i \in \mathrm{packs}} \left\{\max_{j \in \mathrm{pack}(i)}w_j - \min_{k \in \mathrm{pack}(i)}w_k \right\}.$$

For example for the following packing, $L$ is $\max{(30-20, 120 - 100)} = 20$. $$[20, 30] \;\; [100,110,120]$$

I was wondering if there is a greedy algorithm that can do the job.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى cs.stackexchange
scroll top