<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc OPTMODEL Basics in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630713#M3020</link>
    <description>&lt;P&gt;You have declared the PTCD set but not used it.&amp;nbsp; Here is proper syntax for the constraint that currently gives you an error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con Min_Qty_at_LSP_is_Respected {c in LSP}:
   sum{&amp;lt;p,t,(c),d&amp;gt; in PTCD} ContainersfromPortstoLSPtoDC[p,t,c,d]*Assign[p,t,c,d] &amp;gt;= Min_Qty_LSP*Is_LSP[c];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that this constraint is nonlinear because it contains a multiplication of variables.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2020 19:04:18 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2020-03-09T19:04:18Z</dc:date>
    <item>
      <title>Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630655#M3016</link>
      <description>&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;Am starting a new thread. I want to understand some basics. I have four nodes in my network. A set of locations called Ports that is indexed by P. From P, the products flow to&amp;nbsp; a set of Transits (t) and from there it flows to a set of&amp;nbsp; LSP (c) and from there it goes to the final destination (d). The demand is an array that is indexed over p and d only. This is an input and the solve is to find the cheapest combination of p-t-c-d .&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 41 ports, 9 LSP, 28 transits and 18 destinations for a total combination of 41*9*28*18 = 185,976 combinations. However, I do not have demand from all p to all d. Also, I do not have all 185,976 combinations of rates as well. There are only 3,000 ish out of 185,976 that has a valid rates, all others are 0.&amp;nbsp; When i prepped the data, i made sure I have all the possible cartesian combination possible . Those that has a valid cost or demand, thats good but if it does not, I said the value is 0. Is this a right approach? Alternatively, since I am doing cost minimization, I artificially inflated my 0 costs entries to a very high number like 100000 so that the model does not choose those in the solution. I am sure this is not the right method which is why i am trying to have a constraint called "UseProperRates" .&lt;/P&gt;&lt;P&gt;My question is how do i tell the model to ignore all 0 rates and demand.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;set &amp;lt;str&amp;gt; Ports;&lt;BR /&gt;set &amp;lt;str&amp;gt; DC;&lt;BR /&gt;set &amp;lt;str&amp;gt; LSP;&lt;BR /&gt;set &amp;lt;str&amp;gt; Transit;&lt;/P&gt;&lt;P&gt;read data STDOPT.PN3158_Ports into Ports=[PortSource];&lt;BR /&gt;read data STDOPT.PN3158_DC into DC=[RateMatchDest];&lt;BR /&gt;read data STDOPT.PN3158_LSP into LSP=[LSP];&lt;BR /&gt;read data STDOPT.PN3158_TRANSIT into Transit=[Transit];&lt;/P&gt;&lt;P&gt;num Containers {Ports,DC};&lt;BR /&gt;read data STDOPT.PN3158_data into [PortSource RateMatchDest] Containers=FEU;&lt;BR /&gt;print containers;&lt;/P&gt;&lt;P&gt;/*END OF GETTING FEU DATA*/&lt;/P&gt;&lt;P&gt;var Is_LSP {LSP} binary;&lt;BR /&gt;var IsLSPDC {LSP,DC} binary;&lt;BR /&gt;var IsPortsLSPDC {Ports,LSP,DC} binary;&lt;BR /&gt;var IsPortsTransitLSPDC {Ports,Transit,LSP,DC} binary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* declare Constants*/&lt;BR /&gt;num Min_Qty_LSP=0;&lt;BR /&gt;NUM BigM;&lt;BR /&gt;READ DATA STDOPT.PN3158_BigM INTO BigM=FEU;&lt;/P&gt;&lt;P&gt;/*RATES*/&lt;BR /&gt;num InboundLinehaul {Ports,Transit,LSP,DC};&lt;BR /&gt;read data STDOPT.PN3158_RATES into [PortSource Transit LSP RateMatchDest] InboundLinehaul=Rate;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* DECISON VARIABLE */&lt;BR /&gt;var ContainersfromPortstoLSPtoDC {Ports,Transit,LSP,DC}&amp;gt;=0;&lt;/P&gt;&lt;P&gt;/* IMPLIED VARIABLE */&lt;BR /&gt;impvar Inbound_Linehaul_Costs= sum {p in Ports, t in Transit,c in LSP, d in DC} InboundLinehaul [p,t,c,d] *ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatLSP{c in LSP}=sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatTransitLSP{t in Transit, c in LSP}=sum{p in Ports,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* declare Objective Function*/&lt;BR /&gt;Min TotalCost = Inbound_Linehaul_Costs;&lt;/P&gt;&lt;P&gt;/* GENERAL CONSTRAINTS */&lt;BR /&gt;con Min_Qty_at_LSP_is_Respected {c in LSP}:&lt;BR /&gt;sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d]&amp;gt;=Min_Qty_LSP*Is_LSP[c];&lt;/P&gt;&lt;P&gt;con ModelOutput_Same_As_ModelInput {p in Ports, d in DC}:&lt;BR /&gt;sum {t in Transit,c in LSP} ContainersfromPortstoLSPtoDC[p,t,c, d] = Containers [p,d];&lt;/P&gt;&lt;P&gt;con CheckLSP {c in LSP}: ContainersatLSP[c] &amp;lt;= BigM*Is_LSP[c];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;con UseProperRates{p in Ports, d in DC}:&lt;BR /&gt;Sum{t in Transit, c in LSP}IsPortsTransitLSPDC[p,t,c,d]*InboundLinehaul [p,t,c,d] &amp;gt;=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**expand / constraint;&lt;BR /&gt;solve with milp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 15:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630655#M3016</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-09T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630661#M3017</link>
      <description>&lt;P&gt;Instead of indexing the variables by the full Cartesian product and then using high penalties to avoid certain &amp;lt;p,t,c,d&amp;gt; tuples, it is much more efficient and numerically preferable to use a sparse set of tuples, as shown in the &lt;A href="https://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetTarget=ormpug_optmodel_examples07.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;Sparse Modeling example from the documentation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 15:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630661#M3017</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2020-03-09T15:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630672#M3018</link>
      <description>&lt;P&gt;THanks Rob.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will look into this very closely and will try to do changes accordingly.&lt;/P&gt;&lt;P&gt;I will try it out now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 16:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630672#M3018</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-09T16:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630710#M3019</link>
      <description>&lt;P&gt;Hi Rob&lt;/P&gt;&lt;P&gt;I have this toy model.&amp;nbsp; I have a new set called PTCD and an assign variable that is binary.&amp;nbsp; I was trying to use these in the constraints but I am not sure if I need to. Also, I added the new constraint "UseProperRates " to limit my model to use those rates that are less than $40. I got an error.&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: The array subscript 'Assign[air,G,M,A1]' is invalid at line 125 column 78.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: The array subscript 'Assign[sea,G,O,U1]' is invalid at line 125 column 78.&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am kind of lost now . I want to have the "sparse model " structure done so that I can layer in constraints one by one . But my basic general constraints does not seem to work. Can you please help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;set&amp;lt;str&amp;gt; Ports=/'sea' 'air'/;&lt;BR /&gt;set&amp;lt;str&amp;gt; DC=/'A1' 'U1'/;&lt;BR /&gt;set&amp;lt;str&amp;gt; LSP=/'M' 'O' 'C'/;&lt;BR /&gt;set &amp;lt;str&amp;gt; Transit=/'W','E','G'/;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;num Containers {Ports,DC}= [2000,3000,1000,4000];&lt;BR /&gt;var Is_LSP {LSP} binary;&lt;BR /&gt;var IsLSPDC {LSP,DC} binary;&lt;BR /&gt;var IsPortsLSPDC {Ports,LSP,DC} binary;&lt;BR /&gt;var IsPortsTransitLSPDC {Ports,Transit,LSP,DC} binary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* declare Constants*/&lt;BR /&gt;num Min_Qty_LSP=2000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*RATES*/&lt;BR /&gt;num InboundLinehaul {Ports,Transit,LSP,DC}= [40,10,30,5,20,10,&lt;BR /&gt;20,6,30,7,3,5,&lt;BR /&gt;2,6,2,60,18,4,&lt;BR /&gt;32,70,2,30,18,40,&lt;BR /&gt;19,10,2,29,3,9,&lt;BR /&gt;42,36,79,10,5,14&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set PTCD = {p in Ports,t in Transit, c in LSP,d in DC : Inboundlinehaul[p,t,c,d] &amp;lt;=40};&lt;BR /&gt;var Assign {PTCD} binary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* DECISON VARIABLE */&lt;/P&gt;&lt;P&gt;var ContainersfromPortstoLSPtoDC {Ports,Transit,LSP,DC}&amp;gt;=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* IMPLIED VARIABLE */&lt;BR /&gt;impvar Inbound_Linehaul_Costs= sum {p in Ports, t in Transit,c in LSP, d in DC} InboundLinehaul [p,t,c,d] *ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatLSP{c in LSP}=sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatTransitLSP{t in Transit, c in LSP}=sum{p in Ports,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* declare Objective Function*/&lt;BR /&gt;Min TotalCost = Inbound_Linehaul_Costs;&lt;/P&gt;&lt;P&gt;/* GENERAL CONSTRAINTS */&lt;BR /&gt;con Min_Qty_at_LSP_is_Respected {c in LSP} :&lt;BR /&gt;sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d]*Assign[p,t,c,d]&amp;gt;=Min_Qty_LSP*Is_LSP[c];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con ModelOutput_Same_As_ModelInput {p in Ports, d in DC}:&lt;BR /&gt;sum {t in Transit,c in LSP} ContainersfromPortstoLSPtoDC[p,t,c, d] = Containers [p,d];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con CheckLSP {c in LSP}: ContainersatLSP[c] &amp;lt;= 10000*Is_LSP[c];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*con UseProperRates {p in ports, t in transit, c in LSP, d in DC: InboundLinehaul [p,t,c,d] &amp;gt;=40}:&lt;BR /&gt;IsPortsTransitLSPDC[p,t,c,d] = 0;*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;solve with milp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 18:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630710#M3019</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-09T18:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630713#M3020</link>
      <description>&lt;P&gt;You have declared the PTCD set but not used it.&amp;nbsp; Here is proper syntax for the constraint that currently gives you an error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con Min_Qty_at_LSP_is_Respected {c in LSP}:
   sum{&amp;lt;p,t,(c),d&amp;gt; in PTCD} ContainersfromPortstoLSPtoDC[p,t,c,d]*Assign[p,t,c,d] &amp;gt;= Min_Qty_LSP*Is_LSP[c];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that this constraint is nonlinear because it contains a multiplication of variables.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630713#M3020</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2020-03-09T19:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630719#M3021</link>
      <description>&lt;P&gt;Thanks Rob.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah i agree that it is now non linear. I tried to do just the solve and not solve with milp. But there are integer variables and so based on what SAS said I used solve with LSO; It does seem to work. Do you see any problems with this approach?&lt;/P&gt;&lt;P&gt;I will add the set (PTCD) to my other constraints based on the syntax and you gave. I will let you know if i have questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for everything. You are the best.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630719#M3021</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-09T19:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630728#M3022</link>
      <description>&lt;P&gt;The LSO solver is designed for problems with at most around 100 variables and does not provide any measure of optimality.&amp;nbsp; When you get the code working, please post again, and I will see whether your problem can be linearized so that you can use the MILP solver.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630728#M3022</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2020-03-09T19:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc OPTMODEL Basics</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630735#M3023</link>
      <description>&lt;P&gt;Thanks ROb. I added the set {PTCD} to my other two general constraints. I have not changed anything on the specific constraints that I will layer once the skeleton of the problem is built.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for the toy model.&amp;nbsp; When I ran this, it said "the best solution does not satisfy feasibility tolerance" and so the solution status said "failed".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cas;&lt;BR /&gt;caslib _all_ ASsign;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;set&amp;lt;str&amp;gt; Ports=/'sea' 'air'/;&lt;BR /&gt;set&amp;lt;str&amp;gt; DC=/'A1' 'U1'/;&lt;BR /&gt;set&amp;lt;str&amp;gt; LSP=/'M' 'O' 'C'/;&lt;BR /&gt;set &amp;lt;str&amp;gt; Transit=/'W','E','G'/;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;num Containers {Ports,DC}= [2000,3000,1000,4000];&lt;BR /&gt;print containers;&lt;/P&gt;&lt;P&gt;var Is_LSP {LSP} binary;&lt;BR /&gt;var IsLSPDC {LSP,DC} binary;&lt;BR /&gt;var IsPortsLSPDC {Ports,LSP,DC} binary;&lt;BR /&gt;var IsPortsTransitLSPDC {Ports,Transit,LSP,DC} binary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* declare Constants*/&lt;BR /&gt;num Min_Qty_LSP=2000;&lt;/P&gt;&lt;P&gt;/*RATES*/&lt;BR /&gt;num InboundLinehaul {Ports,Transit,LSP,DC}= [40,10,30,5,20,10,&lt;BR /&gt;20,6,30,7,3,5,&lt;BR /&gt;2,6,2,60,18,4,&lt;BR /&gt;32,70,2,30,18,40,&lt;BR /&gt;19,10,2,29,3,9,&lt;BR /&gt;42,36,79,10,5,14&lt;BR /&gt;];&lt;BR /&gt;set PTCD = {p in Ports,t in Transit, c in LSP,d in DC : Inboundlinehaul[p,t,c,d] &amp;lt;=40};&lt;BR /&gt;var Assign {PTCD} binary;&lt;/P&gt;&lt;P&gt;/* DECISON VARIABLE */&lt;/P&gt;&lt;P&gt;var ContainersfromPortstoLSPtoDC {Ports,Transit,LSP,DC}&amp;gt;=0;&lt;/P&gt;&lt;P&gt;/* IMPLIED VARIABLE */&lt;BR /&gt;impvar Inbound_Linehaul_Costs= sum {p in Ports, t in Transit,c in LSP, d in DC} InboundLinehaul [p,t,c,d] *ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatLSP{c in LSP}=sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;BR /&gt;impvar ContainersatTransitLSP{t in Transit, c in LSP}=sum{p in Ports,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d];&lt;/P&gt;&lt;P&gt;/* declare Objective Function*/&lt;BR /&gt;Min TotalCost = Inbound_Linehaul_Costs;&lt;/P&gt;&lt;P&gt;/* GENERAL CONSTRAINTS */&lt;BR /&gt;con Min_Qty_at_LSP_is_Respected {c in LSP}:&lt;BR /&gt;sum{&amp;lt;p,t,(c),d&amp;gt; in PTCD} ContainersfromPortstoLSPtoDC[p,t,c,d]*Assign[p,t,c,d] &amp;gt;= Min_Qty_LSP*Is_LSP[c];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;con ModelOutput_Same_As_ModelInput {p in Ports, d in DC}:&lt;BR /&gt;sum {&amp;lt;(p),t,c,(d)&amp;gt; in PTCD} ContainersfromPortstoLSPtoDC[p,t,c, d]*Assign[p,t,c,d] = Containers [p,d];&lt;/P&gt;&lt;P&gt;con CheckLSP {c in LSP}:&lt;BR /&gt;Sum{&amp;lt;p,t,(c),d&amp;gt; in PTCD} ContainersatLSP[c]*Assign[p,t,c,d] &amp;lt;= 10000*Is_LSP[c];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*con UseProperRates {p in ports, t in transit, c in LSP, d in DC: InboundLinehaul [p,t,c,d] &amp;gt;=40}:&lt;BR /&gt;IsPortsTransitLSPDC[p,t,c,d] = 0;*/&lt;/P&gt;&lt;P&gt;/*SPECIFIC CONSTRAINTS - You can comment / uncomment based on what you want */&lt;/P&gt;&lt;P&gt;/*Constraint for retricting LSP-DC: given LSP can go to only "x" number of DC */&lt;BR /&gt;num MAEU_DCs=1;&lt;BR /&gt;**con LSP_DC: sum{d in DC} IsLSPDC['ONEY',d] = MAEU_DCs;&lt;BR /&gt;**con LSP_DC_Link{p in Ports, t in Transit,c in LSP, d in DC}:&lt;BR /&gt;ContainersfromPortstoLSPtoDC[p,t,c,d] &amp;lt;= 10000 * IsLSPDC[c,d];&lt;/P&gt;&lt;P&gt;/*Constraint for retricting Ports-LSP-DC: given Ports-DC combo can be served by only 1 LSP */&lt;BR /&gt;num NumberofLSPsPerPorts_DC=1;&lt;BR /&gt;**con OneLSPPerLane {p in Ports,d in DC}: sum{c in LSP} IsPortsLSPDC[p,c,d] = NumberofLSPsPerPorts_DC;&lt;BR /&gt;**con Ports_LSP_DC_Link{p in Ports,c in LSP, t in Transit,d in DC}:&lt;BR /&gt;ContainersfromPortstoLSPtoDC[p,t,c,d] &amp;lt;= 10000 * IsPortsLSPDC[p,c,d];&lt;/P&gt;&lt;P&gt;/* Have These Many LSPs open*/&lt;BR /&gt;num NumberofLSPsopen=2;&lt;BR /&gt;**con HaveAtleastTheseManyLSPopen: Sum{c in LSP} Is_LSP [c]=NumberofLSPsopen;&lt;/P&gt;&lt;P&gt;/* Forcing the demand via a given LSP and a DC Combo*/&lt;BR /&gt;num O_FU1=0.1*10000;&lt;BR /&gt;**con Allocation_ONEY_FU1:sum{p in Ports, t in Transit} ContainersfromPortstoLSPtoDC[p,t,'ONEY','FU1']=ONEY_FU1;&lt;/P&gt;&lt;P&gt;/* Forcing the demand via a given Transit Route */&lt;BR /&gt;NUM A_W=0.4*10000;&lt;BR /&gt;**con Allocation_W{t in Transit}:sum {p in Ports,c in LSP,d in DC} ContainersfromPortstoLSPtoDC[p,'W',c,d]=Alloc_W;&lt;/P&gt;&lt;P&gt;/* Forcing a Maximum at a given LSP*/&lt;BR /&gt;**num Max_Qty_LSP=10;&lt;BR /&gt;**con MaxatLSP {c in LSP}: ContainersatLSP[c] &amp;lt;=Max_Qty_LSP*Is_LSP[c];&lt;/P&gt;&lt;P&gt;expand;&lt;/P&gt;&lt;P&gt;solve with lso;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 20:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-OPTMODEL-Basics/m-p/630735#M3023</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2020-03-09T20:04:50Z</dc:date>
    </item>
  </channel>
</rss>

