<?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: optmodel for marketing campaigns in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/optmodel-for-marketing-campaigns/m-p/81224#M561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's one way to impose the "min volume for conflict group 5" constraint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num cust_ranking {i in cust} = max {&amp;lt;(i),j&amp;gt; in CUST_camp} ranking[i,j];&lt;BR /&gt;print cust_ranking;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; con cust_conflict_5:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum {&amp;lt;i,j&amp;gt; in CUST_CAMP: cust_ranking&lt;I&gt; &amp;gt;= 100000 and conflict_group[i,j] = 5} assign[i,j] &amp;gt;= 20000;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also store the high-ranking customers in a set and use that set instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set CUST_HIGHRANK = {i in cust: cust_ranking&lt;I&gt; &amp;gt;= 100000};&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; con cust_conflict_5:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum {&amp;lt;i,j&amp;gt; in CUST_CAMP: i in CUST_HIGHRANK and conflict_group[i,j] = 5} assign[i,j] &amp;gt;= 20000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can mimic this logic to get the other constraints.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 17:29:09 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2013-07-16T17:29:09Z</dc:date>
    <item>
      <title>optmodel for marketing campaigns</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/optmodel-for-marketing-campaigns/m-p/81223#M560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Here is simple example that I hope illustrates my optimisation problem. Multiple offers per customers. Key issue for me is that I am not familiar with optmodel and I am struggling to structure it correctly. Would be great is someone could help on this. I have included my existing optmodel syntax but this is far from finish. I am sure this can not be difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data opti1;&lt;/P&gt;&lt;P&gt;do i=1 to 250000;&lt;/P&gt;&lt;P&gt;do k=1 to 5;&lt;/P&gt;&lt;P&gt;custid=i+1000;&lt;/P&gt;&lt;P&gt;offer_code=round((ranuni(849)*50),1);&lt;/P&gt;&lt;P&gt;conflict_group=round((offer_code),10)/10;&lt;/P&gt;&lt;P&gt;ranking=round(ranuni(745)*100,1);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop k i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*objective = maximize sum of ranking over all selected offers and customers; constrain not more than 3 offers per customer; constrain not more than one offer per customer from the same conflict group. same output code always maps to same conflict group; Customers will be rank ordered using their max ranking of allocated offers. Within top 100k of customers we would like to be able to put a constrains on volumes for offers and/or conflict group - i.e. min volume for conflict group 5 = 20000 and min volume for offer 23= 5000 and max volume for conflict group 0 = 25000;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;set &amp;lt;str,str&amp;gt; CUST_camp;&lt;/P&gt;&lt;P&gt;num ranking {CUST_camp};&lt;/P&gt;&lt;P&gt;num conflict_group {CUST_camp};&lt;/P&gt;&lt;P&gt;read data opti1 into CUST_camp=[custid offer_code] ranking conflict_group;&lt;/P&gt;&lt;P&gt;set &amp;lt;str&amp;gt; CUST;&lt;/P&gt;&lt;P&gt;read data opti2 into CUST=[custid];&lt;/P&gt;&lt;P&gt;var assign{cust_camp} binary;&lt;/P&gt;&lt;P&gt;*constrain 1- max 2 offers per customer;&lt;/P&gt;&lt;P&gt;con cust_max_con {i in cust}:&lt;/P&gt;&lt;P&gt;sum {&amp;lt;(i),j&amp;gt; in cust_camp} assign[i,j] &amp;lt;=2; *not more than 2 per custid;&lt;/P&gt;&lt;P&gt;/* &lt;/P&gt;&lt;P&gt;*constrain 1- 2 selected offers per custid can not be in the same conflict group;&lt;/P&gt;&lt;P&gt;con cust_conflict {i in cust}:&lt;/P&gt;&lt;P&gt;((setof{&amp;lt;(i),j&amp;gt; in cust_camp} conflict_group[i,j] * assign[i,j]) inter (setof{&amp;lt;(i),j&amp;gt; in cust_camp} conflict_group[i,j] * assign[i,j]))={0};&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;max response=sum {&amp;lt;i,j&amp;gt; in cust_camp} ranking[i,j] * assign[i,j];&lt;/P&gt;&lt;P&gt;solve with milp;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 15:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/optmodel-for-marketing-campaigns/m-p/81223#M560</guid>
      <dc:creator>vanpoecke</dc:creator>
      <dc:date>2013-07-16T15:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: optmodel for marketing campaigns</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/optmodel-for-marketing-campaigns/m-p/81224#M561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's one way to impose the "min volume for conflict group 5" constraint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num cust_ranking {i in cust} = max {&amp;lt;(i),j&amp;gt; in CUST_camp} ranking[i,j];&lt;BR /&gt;print cust_ranking;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; con cust_conflict_5:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum {&amp;lt;i,j&amp;gt; in CUST_CAMP: cust_ranking&lt;I&gt; &amp;gt;= 100000 and conflict_group[i,j] = 5} assign[i,j] &amp;gt;= 20000;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also store the high-ranking customers in a set and use that set instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set CUST_HIGHRANK = {i in cust: cust_ranking&lt;I&gt; &amp;gt;= 100000};&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; con cust_conflict_5:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum {&amp;lt;i,j&amp;gt; in CUST_CAMP: i in CUST_HIGHRANK and conflict_group[i,j] = 5} assign[i,j] &amp;gt;= 20000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can mimic this logic to get the other constraints.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/optmodel-for-marketing-campaigns/m-p/81224#M561</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2013-07-16T17:29:09Z</dc:date>
    </item>
  </channel>
</rss>

