hi,
I am trying to solve a transportation problem where some routes are un available.I am able to solve the solution by hand but in SAS, can someone help me write solution for the following transportation problem.
In this problem, some routes are un available and since total capacity is not equal to total demand(i.e difference of 30), I added dummy variables to it as shown below
I have added dummy variable here. I dont know how can I write the un available route in sas. When solving by hand, I assigned infinity to these routes.
Can someone help me how to write the solution in sas?
thanks
Ha. It is SAS/OR problem.
Post it at OR forum . @RobPratt is there .
data Products; length Name $10.; input Name $ Profit; datalines; Chocolate 0.25 Toffee 0.75 ; data Processes; length Name $15.; input Name $ Available_time Chocolate Toffee; datalines; Cooking 27000 15 40 Color/Flavor 27000 0 56.25 Condiments 27000 18.75 0 Packaging 27000 12 50 ; proc optmodel; / * declare sets and data indexed by sets * / set <string> Products; set <string> Processes; num Profit{Products}; num AvailableTime{Processes}; num RequiredTime{Products,Processes}; / * declare the variable * / var Amount{Products}; / * maximize objective function (profit) * / maximize TotalProfit = sum{p in Products} Profit[p] * Amount[p]; / * subject to constraints * / con Availability{r in Processes}: sum{p in Products} RequiredTime[p,r] * Amount[p] <= AvailableTime[r]; / * abstract algebraic model that captures the structure of the * / / * optimization problem has been defined without referring * / / * to a single data constant * / / * populate model by reading in the specific data instance * / read data Products into Products=[name] Profit; read data Processes into Processes=[name] AvailableTime=Available_time {p in Products} <RequiredTime[p,name]= col(p)>; / * solve LP using primal simplex solver * / solve with lp / solver = primal_spx; / * display solution * / print Amount; quit;
Ha. It is SAS/OR problem.
Post it at OR forum . @RobPratt is there .
data Products; length Name $10.; input Name $ Profit; datalines; Chocolate 0.25 Toffee 0.75 ; data Processes; length Name $15.; input Name $ Available_time Chocolate Toffee; datalines; Cooking 27000 15 40 Color/Flavor 27000 0 56.25 Condiments 27000 18.75 0 Packaging 27000 12 50 ; proc optmodel; / * declare sets and data indexed by sets * / set <string> Products; set <string> Processes; num Profit{Products}; num AvailableTime{Processes}; num RequiredTime{Products,Processes}; / * declare the variable * / var Amount{Products}; / * maximize objective function (profit) * / maximize TotalProfit = sum{p in Products} Profit[p] * Amount[p]; / * subject to constraints * / con Availability{r in Processes}: sum{p in Products} RequiredTime[p,r] * Amount[p] <= AvailableTime[r]; / * abstract algebraic model that captures the structure of the * / / * optimization problem has been defined without referring * / / * to a single data constant * / / * populate model by reading in the specific data instance * / read data Products into Products=[name] Profit; read data Processes into Processes=[name] AvailableTime=Available_time {p in Products} <RequiredTime[p,name]= col(p)>; / * solve LP using primal simplex solver * / solve with lp / solver = primal_spx; / * display solution * / print Amount; quit;
thank you so much...where is OR forum...i tried to search but couldnt find it..can you help how to find OR forum..thanks
Thank you so much.
I posted my question there but no one is answering 😞
Please can you answer my question. This is the link
sorry I deleted the above post. Now I posted it here
I will greatly appreciate your kind help
thanks
Sorry. I am a rookie of SAS/OR . But you can refer to the example above I posted.
Maybe @RobPratt is too busy to answer your question, tomorrow might he will present at this forum .
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.