BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

What is the "total score" in this problem?

--
Paige Miller
RobPratt
SAS Super FREQ

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.

Reeza
Super User

@PaigeMiller it was posted in OR/MS so an OR solution seems appropriate. 

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
t75wez1
Pyrite | Level 9

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)); "

RobPratt
SAS Super FREQ

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.

 

t75wez1
Pyrite | Level 9

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;"

RobPratt
SAS Super FREQ

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.

t75wez1
Pyrite | Level 9

Thanks so much for the superb solution!

Reeza
Super User

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. 

 

 

WarrenKuhfeld
Rhodochrosite | Level 12

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)

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

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.

Discussion stats
  • 25 replies
  • 1064 views
  • 4 likes
  • 5 in conversation