BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Zereul
Calcite | Level 5

Hello,

 

I've got a similar problem to the one here

https://communities.sas.com/t5/Mathematical-Optimization/Optimize-Traveling-Distance/td-p/308817

 

However, say I have an additional column "Type" in my customer table

CustomersPostcodeSalesType
Riya11005198A
Raj11000745A
Sam11003272B
Sompa11000231B
Predy11000348B
David11000576C

 

Portfolio Manager table remains the same

PMPositionPM_PostcodeTerritory
AManager110007NorthDelhi
BAnalyst110051EastDelhi
CManager110032EastDelhi
DAnalyst110003NorthDelh

 

If I want to include an additional constraint - where a portfolio manager can only handle a maximum of (say) 2 customer types, how would I formulate this?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

Here's one way (after declaring and reading type):

   /* a portfolio manager can only handle a maximum of (say) 2 customer types */
   set TYPES = setof {c in CUSTOMERS} type[c];
   var AssignType {TYPES, PORTFOLIO_MANAGERS} binary;
   con AssignTypeCon {<c,p> in CP_PAIRS}:
      Assign[c,p] <= AssignType[type[c],p];
   con AtMostTwoTypes {p in PORTFOLIO_MANAGERS}:
      sum {t in TYPES} AssignType[t,p] <= 2;

View solution in original post

2 REPLIES 2
RobPratt
SAS Super FREQ

Here's one way (after declaring and reading type):

   /* a portfolio manager can only handle a maximum of (say) 2 customer types */
   set TYPES = setof {c in CUSTOMERS} type[c];
   var AssignType {TYPES, PORTFOLIO_MANAGERS} binary;
   con AssignTypeCon {<c,p> in CP_PAIRS}:
      Assign[c,p] <= AssignType[type[c],p];
   con AtMostTwoTypes {p in PORTFOLIO_MANAGERS}:
      sum {t in TYPES} AssignType[t,p] <= 2;
Zereul
Calcite | Level 5

Thanks Rob. Much appreciated!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 754 views
  • 0 likes
  • 2 in conversation