In multihead weighers, packaging processes seek to find the best combination of passage hoppers whose product content provides a total package weight as close as possible to its (nominal) label weight. The weighing hoppers arranged in these machines dispense the product quantity that each package contains through computer algorithms designed and executed for this purpose. For its part, in the packaging process for double-layered multihead weighers, all hoppers are arranged in two levels. The first layer comprises a group of weighing hoppers, and the second comprises a set of booster hoppers placed uprightly or diagonally to each weighing hopper based on design of the machine. In both processes, the initial machine configuration is the same; however, the hopper selection algorithm works differently. This paper proposes a new packaging process optimization algorithm for double-layer upright and diagonal machines, wherein the hopper subset combined has previously been defined, and the packaging weight is expressed as actual values. As part of its validation, product filling strategies were implemented for weighing hoppers to assess the algorithm in different scenarios. Results from the process performance metrics prove that the new algorithm improves processes by reducing variability. In addition, results reveal that some machine configurations were also able to improve their operation.