What is the "total score" in this problem?
The total score is the sum of the researcher-paper scores when researcher r is assigned to paper p (that is, when the binary decision variable X[r,p] takes the value 1):
max TotalScore = sum {r in RESEARCHERS, p in PAPERS} score[r,p]*X[r,p];
The input score[r,p] could represent the amount of familiarity researcher r has with the topic of paper p. Such measures are typical in assignment problems.
@PaigeMiller it was posted in OR/MS so an OR solution seems appropriate.
@Reeza wrote:
@PaigeMiller it was posted in OR/MS so an OR solution seems appropriate.
I think that something like Occam's razor ought to be used here. Occam's razor adjusted for programming: The simplest code that meets the requirements is the winner. PROC OPTMODEL is fine if it is necessary, but I don't see any statement from the OP that requires a PROC OPTMODEL solution.
Hello Rob,
Could you demystify the constraint statement below?
What does the "card" mean here?
Thanks,
" con EqualWorkload {r in RESEARCHERS}:
floor(2*card(PAPERS)/card(RESEARCHERS)) <= sum {p in PAPERS} X[r,p] <= ceil(2*card(PAPERS)/card(RESEARCHERS)); "
The CARD operator returns the cardinality of the set. For your example, card(RESEARCHERS) = 3 and card(PAPERS) = 400, so that ratio is the target workload of each researcher. More explicitly:
num targetWorkload = 2*card(PAPERS)/card(RESEARCHERS);
put targetWorkload=;
con EqualWorkload {r in RESEARCHERS}:
floor(targetWorkload) <= sum {p in PAPERS} X[r,p] <= ceil(targetWorkload);
The PUT statement reports targetWorkload=266.66666667 in the log, and the constraint enforces the assignment of either 266 or 267 papers to each researcher.
Hello Rob,
What does X[r,p]>0.5 (in the CREATE statement below) exactly function here?
I tried changing it to 0.1 or 0.3 then it makes no difference in result.
Could you enlighten me?
Thanks,
"create data SolutionData from [researcher paper]={r in RESEARCHERS, p in PAPERS: X[r,p].sol > 0.5} score;"
That is just a safe check for which binary decision variables take the value 1 in the resulting optimal solution. The variable's value can differ from 0 or 1 by a small integer feasibility tolerance (default value is 1e-5). Yes, you should see the same behavior if you use > 0.5 or > 0.1 or > 0.3 or > 0.99 or > 0.0001, etc. But you should not use instead X[r,p].sol = 1 as the logical condition unless you first round the solution. Alternatively, round(X[r,p].sol) = 1 would also be safe.
Thanks so much for the superb solution!
And the SURVEYSELECT method.
data want;
set sashelp.class;
array _ran(3) a b c; *a, b, c are the names of the reviewers;
do i=1 to 3;
_ran(i) = ranuni(25);
end;
first_reviewer = vname(_ran(whichn(smallest(1, of _ran(*)), of _ran(*))));
second_reviewer = vname(_ran(whichn(smallest(2, of _ran(*)), of _ran(*))));
drop a b c i;
run;
Problem is formulated as choose 2 per paper, where you've created a data set with all three reviewers per paper.
A design that approximates a balanced incomplete block design should do the trick. A fully balanced design is not possible with 400 papers and your other constraints. All you need is one simple line:
%mktbibd(b=400,k=2,v=3)
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.