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

Hi 

For a simplified case, let's assume, I have following data:

idcostprofit_in_case1profit_in_case2
A-11011
B-0.6105
C-0.751010.5
D-0.7510.510

And I have to maximize my profit with decisions,so if I just see the profits as individual rows, I'll have decisions like - 

A - case2, B - case1, C - case2, D-case1.

But I have constraints like, I can only avail costs up to 1.5, so I can't choose A-case2 and B-case1 or A-case2 and C-case2(D-case1), instead I have to choose : C-case2 and D-case1. The final decision for maximum profit will look like:

decision_Costdecision_profit_case1decision_profit_case2
100
100
001
010

 

This way, we have minimized cost (Total = 1.33) and maximized profit (Total = 21) in the constraints that we can chose only one of the decisions to be 1 and total cost doesn't breach the boundary of 1.5.

My original problem has other constraints as well, but if I can get a solution to this one in PROC IML or PROC OPTMODEL, I think I can build from there. Any help is deeply appreciated. I am using SAS 9.4.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

PROC IML 's Genetic Algorithm can do it.

But better use SAS/OR , so post it at OR forum. @RobPratt is there.

View solution in original post

4 REPLIES 4
Ksharp
Super User

PROC IML 's Genetic Algorithm can do it.

But better use SAS/OR , so post it at OR forum. @RobPratt is there.

thepushkarsingh
Quartz | Level 8

Hi @Ksharp, can you please help me with the solution in PROC IML? We need a dynamic solution as no one is sure how many constraints, how many columns will be there. There may be many constraints added in each period and I want the code to be reuseable. Kindly suggest.

Ksharp
Super User

As far as I know, SAS/OR is the best choice . If you are using GA ,that would cost you lots of time. Doesn't @RobPratt  answer your Q, or he is just in busy time .

thepushkarsingh
Quartz | Level 8
Thanks @Ksharp, @RobPratt answered the question and the solution is great. Many thanks to both of you.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 594 views
  • 2 likes
  • 2 in conversation