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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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