Our problem is like this: We have 18 bags into which we put items (say products from factory A). We need the weight of each bag to be as close to 25 lbs as possible (Objective function involves an absolute value operation: Minimize |selected_A[i,j]* weight_A[i] - 25|, for j=1,2,...18 and i is the indiex for items. This objective function needs to be linearized in PROC OPTMODEL which cannot already handle a nonlinear objective function involving integer/binary decision variables). Therefore, we used the following code: set JSET_A = 1..18; var surplus_A {JSET_A} >= 0; var slack_A {JSET_A} >= 0; min objabs_A = sum {j in JSET_A} (surplus_A[j] + slack_A[j]); con obj_alt_A {j in JSET_A}: sum {i in item_id_set_A} selected_A[i,j]* weight_A[i] – surplus_A[j] + slack_A[j] = 25; As you can see, in the above code regarding the assignment of factory A products to bags, we have created a set of binary decision variables known as selected_A[I,j] indicating whether or not item i from factory A is assigned to bag j with 1 being Yes and 0 being No. Now, we need to fill in a second group of 18 bags using products from factory B. Also, we need to worry about the weight of each bag. We would like the weight of each bag to be as close to 30 lbs as possible. Therefore, we have set up our analysis in a way similar to the above one, only changing the index subscript from A to B: set JSET_B = 1..18; var surplus_B {JSET_B} >= 0; var slack_B {JSET_B} >= 0; min objabs_B = sum {j in JSET_B} (surplus_B[j] + slack_B[j]); con obj_alt_B {j in JSET_B}: sum {i in item_id_set_B} selected_B[i,j]* weight_B[i] – surplus_B[j] + slack_B[j] = 30; Obviously, the first analysis is based on one data set containing the weight information of items from factory A whereas the second analysis is based on a second, different data set containing the weight information of items from factory B (i.e., two different date sets are involved in this analysis). Also note that products from the same factory are allowed to be different in weight. With both groups of 18 bags filled up, we need to create a gift packet by pulling one bag randomly from the first 18 bags and a second bag randomly from the second 18 bags. Here, we need to create a constraint which requires the sum of the number of items from the first bag containing factory A products and the number of items from the second bag containing factory B products should be greater than or equal to 3. In other words, we would like a constraint like the following one: sum {i in item_id_set_A} selected_A[i,j]+ sum {i in item_id_set_B} selected_B[i,j]>=3; As you can see, this proposed constraint above involves multiple data sets. I am wondering if it is technically possible to create such a constraint in SAS PROC OPTMODEL? If possible, how (using multiple sub-problems or something else)? Thank you so much!
... View more