priopack
priopack(V, MaxV, JT, B) by [Group] sort [Order], function
A simple variant of the bin packing algorithm intended to be used with a purchase prioritization list. Unlike the classic bin packing algorithm, not only do we seek to optimize the bin capacities, but the ordering of the units will also be preserved as much as possible.
Vis the volume of each line.MaxVis the max volume capacity, its value is homogeneous toV, and it is assumed to be a constant value across the equivalent classGroup.JTis the jumping threshold, its value is homogeneous toV, it is typically expected to be a small multiple of theGroupvalue.Bis an optional argument interpreted as the barrier, when this value is provided, the bin-packing process is not allowed to reorder lines that belong to the same equivalence class as defined byB.Groupis the equivalence class of the suppliers, with bin packing computed per supplier.Ordercontains the ranks of the lines to be packed.