[IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)...

4
A Pseudo-efficient Frontier Method for Solving Two-Phase Packing Problems David Raz, Arik Sadeh Management of Technology Faculty, HIT - Holon Institute of Technology, Holon, Israel [email protected], [email protected] Abstract—Packing problems are very common and popular but typical solution procedures involve computation of numerous feasible solutions even for a small scale problem. These types of problems are commonly categorized as knapsack problem or bin packing problems and many of them are NP complete. An efficient mechanism for finding an exact solution for a two phase packing problem is proposed. The mechanism reduces the number of feasible solutions considered by conducting a na¨ ıve search for a pseudo efficient frontier of solutions for the first phase. Furthermore, by conduction the first phase in such a way, evaluating the second phase is made more efficient. An algorithm for the two dimensional case is presented along with proofs of correctness and complexity. I. I NTRODUCTION The typical packing problem is a management problem and its application is not only in the area of packing, transportation and logistics but rather in many disciplines of management. Packing problems can be modeled by Mixed Integer Program- ming (MIP) and their solutions are not necessarily achieved in polynomial time.([1]) Heuristics solutions can be found in the literature e. g. [2]. There are two major categories of packing problems, Bin Packing ([3]) and knapsack problems ([4]). Reference [5] givessecSolve2D a survey of heuristic so- lutions of bin packing problems along with their corresponding complexity. We propose an approach for solving packing problems with multiple container types, which we address as two phase packing problems. Our approach is to create a pseudo-efficient frontier and find the optimal solution on that frontier. The suggested mechanism can be extended to various applications in management and engineering. In Section II we present the general two-phase model, and the assumptions we make. We discuss why this assumptions are realistic in a wide range of management and engineering problems. In Section III we present the general idea of the pseudo-efficient frontier method for solving the problem. Sec- tion IV is the major section of this paper. We demonstrate the solution principle in the two dimensional case (two container types). We prove the correctness and the complexity of the solution. Finally, in Section V we bring some concluding remarks. II. MODEL Consider a general packing problem with K types of containers. Let x = {x i },i =1 ...K be a vector describing the number of containers used of each type, x i N (i.e. x N K ). An optimal solution of the packing problem is comprised of x * , an optimal number of containers to use (phase 1), and an assignment of materials to the containers dependent on the actual problem (phase 2) that maximizes the benefit. Let f (x)= f (x 1 ,...,x K ) be the optimal solution of the packing problem, given a specific vector x. We can treat f (x) as either a function of x or a program that is called with x as an input. A brute force solution will solve the packing problem with H K calls to f (x), where H is the maximum number of containers of one type possible. We make the following assumptions on f (x). We use the notation x (k) = {x i },i =1 ...n,i 6= k, that is, a vector of the values of the number of containers for all container types except k. For a given value of x (k) , f (x) is a function of one parameter, x k , the number of containers of type k. We will use f |x (k) (x) to denote this one variable function. Assumption 1. For any given x (k) , f |x (k) (x) is weakly- unimodal. That is, there exists some value m (the mode), such that f |x (k) (x) is weakly monotonically increasing for x m and weakly monotonically decreasing for x m For brevity , in the rest of the work we will use the term unimodality as synonymous to weak-unimodality. This assumption is equivalent to the assumption that for each of the container types the benefit is non-negative up to a point and non-positive from that point onwards, which from our experience is quite realistic. It can be seen as a weaker version of the decreasing benefit assumption (or more accurately non-increasing benefit) for each of the container types, in that we do not require that the benefit is always decreasing (non-increasing). However, if the benefit is decreas- ing (non-increasing) it will also satisfy the requirements of our assumption. We believe that requiring decreasing (non- increasing) benefits with multiple container types is unrealistic. Since f |x (k) (x) is unimodal, we can define an operator mode[f |x (k) (x)], or in short mode(x (k) ), which when given x (k) , returns a mode of f |x (k) (x). Similar to the above notation, x 0 (k) = {x 0 i },i =1 ...n,i 6= k. Assumption 2. If x 0 (k) x (k) then mode(x 0 (k) ) mode(x (k) ). In essence, what this assumption means is that if we increase the number of containers for any of the types other than k, the mode does not increase. The source of this assumption is also quite realistic, al- though it may be less obvious at first sight. The unimodality of the function stems from some limitation, which is a result of the actual packing problem. The meaning of this unimodality 978-1-4577-0739-1/11/$26.00 ©2011 IEEE 181

Transcript of [IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM)...

Page 1: [IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM) - Singapore, Singapore (2011.12.6-2011.12.9)] 2011 IEEE International Conference

A Pseudo-efficient Frontier Method for Solving Two-Phase Packing Problems

David Raz, Arik SadehManagement of Technology Faculty, HIT - Holon Institute of Technology, Holon, Israel

[email protected], [email protected]

Abstract—Packing problems are very common and popularbut typical solution procedures involve computation of numerousfeasible solutions even for a small scale problem. These typesof problems are commonly categorized as knapsack problemor bin packing problems and many of them are NP complete.An efficient mechanism for finding an exact solution for a twophase packing problem is proposed. The mechanism reduces thenumber of feasible solutions considered by conducting a naıvesearch for a pseudo efficient frontier of solutions for the firstphase. Furthermore, by conduction the first phase in such a way,evaluating the second phase is made more efficient. An algorithmfor the two dimensional case is presented along with proofs ofcorrectness and complexity.

I. INTRODUCTION

The typical packing problem is a management problem andits application is not only in the area of packing, transportationand logistics but rather in many disciplines of management.Packing problems can be modeled by Mixed Integer Program-ming (MIP) and their solutions are not necessarily achievedin polynomial time.([1]) Heuristics solutions can be foundin the literature e. g. [2]. There are two major categories ofpacking problems, Bin Packing ([3]) and knapsack problems([4]). Reference [5] givessecSolve2D a survey of heuristic so-lutions of bin packing problems along with their correspondingcomplexity.

We propose an approach for solving packing problems withmultiple container types, which we address as two phasepacking problems. Our approach is to create a pseudo-efficientfrontier and find the optimal solution on that frontier. Thesuggested mechanism can be extended to various applicationsin management and engineering.

In Section II we present the general two-phase model, andthe assumptions we make. We discuss why this assumptionsare realistic in a wide range of management and engineeringproblems. In Section III we present the general idea of thepseudo-efficient frontier method for solving the problem. Sec-tion IV is the major section of this paper. We demonstrate thesolution principle in the two dimensional case (two containertypes). We prove the correctness and the complexity of thesolution. Finally, in Section V we bring some concludingremarks.

II. MODEL

Consider a general packing problem with K types ofcontainers. Let x = {xi}, i = 1 . . .K be a vector describingthe number of containers used of each type, xi ∈ N (i.e.x ∈ NK). An optimal solution of the packing problem iscomprised of x∗, an optimal number of containers to use(phase 1), and an assignment of materials to the containers

dependent on the actual problem (phase 2) that maximizes thebenefit.

Let f(x) = f(x1, . . . , xK) be the optimal solution of thepacking problem, given a specific vector x. We can treat f(x)as either a function of x or a program that is called with x asan input. A brute force solution will solve the packing problemwith HK calls to f(x), where H is the maximum number ofcontainers of one type possible.

We make the following assumptions on f(x).We use the notation x(k) = {xi}, i = 1 . . . n, i 6= k, that

is, a vector of the values of the number of containers for allcontainer types except k. For a given value of x(k), f(x) isa function of one parameter, xk, the number of containersof type k. We will use f|x(k)

(x) to denote this one variablefunction.

Assumption 1. For any given x(k), f|x(k)(x) is weakly-

unimodal. That is, there exists some value m (the mode), suchthat f|x(k)

(x) is weakly monotonically increasing for x ≤ mand weakly monotonically decreasing for x ≥ m

For brevity , in the rest of the work we will use the termunimodality as synonymous to weak-unimodality.

This assumption is equivalent to the assumption that foreach of the container types the benefit is non-negative upto a point and non-positive from that point onwards, whichfrom our experience is quite realistic. It can be seen as aweaker version of the decreasing benefit assumption (or moreaccurately non-increasing benefit) for each of the containertypes, in that we do not require that the benefit is alwaysdecreasing (non-increasing). However, if the benefit is decreas-ing (non-increasing) it will also satisfy the requirements ofour assumption. We believe that requiring decreasing (non-increasing) benefits with multiple container types is unrealistic.

Since f|x(k)(x) is unimodal, we can define an operator

mode[f|x(k)(x)], or in short mode(x(k)), which when given

x(k), returns a mode of f|x(k)(x).

Similar to the above notation, x′(k) = {x′i}, i = 1 . . . n, i 6=

k.

Assumption 2. If x′(k) ≥ x(k) then mode(x′(k)) ≤mode(x(k)).

In essence, what this assumption means is that if we increasethe number of containers for any of the types other than k,the mode does not increase.

The source of this assumption is also quite realistic, al-though it may be less obvious at first sight. The unimodalityof the function stems from some limitation, which is a result ofthe actual packing problem. The meaning of this unimodality

978-1-4577-0739-1/11/$26.00 ©2011 IEEE 181

Page 2: [IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM) - Singapore, Singapore (2011.12.6-2011.12.9)] 2011 IEEE International Conference

is that once we set a value for x(k)) and find the mode m, wecan be certain that using more containers of type k than mis not beneficial. What Assumption 2 means is that increasingthe number of containers used of other types will not lessenthat limitation.

III. SOLUTION PRINCIPLES

To understand the solution we start with a simple Lemma.We will say a specific x is modal for k if xk is a mode

of f|x(k)(x). This is equivalent to saying that given the partial

vector x(k), x is optimal.

Lemma 1. x∗, the vector that maximizes the packing problem,is modal for all k.

Proof: By negation, if x∗ is not modal for some value of kthen replace xk with mode(x(k)) and call the resulting vectorx′. then f(x′) > f(x∗), in contradiction to the optimality ofx∗.

Using this simple Lemma if one can find all values of xwhich are modal for all k, one of these values is certain to bethe optimal value. We will call these values fully-modal. In anutshell, our solution is a method for finding all the values ofx which are fully-modal, in an efficient manner.

A simple approach to this task is to choose one of thecontainer types, say k, and implement mode(x(k)). Due to theunimodality, it can be implemented with at most 2 log2 H callsto f(x). In total, this approach requires 2 log2 HHK−1 callsto f(x). While this is less than the HK calls the brute forcemethod requires, our method goes a step further, requiring atmost aHK−1 calls, where a is a small constant, in essence,reducing the dimension of the problem.

As the set of values of x for which we call f(x) occur on acontinues structure similar to an efficient frontier we call it a”pseudo-efficient frontier” and accordingly we call the methoda ”pseudo-efficient frontier method”. Out method is based onthe capability to find this frontier and evaluate f(x) mostlyfor values on this frontier.

IV. SOLVING FOR TWO-DIMENSIONS

In this section we propose an algorithm for solving theproblem where K = 2, i.e. we have two container types.Instead of using the vector notation we will let x be the numberof containers of type 1 and y be the number of containers oftype 2. The solution of the packing problem is f(x, y).

1) x← 0, y ← 02) Increase y until f(0, y) > f(0, y + 1)3) If f(x, y) > f(x+ 1, y) then

If y = 0 Stop else decrement y, goto Step 34) Increase x until f(x, y) > f(x+ 1, y)5) If y = 0 Stop6) If f(x, y) > f(x, y − 1) then decrement y, goto Step 37) Decrease y until y = 0 or f(x, y) > f(x, y − 1), goto

Step 3The algorithm works as follows. Step 1 starts at (0, 0). Step

2 traverses to the maximum value of y, where the algorithmstarts looking for value (Figure 1).

Y

X

Step 1

Step 2

Fig. 1. Step 1-2

For the moment, ignore Step 3 and Step 6. The algorithmis comprise of two basic steps. Step 4 (Figure 2) increasesthe value of x until the largest mode is found, while Step 7(Figure 3) decreases the value of y until the smallest mode isfound.

Y

X

Step 4

Fig. 2. Step 4

182

Page 3: [IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM) - Singapore, Singapore (2011.12.6-2011.12.9)] 2011 IEEE International Conference

Y

X

Step 7

Fig. 3. Step 7

The basic algorithm runs them alternatively, until y = 0 isreached, when Step 4 is run one final time (Step 5). The setof values of (x, y) shown is the ”pseudo-efficient frontier”.Figure 4 shows a possible complete run of the algorithm.

Y

X

Fig. 4. Complete Run, the Pseudo-efficient Frontier

We now return to Step 3 and Step 6. Step 3 is used when itis impossible to run Step 4 since (x, y) is already the largestmode. We decrement y and repeat. Similarly, Step 6 is usedwhen it is impossible to run Step 7 since (x, y) is already thesmallest mode. In this case we decrement y as well.

A. Proof of Correctness

To prove the correctness of the algorithm all we need toprove is that all the values of the vector (x, y) which are fully-modal are accounted for. Using Lemma 1 this proves that the

optimal value was also accounted for. We also need to showthat the algorithm will always stop.

We claim that Step 4 finds a mode for the current y, whileStep 2 and Step 7 find a mode for the current x. This is clearfor Step 2.

To see why it is true for Step 4 we need to show that amode for that value of y cannot be found by decreasing x.The first time Step 4 is encountered is after Step 2, wherex = 0 and cannot be decreased, and therefore it must finda mode for the current y. Proceeding encounters are alwaysfound after applying either Step 3, Step 6 or Step 7, all ofwhich decreases y. If a mode for y was found by decreasingx it would contradict Assumption 2.

Proving this for Step 7 is similar. Step 7 is always encoun-tered after Step 4, thus finding a mode by increasing y willcontradict Assumption 2.

Having shown that, we will now proceed to show that allfully-modal vectors are encountered. Let us call the value ofy after Step 2, max y. From Assumption 2 we are certainthat for every value of x, there is no mode such that y >max y. Therefore there are no fully-modal vectors such thaty > max y (none of them will be modal for y).

We will proceed by finding all fully-modal vectors such thaty ≤ max y. This is done by finding a mode for each relevantvalue of y. We already noted that Step 4 finds a mode for thecurrent value of y. We need to show that all relevant valuesof y are encountered, i.e. no relevant value of y is skipped.

Note now that Step 3, Step 6 simply decrement y whichcannot skip a value of y. They are used in cases where we arecertain that a mode for the previous value of y was alreadyencountered.

The only remaining step that decreases y without finding amode is Step 7. However, as previously shown, this step findsa mode for the current value of x. Therefore, we are certainthat for each of the values of y ’skipped’ any there cannot bea vector value which is modal for y, and therefore cannot befully-modal. It can therefore be safely skipped. This finalizesthe proof that all fully-modal vector values are encountered.

To show that the algorithm always stops note that thealgorithm starts with y = max y and will return to Step 3only if Step 3, Step 6 and Step 7 were invoked, all of whichdecrease y. Thus, the algorithm keeps decreasing y until itreaches 0, which will cause the algorithm to stop at eitherStep 3 or Step 5.

B. Proof of Complexity

To prove the complexity of the algorithm we will show thatactivates f(x) at most 5H times.

Step 2 increases y up to max y ≤ H and activates f(x) atmost H times (note that this also be implemented in at most2 log2 H calls for extra efficiency).

The algorithm increases x through Step 4. Lets say the finalvalue of x is maxx ≤ H .

Note now that each step either increases x or decreases y.As we start at (0,max y) and finish at (maxx, 0) we can atmost increment x/decrement y 2H times. as each of these can

183

Page 4: [IEEE 2011 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM) - Singapore, Singapore (2011.12.6-2011.12.9)] 2011 IEEE International Conference

require at most two calls to f(x), this accounts for at most4H calls, or 5H calls including Step 2.

Note that this is a worse case analysis. In real cases thevalue is much smaller. Note that requiring two calls to f(x)for an increment/decrement occurs only when either Step 3 isused for the decrement, or when Step 4 or Step 7 are stoppedafter one step. If Step 4 or Step 7 are stopped after, say, nstep, the cost is one additional call to f(x) for the entire nsteps. This is very often the case.

V. CONCLUDING REMARKS

We have proposed a method for solving two-phase packingproblems, using the pseudo-efficient frontier. The methodwas demonstrated for the two-dimensional case. Both thecorrectness and the complexity of the proposed algorithm wereproven.

The efficiency of this method in practical cases still needsto be fully researched. In our preliminary examination weapplied the method to a real world problem of transportinga daily portfolio of goods, which are characterized by volumeand weight. The transportation is done by transporting twotypes of bins that are characterized by their volume andpredetermined allowable weight. The usage of any transportingbin is associated with set up cost as well as extra weight cost,if any.

Our preliminary results show that modeling such a problemas a Mixed Integer Programming problem and trying to solveit by brute force will fail in most cases due to memoryrequirements, or take too long to be practical. Solving theproblem as a two-phase problem by naively going over allpossible configurations of bins does yield a result. Promisingly,our method yields a solution which is as good as the naiveapproach in terms of income, but much more efficiently. Thecomputing time taken is at least 30% less, and in some cases aslow as one tenth of the time. Furthermore, preliminary resultsshow that the method can be made dramatically more efficientby using previous solutions both as lower bounds and as astarting point for following evaluations. However, this requiresmore thorough examination.

Further research is also required for applying the method tohigher dimension problems. While we can devise an algorithm,proving its correctness is not trivial.

REFERENCES

[1] A. C.-C. Yao, “New algorithms for bin packing,” Journal of the ACM,vol. 27, no. 2, pp. 207–227, April 1980.

[2] A. K. Bhatia, M. Hazra, and S. K. Basu, “Better-fit heuristic forone-dimensional bin-packing problem,” in Proceedings of the AdvanceComputing Conference, IACC 2009, Patiala, India, 2009, pp. 193–196.

[3] S. P. Fekete and J. Schepers, “New classes of fast lower bounds for binpacking problems,” Mathematical Programming, vol. 91, no. 1, pp. 11–31, 2001.

[4] S. Khuri, T. Back, and J. Heitkotter, “The zero/one multiple knapsackproblem and genetic algorithms,” in Proceedings of the 1994 ACMsymposium on Applied computing, 1994, pp. 188–193.

[5] E. G. Coffman, M. R. Garey, and D. S. Johnson, “Approximationalgorithms for bin packing: A survey,” in Approximation algorithms forNP-hard problems, D. S. Hochbaum, Ed. Boston, MA.: PWS PublishingCompany, 1997, pp. 46–93.

184