PSEUDO-POLYNOMIAL TIME ALGORITHMS FOR COMBINATORIAL FOOD MIXTURE PACKING PROBLEMS

. A union I = I 1 ∪ I 2 ∪ ··· ∪ I m of m sets of items is given, where for each i = 1 , 2 ,...,m , I i = { I ik | k = 1 , 2 ,...,n } denotes a set of n items of the i -th type and I ik denotes the k -th item of the i -th type. Each item I ik has an integral weight w ik and an integral priority p ik . The food mixture packing problem to be discussed in this paper asks to ﬁnd a union I (cid:48) = I (cid:48) 1 ∪ I (cid:48) 2 ∪ ··· ∪ I (cid:48) m of m subsets of items so that for each i = 1 , 2 ,...,m , the sum weight of chosen items of the i -th type for I (cid:48) i ⊆ I i is no less than an integral indispensable bound b i , and the total weight of chosen items for I (cid:48) is no less than an integral target weight t . The total weight of chosen items for I (cid:48) is minimized as the primary objective, and further the total priority of chosen items for I (cid:48) is maximized as the second objective. In this paper, the known time complexity O ( mnt + mt m ) is improved to O ( mnt + mt 2 ) for an arbitrary m ≥ 3 by a two-stage constitution algorithm with dynamic programming procedures. The improved time complexity ﬁgures out the weak NP-hardness of the food mixture packing problem.


(Communicated by Ruhul Sarker)
Abstract. A union I = I 1 ∪ I 2 ∪ · · · ∪ Im of m sets of items is given, where for each i = 1, 2, . . . , m, I i = {I ik | k = 1, 2, . . . , n} denotes a set of n items of the i-th type and I ik denotes the k-th item of the i-th type. Each item I ik has an integral weight w ik and an integral priority p ik . The food mixture packing problem to be discussed in this paper asks to find a union I = I 1 ∪ I 2 ∪ · · · ∪ I m of m subsets of items so that for each i = 1, 2, . . . , m, the sum weight of chosen items of the i-th type for I i ⊆ I i is no less than an integral indispensable bound b i , and the total weight of chosen items for I is no less than an integral target weight t. The total weight of chosen items for I is minimized as the primary objective, and further the total priority of chosen items for I is maximized as the second objective. In this paper, the known time complexity O(mnt+mt m ) is improved to O(mnt+mt 2 ) for an arbitrary m ≥ 3 by a two-stage constitution algorithm with dynamic programming procedures. The improved time complexity figures out the weak NP-hardness of the food mixture packing problem.
1. Introduction. In this paper, we treat a combinatorial optimization problem arising in actual automated food packing systems known as automatic combination weighers or multi-head weighers (e.g., see Morinaka [12], Wurdemann et al. [13], and web sites [6,14] of manufacturers). The automated food packing system possesses several hoppers with weighing function. Some amount of food (such as a green pepper, a handful of potato chips, some pieces of candies, and so on) is thrown into each weighing hopper, and it is called an item with a weight. The combinatorial optimization problem to be discussed in this paper is a recent mathematical model 1058 SHINJI IMAHORI, YOSHIYUKI KARUNO AND KENJU TATEISHI of the mixture packing operation (see Imahori and Karuno [2]) performed by the automated food packing system, and it is described as follows.
We are given a union I = I 1 ∪ I 2 ∪ · · · ∪ I m of m sets of items, where for i = 1, 2, . . . , m, I i = {I ik | k = 1, 2, . . . , n} denotes a set of n items of the i-th type and I ik denotes the k-th item of the i-th type. Each item I ik has an integral weight w ik and an integral priority p ik . The problem asks to find a union I = I 1 ∪ I 2 ∪ · · · ∪ I m of m subsets of items so that for each i = 1, 2, . . . , m, the sum weight of chosen items of the i-th type for I i ⊆ I i is no less than an integral indispensable bound b i , and the total weight of chosen items for I is no less than an integral target weight t. The latter is known as the target weight constraint, which is a hard constraint imposed on automatic combination weighers from a viewpoint of the service conscience (see Morinaka [12] again). The former is also a hard constraint of the mixture packing operation, which we call the indispensable bound constraint.
The chosen items for I are put into a single package at each mixture packing operation. The resulting empty hoppers are supplied with new items, and each set I i of items of the i-th type is updated by taking the union of the remaining items in I i − I i and the new items of the i-th type, and hence the entire union I is also updated. The automated food packing system repeats the mixture packing operation to produce a large number of mixture packages one by one. Note that the automated food packing system always chooses some current items in hoppers without knowing the weights of next new items.
The total weight of chosen items for I is minimized as the primary objective. This aims at minimizing the total amount of surplus in each mixture package, together with the target weight constraint. Further, the total priority of chosen items for I is maximized as the second objective. During an operating run (i.e., a series of iterations of mixture packing operation), an item may be left in hopper for a long time before it is chosen to be packed (e.g., see Kameoka and Nakatani [7]). In order to prevent such an undesirable situation, the priority may be introduced into each item (e.g., see Karuno et al. [9]), which is defined by a non-decreasing function of the duration in hopper of the item. Current items with longer durations in hoppers are expected to be preferably chosen by the second objective. In fact, for some non-mixture packing operations (i.e., the automated food packing systems handle a single type of items), the previous numerical results have indicated the effectiveness of the second objective upon reducing the durations in hoppers of items (e.g., see Imahori et al. [3], Imahori et al. [4], Karuno et al. [10], Karuno et al. [11]).
In the following section, the food packing problem is going to be described by a lexicographic bi-criteria 0-1 integer programming formulation, which is obviously NP-hard (e.g., see Garey and Johnson [1] for the theory of NP-hardness). Imahori and Karuno [2] have shown that the case of m = 2 can be solved in O(nt) time, which implies that the case of m = 2 is not strongly NP-hard, but it is weakly NP-hard (also see Garey and Johnson [1]). The pseudo-polynomial time algorithm was constructed by combining an O(mnt + mt m ) time algorithm for an arbitrary m ≥ 2 with a linear search technique. Afterward, Imahori et al. [5] have proposed an improved implementation of the O(nt) time algorithm for the case of m = 2. They concluded that the empirical performance for the case of m = 2 indicated its applicability to practical situation. Another mixture packing system handling two types of items has also been considered by Kameoka et al. [8]. However, from the viewpoint of mathematical modeling, the packing operation may be suitable to be categorized into the class of non-mixture ones, since there is exactly one current item of the first type and it must be chosen.
In this paper, we show that for an arbitrary m ≥ 3, the known time complexity O(mnt + mt m ) can be improved into O(mnt + mt 2 ) by a two-stage constitution algorithm with dynamic programming procedures. The proposed two-stage constitution algorithm utilizes a novel and simple O(t) upper bound on the minimum total weight. The improved time complexity is polynomial in m and n, which figures out the weak NP-hardness of the case for an arbitrary m ≥ 3.
2. Problem formulation. For notational convenience, we assume that the automated food packing system possesses n weighing hoppers for each of m types of items by adding some fictitious items to the non-fictitious (i.e., actual) items. In result, it has totally mn weighing hoppers. As in the previous section, for each i = 1, 2, . . . , m, I i = {I ik | k = 1, 2, . . . , n} denotes a set of current n items of the i-th type, and I ik denotes the current k-th item of the i-th type (see Let max denote the total number of mixture packages to be produced during an operating run, which is equivalent to the number of iterations of mixture packing operation during the operating run. Let denote the current iteration number of mixture packing operation (1 ≤ ≤ max ), and let ik denote the iteration number at which item I ik has been thrown into the hopper (when it was empty). Then, we refer to d ik = − ik + 1 as the duration in hopper of item I ik .
An instance of the food packing problem at each mixture packing operation consists of the following input data: • I = m i=1 I i : a union of m sets of items, where for each i = 1, 2, . . . , m, I i = {I ik | k = 1, 2, . . . , n} denotes a set of n items of the i-th type and I ik denotes the k-th item of the i-th type.
• w ik : a positive integer weight of non-fictitious item I ik . It is assumed to be zero for any fictitious item I ik . • p ik (:= d ik ) : a positive integer priority of non-fictitious item I ik . It is assumed to be zero for any fictitious item I ik .
• b i : an indispensable bound for the i-th type items in each mixture package, which is assumed to be a non-negative integer. • t : a target weight of each mixture package, which is assumed to be a positive integer.
For each i = 1, 2, . . . , m and set I i = {I ik | k = 1, 2, . . . , n} of items of the i-th type, let x i = (x i1 , x i2 , . . . , x in ) denote a 0-1 vector, where for k = 1, 2, . . . , n, and let x = (x 1 ; x 2 ; · · · ; x m ) denote the whole list of 0-1 vectors. The food packing problem at each mixture packing operation is formulated by using the list x of m 0-1 vectors as a solution. Note that a list x consists of mn elements, and we are sometimes going to mean the list x by mn 0-1 variables, instead of m 0-1 vectors, in order to follow a conventional 0-1 integer programming formulation. Although the x may also be viewed as an m × n matrix, we emphasize it as a list of m 0-1 vectors. We do not utilize any mathematical feature of matrices for the x, and the algorithm to be designed in this paper is going to pick out the partial list of 0-1 vectors from the first type to the i-th type. The lexicographic bi-criteria 0-1 integer programming formulation of the food packing problem at each mixture packing operation is provided as follows: w ik x ik as the primary objective, p ik x ik as the second objective, subject to x ik ∈ {0, 1}, i = 1, 2, . . . , m, k = 1, 2, . . . , n.
The target weight and indispensable bound constraints for each mixture package are represented by Eqs. (4) and (5), respectively. The binary constraints of variables x ik are expressed by Eq. (6). A solution x = (x 1 ; x 2 ; · · · ; x m ) satisfying Eqs. (4)-(6) is referred to as a feasible solution of problem MIXTURE LEXICO. The primary objective of Eq. (2) aims at attaining the total weight of chosen items for each mixture package as close to the target weight t as possible, together with Eq. (4) (i.e., the target weight constraint). The second objective of Eq. (3) is introduced so that current items with longer durations in hoppers are preferably chosen. (Recall that we solve the food packing problem of off-line setting at each mixture packing operation.) Let µ i = max 1≤k≤n {w ik } denote the maximum weight of an item of the i-th type. In order to omit some trivial cases, the followings are assumed: As a trivial case, it should here be remarked that the case of time by considering m instances of the (nonmixture) food packing problem independently (see Imahori et al. [3]). Further, let w max = max 1≤i≤m {µ i } denote the maximum weight among all mn items in I. Then, by the first assumption in the above (i.e., Eq. (7)), it satisfies that For a given instance of problem MIXTURE LEXICO, let f * denote the minimum of the total weight of chosen items in a feasible solution, and let x =x denote a feasible solution that attains the minimum of the total weight, i.e., f * = f (x). An optimal solution x = x * is defined as a feasible solution such that it satisfies f (x * ) = f * and it maximizes the total priority among feasible solutions with the minimum total weight f * , i.e., it satisfies g(x * ) ≥ g(x) for any feasible solutionx with f (x) = f * . We call g * = g(x * ) the conditionally maximum total priority. Problem MIXTURE LEXICO asks to find an optimal solution x = x * . We call the problem MIXTURE PRIMARY if we are asked to find a feasible solution x =x with the minimum total weight f * (i.e., if the second objective of Eq. (3) is disregarded).
3. Promising partial solutions for each type of items. As mentioned in the first section, we improve the known time complexity O(mnt+mt m ) to O(mnt+mt 2 ) for problem MIXTURE LEXICO with an arbitrary m ≥ 3, which implies that the food packing problem is not strongly NP-hard, but it is weakly NP-hard. The algorithm to be designed in this paper can be seen as a two-stage constitution algorithm with dynamic programming procedures. Since the proposed algorithm utilizes promising partial solutions for each type of items as in our previous papers (see Imahori and Karuno [2], Imahori et al. [5]), we first in this section review the mathematical definition. Then we explain that the partial solutions are obtained by a dynamic programming procedure, which runs in O(nt) time and maintains O(t) promising partial solutions for each type of items. In the following sections, we are going to regard the O(nt) time dynamic programming as the first stage procedure of the proposed algorithm.
3.1. Partial food packing problems. Let us consider the partial food packing problem for each type of items, which can be viewed as a non-mixture food packing problem. For each i = 1, 2, . . . , m, we refer to the i-th 0-1 vector x i = (x i1 , x i2 , . . . , x in ) of a solution x of problem MIXTURE LEXICO as a partial solution (for items of the i-th type). Note that each objective function of the total weight f (x) and total priority g(x) of problem MIXTURE LEXICO can be written by a separable form (see Eqs. (2) and (3)). Each of m partial food packing problems is also a lexicographic bi-criteria 0-1 integer programming problem.
PARTIAL LEXICO (for items of the i-th type) w ik x ik as the primary objective, p ik x ik as the second objective, subject to A partial solution x i = (x i1 , x i2 , . . . , x in ) satisfying Eqs. (13) and (14) is a feasible solution for problem PARTIAL LEXICO (for items of the i-th type), and further we refer to it as a partially feasible solution of the i-th type of problem MIXTURE LEXICO. For an instance of PARTIAL LEXICO (for items of the i-th type), let f ⊥ i denote the minimum of the sum weight of chosen items in a feasible solution of PARTIAL LEXICO (for items of the i-th type), and let , and maximizes the total priority among feasible solutions with the minimum sum a partially optimal solution of the i-th type of problem MIXTURE LEXICO.

3.2.
Upper bounds on the optimal sum weight. Let . , x * in ) denotes the i-th 0-1 vector for i = 1, 2, . . . , m, and let f * i = f i (x * i ) denote the optimal sum weight of the i-th item type. (Recall that we refer to f ⊥ i as the minimum sum weight for problem PARTIAL LEXICO (for items of the i-th type).) Then the minimum total weight satisfies f ( Note that for each i = 1, 2, . . . , m, the partial solution x * i is also feasible for problem PARTIAL LEXICO (for items of the i-th type).
The following lemma has been proved by Imahori et al. [5]: For an instance of problem MIXTURE LEXICO, and for each item type i = 1, 2, . . . , m, let x ⊥ i denote a partially optimal solution of the i-th type with Although the optimal sum weight f * i of chosen items of the i-th type is also bounded by n k=1 w ik from the above, this trivial upper bound may not be evaluated as O(t). On the other hand, the upper bound provided in Lemma 3.1 is surely O(t) by assumption t > w max ≥ µ i (see Eq. (10)). At the first stage of the proposed algorithm, the minimum of the two upper bounds, i.e., is going to be used. Note that it holds O(λ i ) = O(t).
Instead of reviewing the proof by Imahori et al. [5], let us construct a feasible solution for problem MIXTURE LEXICO. From Eq. (9), we here suppose that t − and let which partitions the index set of m types into two disjoint subsets. For each i ∈ S 1 , let κ i define the index of an item of the i-th type such that and for i ∈ S 2 , let κ i = n, (i ∈ S 2 ).
Consider a 0-1 vector x i = (x i1 , x i2 , . . . , x in ) for each i = 1, 2, . . . , m defined by which is a feasible solution for problem PARTIAL LEXICO (for items of the i-th type) since (17)) and κi k=1 w ik = n k=1 w ik ≥ b i for each i ∈ S 2 (see Eq. (8)). It is left to show that the solution x = (x 1 ; x 2 ; · · · ; x m ) consisting of the m 0-1 vectors defined by Eq. (19) satisfies the target weight constraint (see Eq. (4)). If S 1 = ∅, the solution x chooses all mn items, and by assumption (see Eq. (9)), it obviously meets the target weight constraint for a given instance of problem MIXTURE LEXICO. Now, suppose that which implies that the solution x is feasible for an instance of problem MIX-TURE LEXICO. Note that the feasible solution x = (x 1 ; x 2 ; · · · ; x m ) satisfies 3.3. Dynamic programming procedure at the first stage. In order to obtain promising partially feasible solutions for each item type, a dynamic programming procedure is employed for problem PARTIAL LEXICO (for items of the i-th type). Also in this paper, we call the dynamic programming procedure Partial DP (for items of the i-th type) (see Imahori et al. [5]). Without loss of generality, we assume that the first item of each type is a nonfictitious item (i.e., it holds w i1 > 0 and p i1 > 0). The following 0-1 state variables are defined for k = 1, 2, . . . , n and q = 0, 1, . . . , λ i (n.b., the upper bound λ i on the optimal sum weight of the i-th item type was defined in Eq. (16)): There exists a partial 0-1 vector (x i1 , x i2 , . . . , x ik ) such that k j=1 w ij x ij = q ; u ik (q) = 0 ⇐⇒ Such a partial 0-1 vector does not exist.
The priority recoding variables v ik (q) for k = 1, 2, . . . , n and q = 0, 1, . . . , λ i are also defined to maintain the conditionally maximum of total priority k j=1 p ij x ij of the partial 0-1 vector (x i1 , x i2 , . . . , x ik ) with k j=1 w ij x ij = q. Further, two kinds of temporal variables θ 0 and θ 1 are introduced to make each priority recording variable v ik (q) identify the conditionally maximum for the partial 0-1 vector (x i1 , x i2 , . . . , x ik ) with k j=1 w ij x ij = q. (For each priority recording variable v ik (q), at most two possible alternatives should be regarded as shown in Eqs. (23)-(26) later, and each v ik (q) takes the maximum of θ 0 and θ 1 .) The 0-1 state variables and priority recording variables are computed by the following dynamic programming recursives: For q = 0, 1, . . . , λ i , and for k = 2, 3, . . . , n and q = 0, 1, . . . , λ i , The correctness is basically followed by Imahori et al. [3]. The condition of w ik > 0 appearing in Eqs. (23) and (25) is put to exclude any fictitious item from the resulting solution (see Imahori and Karuno [2]). In an implementation of the dynamic programming procedure, it suffices to prepare an O(1) space for maintaining the temporal variables θ 0 and θ 1 (see Imahori et al. [5]), since these variables are referred only for each v ik (q) in Eq. (26). Computing all variables u ik (q) and v ik (q) by Eqs. Further, the priority recording variable v ik (q) takes the maximum of two temporal values θ 0 and θ 1 in Eq. (26). For eachq ∈ S i and for a corresponding partial solutionx i with f i (x i ) =q, the total priority g i (x i ) of chosen items of the i-th type in thex i is the maximum among ones of partial solutions x i with f i (x i ) =q. Hence, we also see that it holds v in (q) = g i (x i ). We therefore obtain the following lemma [5]: Lemma 3.2. Procedure Partial DP (for items of the i-th type) can obtain an or- Note that it holds x ⊥ i =x (1) i , and that no O(s i log s i ) (=O(t log t)) time sorting procedure is required for obtaining the ordered set X i of s i promising partial solutions.

3.4.
Novel upper bounds on the minimum total weight. It should be remarked that a solution x ⊥ = (x ⊥ 1 ; x ⊥ 2 ; · · · ; x ⊥ m ) consisting of m partially optimal solutions for all item types may be infeasible for a given instance of problem MIX-TURE LEXICO, since the solution x ⊥ may fail to meet the target weight constraint of Eq. (4). For the case in which solution x ⊥ meets the target weight constraint (and hence it is a feasible solution for a given instance of problem MIXTURE LEXICO), we can prove the following lemma: is an optimal solution of problem MIXTURE LEXICO. Proof. Let x * = (x * 1 ; x * 2 ; · · · ; x * m ) denote an optimal solution. By the feasibility of solution x ⊥ for the given instance of problem MIXTURE LEXICO and the minimality of f i (x ⊥ i ) for the i-th item type (see Lemma 3.1), we have By the definition of x ⊥ i and the above equation, we also obtain Hence, it holds which means that solution x ⊥ is also optimal for the given instance of problem MIXTURE LEXICO.
This property implies that problem MIXTURE LEXICO is solved in O(mnt) time by computing a partially optimal solution of every item type individually if solution x ⊥ consisting of m partially optimal solutions meets the target weight constraint. Hence, we concentrate on the opposite case in which the solution x ⊥ consisting of m partially optimal solutions fails to meet the target weight constraint.
The following lemma provides another upper bound on the minimum total weight, which are going to be used at the second stage of the proposed algorithm.
then an optimal solution x * satisfies where w max denotes the maximum among all mn weights of items.
Proof. Let x ⊥ = (x ⊥ 1 ; x ⊥ 2 ; · · · ; x ⊥ m ) be a solution consisting of m partially optimal solutions of all item types, and let I ⊥ (⊂ I) denote a subset of items that are chosen in solution x ⊥ . Recall that solution x ⊥ is infeasible for the given instance of problem MIXTURE LEXICO. By the assumption of Eq. (9), at least one item is not chosen for I ⊥ .
We construct a feasible solution x with the solution x ⊥ as follows. First, we choose all the items in I ⊥ (i.e., we initially set as x = x ⊥ ). Since solution x ⊥ has satisfied the indispensable bound constraint for every item type, it is left for us to regard the target weight constraint. We then add the remaining items one by one in an arbitrary order until the total weight of chosen items becomes at least the target weight t. Let w be the weight of the last chosen item, then it holds f (x ) < t + w, which implies the lemma statement.
For notational convenience, we define the upper bound on the minimum total weight in the above lemma by which is going to be used in the following section where we combine m partially feasible solutions of all item types. Note that it holds O(λ) = O(t) (see Eq. (10)).

4.
Combining partial solutions. Suppose that for an instance of problem MIX-TURE LEXICO, the set X i of s i promising partial solutions of PARTIAL LEXICO (for items of the i-th type) in Eq. (27) has been obtained for every item type by applying procedure Partial DP (for items of the i-th type) at the first stage. The m times callings of procedure Partial DP require O(m) × O(nt) = O(mnt) time.
If the condition of Lemma 3.3 holds at the end of the first stage, we are no longer proceeding to the second stage since an optimal solution has been obtained. We represent the set of all combinations of m partial solutions covering over all the types of items by X = X 1 × X 2 × · · · × X m . Each combination in X corresponds to a solution x of problem MIXTURE LEXICO. We see that |X | = O(t m ), and that the set X contains an optimal solution x * by Lemma 3.1.
In this section, we first explain a simple algorithm that enumerates all the possible O(t m ) combinations of promising partial solutions for constructing an optimal solution of problem MIXTURE LEXICO. Then, by utilizing the upper bound on the minimum total weight shown in Lemma 3.4, we design a dynamic programming procedure to find the best combination among the O(t m ) combinations in O(mt 2 ) time, which is the second stage of the proposed algorithm.

4.1.
Enumeration of all combinations of promising partial solutions. It is obvious that for a combination x = (x 1 ; x 2 ; · · · ; x m ) in X , the objective function values f (x) and g(x) can be known in O(m) time since the sum weight f i (x i ) and sum priority g i (x i ) have already been computed by dynamic programming procedure Partial DP at the first stage for i = 1, 2, . . . , m. From the viewpoint of the lexicographic bi-criteria (see Eqs. (2) and (3) [2] showed that problem MIXTURE LEXICO for an arbitrary m ≥ 2 can be solved in O(mnt + mt m ) time.

4.2.
Dynamic programming procedure at the second stage. In this subsection, let x * = (x * 1 ; x * 2 ; · · · ; x * m ) be an optimal solution again for an instance of problem MIXTURE LEXICO with f i (x * i ) = f * i for i = 1, 2, . . . , m. The optimal solution is feasible, and hence under the indispensable bound constraints, i.e., Eq. (5), together with Lemma 3.1, it satisfies On the other hand, by Lemma 3.4 (i.e., f ( Hence, we have In consideration of the above lower and upper bounds on the i-th sum i j=1 f * j of optimal sum weights for i = 1, 2, . . . , m, we combine m sets of promising partial solutions one by one from the first type to the m-th type in the following manner.
For i = 1, 2, . . . , m and for q = (30) for the range of parameter q), we define new 0-1 state variables α i (q) as follows: There exists a partial list (x 1 ; x 2 ; · · · ; x i ) of 0-1 vectors from the first type to the i-th type such that it meets i j=1 f j (x j ) = q and f j (x j ) ≥ f ⊥ j for all j = 1, 2, . . . , i.
α i (q) = 0 ⇐⇒ Such a partial list of 0-1 vectors from the first type to the i-th type does not exist.
We also define new priority recording variables γ i (q) for i = 1, 2, . . . , m and (30) again) to maintain the conditionally maximum of total priority i j=1 g j (x j ) of the partial list (x 1 ; x 2 ; · · · ; x i ) of 0-1 vectors from the first type to the i-th type such that it meets i j=1 f j (x j ) = q and f j (x j ) ≥ f ⊥ j for all j = 1, 2, . . . , i. The 0-1 state variables and priority recording variables are computed by the following dynamic programming recursives: and for i = 2, . . . , m and for q = We call this dynamic programming procedure Combine DP. Each computation of α i (q) requires O(λ i ) = O(t) time to seek for an appropriate integer r in Eq. (33). In the seeking process, if more than one integer r such that f ⊥ i ≤ r ≤ λ i , u in (r) = 1, q − r ≥ i j=1 f ⊥ j and α i−1 (q − r) = 1 is found, the priority recording variable γ i (q) maintains the maximum of total priority with respect to such an integer r by Eq. (34). Hence the time complexity of procedure Combine DP is evaluated by Let Q = {q | α m (q) = 1, t ≤ q ≤ λ} denote a set of promising possible values as the minimum total weight f (x * ) = f * , and let q min = min{q ∈ Q}. Then we see q min = f * . By an appropriate backtracking process, we can know the optimal sum weights f * i for all item types i = 1, 2, . . . , m in additional O(m) time. Further, by applying a backtracking procedure from the value f * i to the computation process of Partial DP (for items of the i-th type) obtained at the first stage, we can construct a partial solution x i = x * i for each i = 1, 2, . . . , m in additional O(n) time. This eventually delivers an optimal solution x * = (x * 1 ; x * 2 ; · · · ; x * m ). The backtracking processes are dominated by the computation of recursives of procedures Partial DP and Combine DP in the sense of the time complexity. Therefore, we have the following result: Obviously, the minimum total weight f * (= f (x * )) is also bounded by m i=1 λ i = O(mt) from the above (see Lemma 3.1). By applying the framework of procedure Combine DP, this trivial upper bound can show that problem MIXTURE LEXICO for an arbitrary m ≥ 3 is weakly NP-hard, while it makes the time complexity of the two-stage constitution algorithm O(mnt + m 2 t 2 ), which is not linear in m.

5.
Conclusions. In this paper, we considered a lexicographic bi-criteria combinatorial optimization problem, which is a recent mathematical model of the combinatorial food mixture packing operation. For the case in which the number of item types is two (i.e., m = 2), an O(nt) time dynamic programming algorithm had been designed, where n is the number of items of each type and t is the integral target weight of each package. This pseudo-polynomial time algorithm was constructed by combining an O(mnt + mt m ) time algorithm for an arbitrary m ≥ 2 with a linear search technique. In this paper, we showed from the theoretical viewpoint of computation that the known time complexity O(mnt + mt m ) can be improved to O(mnt + mt 2 ) for an arbitrary m ≥ 3 by a two-stage constitution algorithm with dynamic programming procedures, which is linear in both of m and n. The proposed pseudo-polynomial time algorithm also figured out the weak NP-hardness of the food mixture packing problem for an arbitrary number m ≥ 3 of item types.
We can obtain a faster implementation of the proposed two-stage constitution algorithm by modifying the dynamic programming procedure at the second stage (see Appendix A), although the theoretical time complexity still remains O(mnt + mt 2 ). For future research, it would be interesting to examine the empirical performance of the proposed algorithm.
Appendix A. Critical index of item type. In this extra section, we consider a modification of the O(mt 2 ) time procedure Combine DP presented in Section 4, although the time complexity remains the same. The key concept is a critical index of item type, which is going to be defined in the following. Let x * = (x * 1 ; x * 2 ; · · · ; x * m ) be an optimal solution again for a given instance of problem MIXTURE LEXICO, and let f * i = f i (x * i ) for i = 1, 2, . . . , m. Further, let x ⊥ i be a partially optimal solution of the i-th item type again for i = 1, 2, . . . , m, and let f ⊥ i = f i (x ⊥ i ). The optimal solution x * is feasible, and as in Section 4, it meets We now define the critical index of item type by The left term of the above inequality (i.e., i j=1 f * j ) is a monotonic non-decreasing function with respect to index i, and the right term (i.e., t − m j=i+1 f ⊥ j ) is also a monotonic non-decreasing function with respect to i. Further, it holds that m j=1 f * j ≥ t at the last index m of item type, which denotes the target weight constraint (see Eq. (4)). Hence, the critical index i * of item type is well-defined, i.e., it surely satisfies 1 ≤ i * ≤ m. In addition, we remark that for each i = i * , i * +1, . . . , m, it holds Lemma A.1. For an instance of problem MIXTURE LEXICO, let x * = (x * 1 ; x * 2 ; · · · ; x * m ) denote an optimal solution, and let x ⊥ i denote a partially optimal solution of the i-th type for each i = 1, 2, . . . , m. Let i * denote the critical index of item type, and we construct a solution x = (x 1 ; x 2 ; · · · ; x m ) as Then, the solution x is also an optimal solution of problem MIXTURE LEXICO.
Proof. By the definition of partially optimal solutions x ⊥ i , it holds f i (x * i ) ≥ f i (x ⊥ i ) ≥ b i for i = 1, 2, . . . , m (see Eq. (15)), and hence each partial solution x i meets the indispensable bound constraint (see Eq. (5)). The total weight of solution x satisfies the target weight constraint (see Eq. (4)), i.e., which implies that the solution x is feasible for problem MIXTURE LEXICO. On the other hand, we have Thus, the solution x attains the minimum total weight f * . With the minimality of f ⊥ i = f i (x ⊥ i ) for the i-th item type, these observations imply f i (x * i ) = f i (x ⊥ i ), i = i * + 1, i * + 2, . . . , m. By the definition of x ⊥ i and the above equation, we obtain g i (x * i ) ≤ g i (x ⊥ i ), i = i * + 1, i * + 2, . . . , m. Hence, it holds and let r i denote the value of r taking the minimum ω i in set Q i . Then, compute and It takes O(t)×O(λ i ) = O(t 2 ) time to obtain F i and G i for each i = 1, 2, . . . , m. As in procedure Combine DP, by an appropriate backtracking, we can know the optimal sum weights f * i for all item types i = 1, 2, . . . , m in additional O(m) time, and the remaining computation process for eventually constructing an optimal solution is also the same as in the original two-stage constitution algorithm. Therefore, problem MIXTURE LEXICO for an arbitrary m ≥ 3 can also be solved in O(mnt+ mt 2 ) time by utilizing the critical index of item type.