A Stochastic Knapsack Problem with Continuous Random Capacity

Problem Statement: The problem of allocating a set of items in order to maximize the toal linear profit under uncertain capacity referred as a stochastic knapsack problem with continuous random capacity was studied theoretically and computationally. Approach: Two optimization based heuristic algorithms were proposed and developed for solving the problem and both efficiency and effectiveness are compared with the general purpose method using the Monte Carlo simulation. Results: For both the relaxed and the original problems, both algorithms with appropriate stepping size parameter were superior on average to the simulation approach in both computing time and solution quality. Conclusion: Therefore, both proposed approaches can be practical for large scale problem and can be used as a basic algorithm for a more complex nature in case of simultaneously random in both items weight and knapsack capacity.


INTRODUCTION
A common integer linear programming (ILP) used to decide which subset of n items or projects should be selected such that the total profit is maximized without exceeding a given capacity or budget is called the Knapsack Problem (KP). The knapsack problem has been extensively studied in operations research [1] . The knapsack problem has various industrial applications such as resource allocation problem, capital budgeting problem, project selection problem, cargo loading problem, cutting stock problem and many others. The knapsack problem of this type is deterministic because all parameters are known with certainty. However, in realistic situations, these parameters may not be known with certainty. Therefore, they have to be considered as random variables having a certain distribution. Thus, this type of problem is called the stochastic knapsack problem. There are few researchers concerning with solving the stochastic knapsack problem, which are usually concentrated with special cases, e.g., Parks and Steinberg [2] , Sniedovich [3] and Henig [4] studied static stochastic knapsack problem when benefit is uncertain. Kleywegt and Papastavrou [5] studied dynamic stochastic knapsack problem when benefit is uncertain. Chiu et al. [6] , Kleywegt et al. [7] , Slyke and Young [8] and Kleywegt and Papastavrou [9] studied dynamic stochastic knapsack problem when benefit and weight are uncertain.
All of the above works concern with studying uncertainty in weight parameters and/or benefit parameters. However, studying uncertainty in capacity is also important. For example, in capital budgeting problem, sometimes, the budget is uncertainty (e.g., there are n alternatives of budget with the probability for each alternative or the budget is random with known probability distribution). In resource allocation problem, sometimes, the available resource is uncertainty (e.g., the available resource is random with known probability distribution). In cargo loading problem, when the truck has many customers to load the items. The available space is unknown before the truck arrived. Hence, the remaining capacity of the truck is uncertainty. There are two types of uncertainty. One possibility is to estimate the probability of occurrence of each state of nature (i.e., there are the previous information). Another is not possible to estimate the probabilities of the states of nature. In this research, the stochastic knapsack problem with continuous probability distribution on capacity was studied.
The studied problem is the problem in which the allocation of decision variable x j is made to meet random capacity with a known distribution. The objective function in this problem may be a total cost, which can be divided into two parts. The first part is the cost of selecting the decision variables x j and the second part is the penalty cost (i.e., shortage and storage cost). When the capacity has continuous probability distribution, the problem is called Stochastic Knapsack Problem with Continuous Random Capacity (SKPCRC). It can be stated as follows: where x j is the decision variable, for j = 1,2,...,n, t j is the upper bound of x j , for j= 1,2,...n, u (b) is the slack variable and u (b)≥0, for L≤b≤U, v(b) is the surplus variable and v(b)≥0, for L≤b≤U, a j is the weight coefficient of item j and a j ≥0, for j = 1,2,...,n, c j is the cost coefficient of item j and c j ≥0, for j = 1,2,...,n, b is the capacity, p(b) is the probability of having capacity b, p(b)≥0, for L≤b≤U, g is the per unit cost of having u(b), g≥0 and h is the per unit cost of having v(b), h≥0.

Materials:
• A personal computer, Intel Pentium M Processor 1.6 GHz., 512 MB RAM, 60 GB hard drive • MATLAB 7.0.1 software • CPLEX 8.1 software (ILOG [10] ) • Visual C.NET software Methods: According to the model, if integer constraint is relaxed, then the relaxed problem is SKPCRCR that can be stated as follows. Similarly to the discrete case, two algorithms were proposed for solving SKPCRCR. The following assumption was assumed. j j j 1 j 1 c / a c / a , for j 1, 2,..., n 1

Algorithm 1 of SKPCRCR:
This algorithm is based on the original approach of Witchakul and Sudas-na-Ayudhaya [11] . There exist three optimality conditions adapted from [12] that are following: The optimal solution is as follows: Next part is to substitute these basic variables into the objective function as follows: Since, the minimum f can be found when all reduced costs of nonbasic variables are greater than or equal to zero. In this case, nonbasic variables are x j , for all j and v(b) for all b. In order to obtain the minimum value of f, the reduced costs of these nonbasic variables must be greater than or equal to zero that are Next part is to substitute these basic variables into the objective function as follows: and j r , for all j. In order to obtain the minimum value of f, the reduced costs of these nonbasic variables must be greater than or equal to zero that are greater than or equal to zero. To minimize f, for all j must be greater than or equal to zero that is equivalent to for all j. According to the assumption j j j 1 j 1 c / a c / a , for j 1,2,..., n 1 . In this case, the minimum value of f is

Case 3:
The optimal solution is as follows: j j x t , j 1,..., k 1 Proof: Suppose k and B have been specified.
The next part is to substitute these basic variables into f (B) . Thus, the function becomes as follows: In this case, nonbasic variables are j x , for j k 1,k 2,...,n, . In order to obtain the minimum value of f, the reduced costs of these nonbasic variables must be greater than or equal to zero that are j k j k c c a / a 0, for j k 1, k 2, ..., n From the above assumption, Therefore, we select B and k such that Algorithm 2 of SKPCRCR: his algorithm was used to find the optimal solution of the SKPCRCR by relaxing the original problem model and utilizing the approach from [13] as follows: For

SH slope of graph H ( ) slope of graph H ( )
The optimal solution can be found by searching for the point that has SH 0 θ = . This is the same criteria as in algorithm 1 of SKPCRCR.

Monte carlo simulation:
Monte Carlo simulation is a natural alternative for using in stochastic programs and can be applied to solve SKPCRCR. In this approach, a numerous number of samples is generated. Then each sample is solved directly as a deterministic problem. The optimal solution is the expected value of all solutions.
For each sample, the problem is as follows.
For the above model, v is always zero because the objective value of solution that have v>0 can be smaller by reducing the value of x j . Therefore, the problem can be reduced to the following problem.

Heuristics for solving SKPDRC and SKPCRC:
The reasons for using heuristics for SKPDRC and SKPCRC are to save computing time and to provide the optimal solution or near-optimal solution. In this work, we adapted the approach used sucessfully in the discrete case as presented in [14,15]  = + and calculate the weight sum, the slack variable (u), the surplus variable (v) and the objective value (f). Otherwise, let k = k+1 and x k = 1 and then calculate the weight sum, the slack variable (u), the surplus variable (v) and the objective value (f). Next, go to the objective value checking point. If the objective value is less than f min , then the new solution is found. Therefore, the old solution is replaced by the new solution. And then go back to the capacity checking point. Otherwise, keep the old solution and go back to the capacity checking point. And continue these steps until the weight sum is greater than or equal to the optimal capacity of the relaxed problem. Finally, the solution of SKPDRC or SKPCRC is found.

RESULTS
The experiments for SKPCRCR and SKPCRC were conducted by varying m and n. The computing time (excluding parameter generating) and solutions obtained were collected and compared. The input data were generated as follows. j j j c ,a , t , for j 1, The reasons for generating j j j c ,a , t , g, and h via uniformly distribution [0,10] were to get the various positions of the optimal solution and the optimal objective function value will not be too large. Moreover, the reason for generating b with normally distributed where mean was generated with uniform ∆ was more delicate, the average absolute percent error of the losing cases tended to be decreased.

DISCUSSION
In order to select the appropriate algorithm, the computing time and the quality of the solutions are important criteria. From all results, it can be concluded that the algorithm 1 (or algorithm 2) with appropriate ∆ was about 57.5 seconds more than the computing time of the Monte Carlo simulation for both SKPCRCR and SKPCRC. However, the percent of win of SKPCRCR was increased from 98-100% while the percent of lose of SKPCRCR was decreased from 2-0%. In addition, the percent of win of SKPCRC was increased from 82-84% while the percent of lose of SKPCRC was decreased from 10-4%.

CONCLUSION
The approaches for solving stochastic knapsack problem with continuous random capacity were presented. For the proposed procedure, the relaxed integer constraints were employed. Next we solved the relaxed problem. Then the optimal solution of the relaxed problem was found as the initial solution for finding the final integer solution. Two algorithms were proposed for solving the relaxed problem (SKPCRCR) and compared with the Monte Carlo simulation. According to the proof of the algorithms 1 and 2 of SKPCRCR, the criteria of these two algorithms were the same. The fifty generated samples were generated to compare an efficiency (i.e., computing time) and effectiveness (i.e., quality of solutions) between the algorithm 1 (or algorithm 2) and the Monte Carlo simulation. For the algorithm 1 (or algorithm 2) of SKPCRCR, if B ∆ was more delicate, the computing time increased but it gave the better solution. As the results, the algorithm 1 (or algorithm 2) of SKPCRCR with appropriate B ∆ was superior to the Monte Carlo simulation of SKPCRCR For SKPCRC where the relaxed problem was solved by using the algorithm 1 (or algorithm 2) of SKPCRCR, if B ∆ was more delicate, the computing time increased but it gave better solution. As the results, the proposed heuristic for solving SKPCRC where the relaxed problem was solved by using the algorithm 1 (or algorithm 2) of SKPCRCR with appropriate B ∆ was superior to the proposed heuristic for solving SKPCRC where the relaxed problem was solved by using the Monte Carlo simulation In addition, the study for characteristic types of generated data, which make the integer solution of the proposed heuristic for SKPCRC where the relaxed solution was solved by using the algorithm 1 (or algorithm 2) of SKPCRCR is worse than integer solution of the proposed heuristic for SKPCRC solved by using the Monte Carlo simulation also should be investigated. Furthermore, it is worth to study the other types of stochastic knapsack problem such as both uncertain benefit and capacity and both weight and capacity.