<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-593563533834706486</id><updated>2012-01-28T09:28:51.534-05:00</updated><category term='GAMS 22.7 bug'/><category term='xpress'/><category term='java'/><category term='lp_solve'/><category term='GAMS 22.6 bug'/><category term='Gurobi'/><category term='Conopt bug'/><category term='Constraint programming'/><category term='pathnlp'/><category term='minor bug'/><category term='c#'/><category term='tsp'/><category term='VBA'/><category term='nlp'/><category term='AMPL'/><category term='cplex'/><category term='Microsoft Solver Foundation'/><category term='Modeling note'/><category term='lp2gams'/><category term='CBC'/><category term='gdxls'/><category term='GAMS bug'/><category term='Conopt'/><category term='mosek'/><category term='Excel'/><title type='text'>Yet Another Math Programming Consultant</title><subtitle type='html'>So I am now a full time math programming consultant...  I will try to post my (technical) notes here. Keeping a searchable list of them will make this useful for me in my daily life.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default?start-index=101&amp;max-results=100'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>560</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-25200128813811278</id><published>2012-01-23T09:13:00.001-05:00</published><updated>2012-01-24T00:36:33.213-05:00</updated><title type='text'>Comparing some modeling languages</title><content type='html'>&lt;p&gt;Not an easy task, as can be seen here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lists.gnu.org/archive/html/help-glpk/2012-01/msg00033.html"&gt;http://lists.gnu.org/archive/html/help-glpk/2012-01/msg00033.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To really appreciate the features of a modeling system requires quite some investment. When comparing more systems, also often a “least common denominator” model is used. Some issues are more specialized, such as:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Is there support for non-linear programming&amp;#160; &lt;/li&gt;    &lt;li&gt;Performance characteristics for very large models &lt;/li&gt;    &lt;li&gt;Ability to do data manipulation efficiently &lt;/li&gt;    &lt;li&gt;Ability to write tailored algorithms if the model is not amenable to standard solution methods (see e.g. &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/dinkelbachs-algorithm.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/dinkelbachs-algorithm.html&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Ability to debug large models and view large data sets &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Some of these points are more difficult to evaluate and to weigh in a comparison.&lt;/p&gt;  &lt;p&gt;PS: see comment below for some other interesting capabilities.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-25200128813811278?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/25200128813811278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/comparing-some-modeling-languages.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/25200128813811278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/25200128813811278'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/comparing-some-modeling-languages.html' title='Comparing some modeling languages'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3600851222182205518</id><published>2012-01-21T16:18:00.001-05:00</published><updated>2012-01-21T16:18:58.507-05:00</updated><title type='text'>network</title><content type='html'>&lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I have a question: In GAMS, is there something similar to &amp;quot;structure&amp;quot; in C ?       &lt;br /&gt;I need to define a network optimization problem and I need to define: A node as the structure, incoming arcs as one attribute, and outgoing arcs as another attribute.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;GAMS does not have that and most likely you don’t “need” that anyway. A compact way to describe a network is shown here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Some small improvements over this formulation for even larger problems are documented here: &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3600851222182205518?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3600851222182205518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/network.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3600851222182205518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3600851222182205518'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/network.html' title='network'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3760257146855563719</id><published>2012-01-16T23:46:00.001-05:00</published><updated>2012-01-17T12:17:31.630-05:00</updated><title type='text'>Dinkelbach’s Algorithm</title><content type='html'>&lt;p&gt;The paper:&lt;/p&gt;  &lt;p&gt;Dinkelbach’s Algorithm as an Efficient Method for Solving a Class of    &lt;br /&gt;MINLP Models for Large-Scale Cyclic Scheduling Problems&amp;#160; [&lt;a href="http://egon.cheme.cmu.edu/Papers/MILFP_YouCastroGrossmann.pdf"&gt;link&lt;/a&gt;]&lt;/p&gt;  &lt;p&gt;by Prof. Grossmann e.a. investigates some mixed-integer linear fractional programming problems. It compares some standard MINLP codes against an implementation of Dinkelbach’s algorithm and concludes that this algorithm performs very good. The algorithm consists of a solving a series of MIP problems with each time a different weighted objective function. This method is so simple it can be coded in GAMS in just a few lines. &lt;/p&gt;  &lt;p&gt;If the problem is something like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-xZhBPMQHTPY/TxWU-M_TZ3I/AAAAAAAAAzw/88Aze6ZGfyI/s1600-h/image%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-gLSwJJwF7is/TxWU-Zq9r7I/AAAAAAAAAz4/AGkcVMlc2Xc/image_thumb.png?imgmax=800" width="222" height="157" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;then we need to solve a series of MIP problems:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-JAbvTGvYHDs/TxWU-nYMXGI/AAAAAAAAA0A/XC_moJzCvMs/s1600-h/image%25255B5%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-IrDuGPmGSBk/TxWU-9QTKNI/AAAAAAAAA0I/STvLSGbtWqk/image_thumb%25255B1%25255D.png?imgmax=800" width="202" height="121" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;for different values of λ.&lt;/p&gt;  &lt;p&gt;I wanted to see if I could use this on a (very) large mixed-integer linear fractional programming problem. Of course first try it on some very small examples. The first test is a continuous problem:&lt;/p&gt;  &lt;h3&gt;Example 1: Linear fractional programming problem&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="782"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="780"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;$ontext                  &lt;br /&gt;                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;References:&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Fengqi You, Pedro M. Castro, Ignacio E. Grossmann1&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Dinkelbach’s Algorithm as an Efficient Method for Solving a Class of&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;MINLP Models for Large-Scale Cyclic Scheduling Problems&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Said Tantawy&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;AN ITERATIVE METHOD FOR SOLVING LINEAR FRACTION&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;PROGRAMMING (LFP) PROBLEM WITH SENSITIVITY ANALYSIS&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;i &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'products' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/a1,a2/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;parameters&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;uprofit(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'unit profit' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a1 4&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a2 2&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;ucost(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'unit cost' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a1 1&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a2 2&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;fixedcost &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/5/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;fixedprofit &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/10/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;matuse(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'raw material usage' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a1 1&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;a2 3&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;rawavail &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'raw material available' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/30/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;x(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'production'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;profit                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;cost                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'objective variable'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;positive&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; x,profit,cost;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;eprofit &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'calculate profit'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;ecost&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'calculate cost'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;eraw&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'raw material usage'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;eprodcon&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'production constraint'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;eratio&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'minlp objective'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000" face="Consolas"&gt;;                &lt;br /&gt;                &lt;br /&gt;eprofit.. profit =e= fixedprofit + &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i, uprofit(i)*x(i));                  &lt;br /&gt;                  &lt;br /&gt;ecost..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;cost =e= fixedcost + &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i, ucost(i)*x(i));                  &lt;br /&gt;                  &lt;br /&gt;eraw..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i, matuse(i)*x(i)) =l= rawavail;                  &lt;br /&gt;                  &lt;br /&gt;eprodcon..&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;x(&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;'a1'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;) + 5 =g= 2*x(&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;'a2'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;);                  &lt;br /&gt;                  &lt;br /&gt;eratio..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z =e= profit/cost;                   &lt;br /&gt;cost.lo = 1;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;* solve as nlp&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/all/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                  &lt;br /&gt;m1.solprint = 2;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 maximizing z using nlp;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;NLP Solver&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;z.l,x.l;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;* Dinkelbach's algorithm&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;scalars&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;q&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'optimal objective at end of algorithm' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/0/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;continue &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/1/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;tol&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/0.1/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;iterations                   &lt;br /&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;equation&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; linobj;                  &lt;br /&gt;linobj .. z =e= profit - q*cost;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m2 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/eprofit,ecost,eraw,eprodcon,linobj/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                  &lt;br /&gt;m2.solprint = 2;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; iter &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/iter1*iter5/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;loop&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(iter$continue,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m2 maximizing z using lp;                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; (z.l &amp;lt; tol,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;continue = 0;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;iterations = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(iter);                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;Dinkelbach algorithm&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;q,iterations,x.l;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;q = profit.l/cost.l;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;);                   &lt;br /&gt;                  &lt;br /&gt;);&lt;/font&gt;&lt;/font&gt;               &lt;br style="mso-special-character: line-break" /&gt;              &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This continuous problem is very easy:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="781"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="779"&gt;         &lt;p&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 73 ------------------------------------            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NLP Solver             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ------------------------------------             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE z.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.714&amp;#160; objective variable&lt;/p&gt;          &lt;p&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 73 VARIABLE x.L&amp;#160; production&lt;/p&gt;          &lt;p&gt;a1 30.000&lt;/p&gt;          &lt;p&gt;----&amp;#160;&amp;#160;&amp;#160; 102 ------------------------------------            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dinkelbach algorithm             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ------------------------------------             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PARAMETER q&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.714&amp;#160; optimal objective at end of algorithm             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PARAMETER iterations&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160; &lt;/p&gt;          &lt;p&gt;----&amp;#160;&amp;#160;&amp;#160; 102 VARIABLE x.L&amp;#160; production&lt;/p&gt;          &lt;p&gt;a1 30.000&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;The next small example is an integer problem:&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;&lt;font face="Consolas"&gt;Example 2: an integer fractional programming problem&lt;/font&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="779"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="777"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;$ontext                  &lt;br /&gt;                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;References:&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Fengqi You, Pedro M. Castro, Ignacio E. Grossmann1&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Dinkelbach’s Algorithm as an Efficient Method for Solving a Class of&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;MINLP Models for Large-Scale Cyclic Scheduling Problems&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Ildiko Zsigmond&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;Mixed Integer linear Fractional Programming By A Branch-and-Bound&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;Technique 1985&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;x1,x2                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;num&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'numerator'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;denom&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'denominator'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'objective variable'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;integer&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; x1,x2;                  &lt;br /&gt;x1.up = 5;                   &lt;br /&gt;x2.up = 4;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;enum&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'numerator'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;edenom&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'denominator'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;e1,e2,e3                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;eratio                   &lt;br /&gt;;                   &lt;br /&gt;                  &lt;br /&gt;enum.. num =e= 2*x1+x2-2;                   &lt;br /&gt;                  &lt;br /&gt;edenom..&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;denom =e= x1-x2+1;                   &lt;br /&gt;                  &lt;br /&gt;e1.. -5*x1 + 4*x2 =l= 0;                   &lt;br /&gt;e2.. -x1+x2 =l= 0.5;                   &lt;br /&gt;e3.. 2*x1+x2 =l= 11;                   &lt;br /&gt;                  &lt;br /&gt;eratio..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z =e= num/denom;                   &lt;br /&gt;denom.lo = .1;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; optcr=0;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/enum,edenom,e1,e2,e3,eratio/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                  &lt;br /&gt;m1.solprint = 2;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 maximizing z using minlp;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;MINLP Solver&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;z.l,x1.l,x2.l;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Consolas"&gt;* Dinkelbach's algorithm&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;*-------------------------------------------------------------&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;scalars&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;q&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'optimal objective at end of algorithm' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/0/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;continue &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/1/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;tol&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Consolas"&gt;/0.1/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;iterations                   &lt;br /&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;equation&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; linobj;                  &lt;br /&gt;linobj .. z =e= num - q*denom;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m2 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/enum,edenom,e1,e2,e3,linobj/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                  &lt;br /&gt;m2.solprint = 2;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; iter &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/iter1*iter5/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;loop&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(iter$continue,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m2 maximizing z using mip;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; (z.l &amp;lt; tol,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;continue = 0;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;iterations = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(iter);                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;Dinkelbach algorithm&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;q,iterations,x1.l,x2.l;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;q = num.l/denom.l;                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;);                   &lt;br /&gt;                  &lt;br /&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The listing file shows:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="778"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="776"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 51 ------------------------------------              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MINLP Solver               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ------------------------------------               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE z.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7.000&amp;#160; objective variable               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE x1.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.000&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE x2.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.000&amp;#160; &lt;br /&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 82 ------------------------------------               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dinkelbach algorithm               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ------------------------------------               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PARAMETER q&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7.000&amp;#160; optimal objective at end of algorithm               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PARAMETER iterations&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4.000&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE x1.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.000&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VARIABLE x2.L&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.000&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;For our very large problem (approx. 1 million rows) this method was even more successful. All NLP solvers I have access to had troubles with the sheer size of the problem, even though the NLP relaxations are linearly constrained. But the MIP problems generated inside Dinkelbach’s algorithm turned out to be large but easy to solve. In addition the algorithm converged in about 5 major iterations.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3760257146855563719?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3760257146855563719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/dinkelbachs-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3760257146855563719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3760257146855563719'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/dinkelbachs-algorithm.html' title='Dinkelbach’s Algorithm'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-gLSwJJwF7is/TxWU-Zq9r7I/AAAAAAAAAz4/AGkcVMlc2Xc/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-5876397123104256522</id><published>2012-01-10T11:09:00.001-05:00</published><updated>2012-01-10T14:10:57.373-05:00</updated><title type='text'>Reviewing NLP model</title><content type='html'>&lt;p&gt;In a fairly complex model, we ended up trying a nonlinear objective:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-bBH2OY_ThkU/TwxiqZSv4JI/AAAAAAAAAzQ/ILXdMpzC2Rc/s1600-h/image%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-Ij3iWD5imNo/Twxiqn_Q9pI/AAAAAAAAAzY/OWTSg5sfTmE/image_thumb.png?imgmax=800" width="182" height="95" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;where the rest of the model was linear (after applying some reformulations). As the model contains both integer and binary variables, this now has become an MINLP.&lt;/p&gt;  &lt;p&gt;For several reasons this is actually not a very good expression:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;this expression generates a lot of non-linear variables and non-linear non-zero elements in the matrix&lt;/li&gt;    &lt;li&gt;as some z(i)’s can be zero it is difficult to protect this against division-by-zero (although the way we ran it had a linear model in front of this model, so our starting point was reasonable and no division-by-zero occurred)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; A better formulation would be:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-A8saERwHKlk/Twxiq7Yv_nI/AAAAAAAAAzg/sYX3u3zEldQ/s1600-h/image%25255B5%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-exQplMOAUYQ/TwxirDXPM5I/AAAAAAAAAzo/9YHWREFXTLc/image_thumb%25255B1%25255D.png?imgmax=800" width="170" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here we only have two non-linear variables: the rest of the variables is now appearing linearly in the constraints. In addition, although we cannot bound each z(i) away from zero, we could introduce a nonzero lower bound on w.&lt;/p&gt;  &lt;p&gt;Although we are adding extra constraints and variables to the MINLP model, this actually makes the model easier to solve and more robust.&lt;/p&gt;  &lt;p&gt;PS1. The model is now becoming somewhat complex as we try to deal with different types of decisions in the same model. We call this an “integrated model” rather than just messy!&lt;/p&gt;  &lt;p&gt;PS2. In some cases fractions can be reformulated using a “fractional programming” technique. In practice for larger models this often turns out to be a difficult reformulation to implement.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Question: it is suggested in a comment below to use (2d?) bisection. Is that really a good idea? Any references for such an approach applied in a similar situation?&lt;/strong&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-5876397123104256522?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/5876397123104256522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/reviewing-nlp-model.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5876397123104256522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5876397123104256522'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2012/01/reviewing-nlp-model.html' title='Reviewing NLP model'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-Ij3iWD5imNo/Twxiqn_Q9pI/AAAAAAAAAzY/OWTSg5sfTmE/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-650991822268906686</id><published>2011-12-25T06:23:00.001-05:00</published><updated>2011-12-25T06:23:31.138-05:00</updated><title type='text'>Savings from applying MIP models</title><content type='html'>&lt;p&gt;In the first chapter of “&lt;em&gt;Applied Integer Programming: Modeling and Solution&lt;/em&gt;”, by Der-San Chen; Robert G. Batson; Yu Dang (2010), there is a table with successful mip applications taken from articles from &lt;em&gt;Interfaces. &lt;/em&gt;See &lt;a title="http://media.wiley.com/product_data/excerpt/67/04703730/0470373067.pdf" href="http://media.wiley.com/product_data/excerpt/67/04703730/0470373067.pdf"&gt;http://media.wiley.com/product_data/excerpt/67/04703730/0470373067.pdf&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Some numbers seem low: $0.25 million savings (EK:annual?) from a least-cost crew scheduling model at American Airlines in 1981, while others seem rather high: a coal transportation study by the World Bank and Chinese State Planning Commission (1995): $6.4 billion in savings (over what period is not specified).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img src="http://media.wiley.com/product_data/coverImage300/67/04703730/0470373067.jpg" /&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-650991822268906686?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/650991822268906686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/savings-from-applying-mip-models.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/650991822268906686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/650991822268906686'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/savings-from-applying-mip-models.html' title='Savings from applying MIP models'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-2507688862757764958</id><published>2011-12-22T16:39:00.001-05:00</published><updated>2011-12-22T16:39:14.152-05:00</updated><title type='text'>Bad NLP modeling</title><content type='html'>&lt;p&gt;In &lt;a href="http://groups.google.com/group/knitro/browse_thread/thread/a1785c5c6f64b62e/"&gt;http://groups.google.com/group/knitro/browse_thread/thread/a1785c5c6f64b62e/&lt;/a&gt; we see the following constructs being used in an NLP model:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;c6.. y1*(y1-1) =e= 0;       &lt;br /&gt;c7.. y2*(y2-1) =e= 0;        &lt;br /&gt;c8.. y3*(y3-1) =e= 0;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is not really a good idea. These constraints essentially say: y1,y2 and y3 can assume the values 0 or 1, i.e. they are binary variables.&lt;/p&gt;  &lt;p&gt;If you really want to use binary variables in an NLP, form a proper MINLP model. If this idea of using non-convex constraints to model binary variables was really so hot, then we would no longer need a MIP solver and just use an NLP solver.&lt;/p&gt;  &lt;p&gt;It looks a bit that this poster is attempting to run before (s)he can walk. It would be much better if you have some knowledge about NLP modeling before before actually working on “stochastic global optimization”. May be the advisor or teacher should play a more constructive role here.&lt;/p&gt;  &lt;p&gt;Notes: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;in general NLP solvers don’t “understand” the functions you give them. They merely sample points, function values and derivatives as they go along. One exception is the global solver Baron: this solver really tries to work with and understand the functional form of the NL functions.&lt;/li&gt;    &lt;li&gt;although in general it is better to model binary decisions as binary variables in an MINLP (or MIP if the rest is linear), there are some attempts to use nonlinear programming techniques to solve integer models: &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;W. Murray and K. M. Ng, “An Algorithm for Nonlinear Optimization Problems with Binary Variables,” Computational Optimization and Applications, Vol. 47, No. 2, 2008, pp. 257-288&lt;/li&gt;      &lt;li&gt;Roohollah Aliakbari Shandiz, Nezam Mahdavi-Amiri, “An Exact Penalty Approach for Mixed Integer Nonlinear Programming Problems”, American Journal of Operations Research, 2011, 1, 185-189&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-2507688862757764958?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/2507688862757764958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/bad-nlp-modeling.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2507688862757764958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2507688862757764958'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/bad-nlp-modeling.html' title='Bad NLP modeling'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6586294626615028310</id><published>2011-12-19T19:36:00.001-05:00</published><updated>2012-01-07T08:06:48.178-05:00</updated><title type='text'>Sequence dependent setup times: difficult MIPs</title><content type='html'>&lt;p&gt;A simple single machine scheduling model with sequence dependent setup times is a good example where MIP solvers are not very good yet. &lt;/p&gt;  &lt;p&gt;The simplest formulation for the 15 job problem we show below, is probably where we use the following definition:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;x(i,j) = 1 if job i is scheduled before job j      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 otherwise&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Obviously we don’t need the diagonal: x(i,i). Also if we know that x(i,j) = 1-x(j,i), so we don’t need both the lower- and upper-triangular part. A model now can look like:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="996"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="994"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;$ontext                  &lt;br /&gt;                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#808080"&gt;Single Machine with Sequence Dependent Setup times.&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#808080"&gt;Data from: https://www.msu.edu/~rubin/files/research.html&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;sets&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;i0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'all jobs' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/job0*job15/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;i(i0) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'jobs to schedule' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/job1*job15/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i,j), (i0,j0);&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; data(*,*)                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;job1 job2 job3 job4 job5 job6 job7 job8 job9 job10 job11 job12 job13 job14 job15&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;proctime&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;88&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;95&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;98&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;102&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;100&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;97&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;100&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;96&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;102&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;97&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;108&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;107&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;102&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;100&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;96&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;duedate 1162 1194 1195 1196 1229 1236 1240 1301 1323&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1353&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1368&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1402&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1421&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1432&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;1433&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;16&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job11 &lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;4&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;14&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;13&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;19&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;10&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;job15&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;20&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;17&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;12&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;18&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;parameters&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;proctime(i)                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;setuptime(i0,j)                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;duedate(i)                   &lt;br /&gt;;                   &lt;br /&gt;proctime(i) = data(&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000" face="Courier New"&gt;'proctime'&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,i);                  &lt;br /&gt;setuptime(i0,j) = data(i0,j);                   &lt;br /&gt;duedate(i) = data(&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;'duedate'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,i);&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;scalar&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; M;                  &lt;br /&gt;&lt;strike&gt;M = &lt;/strike&gt;&lt;/font&gt;&lt;/span&gt;&lt;strike&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;((i0,j),setuptime(i0,j))+&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/strike&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;strike&gt;(i,proctime(i));                    &lt;br /&gt;&lt;/strike&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;M = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(j, &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;smax&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i0,setuptime(i0,j)) + proctime(j));&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;x(i,j)&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'j later than i'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;starttime(i)&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'start of job'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;endtime(i)&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'end of job'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;makespan&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'total makespan'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'objective variable'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;late(i)&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'&lt;strike&gt;lateness&lt;/strike&gt; tardiness of job'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;binary&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; x;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;positive&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; late,starttime,endtime;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;calcstart1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'bound on starttime'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;calcstart2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'bound on starttime'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;calcstart3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'bound on starttime'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;ontime&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'compare endtime with duedate'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;emakespan&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'bound on makespan'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;calcendtime&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'end=start+proc'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;obj&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 12pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'objective'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;              &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; lt(i,j);                  &lt;br /&gt;lt(i,j)$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i)&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(j))=&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;yes&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                  &lt;br /&gt;                  &lt;br /&gt;calcstart1(lt(i,j)).. starttime(j) =g= endtime(i) + setuptime(i,j) - M*(1-x(i,j));                   &lt;br /&gt;calcstart2(lt(j,i)).. starttime(j) =g= endtime(i) + setuptime(i,j) - M*x(j,i);                   &lt;br /&gt;calcstart3(i).. starttime(i) =g= setuptime(&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;'job0'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;,i);                  &lt;br /&gt;                  &lt;br /&gt;calcendtime(i).. endtime(i) =e= starttime(i) + proctime(i);                   &lt;br /&gt;                  &lt;br /&gt;ontime(i).. endtime(i) =l= duedate(i) + late(i);                   &lt;br /&gt;                  &lt;br /&gt;emakespan(i).. makespan =g= endtime(i);                   &lt;br /&gt;                  &lt;br /&gt;obj.. z =e= 0*makespan + 1*&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i,late(i));&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080"&gt;* initial solution: use mipstart to load it&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&amp;#160; &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;x.l(lt(i,j)) = 1;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; optcr=0, reslim=3600;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/all/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                 &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m1 minimizing z using mip;&lt;/font&gt;                 &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000" face="Courier New"&gt; x.l,starttime.l,endtime.l;&lt;/font&gt;               &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;We can find the optimal solution of 90 in about an hour or so (running on one thread):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-IU4fw9V30WY/TvA1S8YT5BI/AAAAAAAAAyc/qz79iiqPD5s/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-vPyot9ivHoA/TvA1TysVYeI/AAAAAAAAAyk/kI0H79irEJo/image_thumb%25255B1%25255D.png?imgmax=800" width="644" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;However, as we can see we are far from proving this is indeed the optimal solution: the best bound has not moved at all.&lt;/p&gt;  &lt;p&gt;Notes:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Constraint calcstart3 can be written as a bound. Of course these days, a MIP solver will do that for you in the pre-solve phase. &lt;/li&gt;    &lt;li&gt;The initial solution was constructed by ordering the jobs by due date. &lt;/li&gt;    &lt;li&gt;The Gantt chart for the machine can look like:      &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-FD0D7w1phIA/TvKAaqi_wWI/AAAAAAAAAyw/l6P5B5wn8OY/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-zhCy_VCEgys/TvKAaxurzKI/AAAAAAAAAy4/7FzotLxPpeI/image_thumb%25255B1%25255D.png?imgmax=800" width="644" height="64" /&gt;&lt;/a&gt;       &lt;br /&gt;Here the late jobs are colored red. &lt;/li&gt;    &lt;li&gt;The model minimizes sum of &lt;strike&gt;lateness&lt;/strike&gt; tardiness. Additional objectives could be number of late jobs and total makespan. &lt;/li&gt;    &lt;li&gt;More difficult to model is this: scheduled downtime. If jobs can not be interrupted, this causes holes (idle time) in the schedule. &lt;/li&gt;    &lt;li&gt;A different, slightly more complicated formulation would result from:      &lt;br /&gt;x(i,j) = 1 if job i is scheduled immediately before job j&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 otherwise &lt;/li&gt;    &lt;li&gt;IBM Ilog’s CP solver using OPL can model sequence dependent setup times directly (see: &lt;a title="http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/topic/ilog.odms.cpo.help/Content/Optimization/Documentation/Optimization_Studio/_pubskel/usrcpoptimizer2793.html" href="http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/topic/ilog.odms.cpo.help/Content/Optimization/Documentation/Optimization_Studio/_pubskel/usrcpoptimizer2793.html"&gt;http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/topic/ilog.odms.cpo.help/Content/Optimization/Documentation/Optimization_Studio/_pubskel/usrcpoptimizer2793.html&lt;/a&gt;). &lt;/li&gt;    &lt;li&gt;Many papers suggest a meta-heuristic (genetic algorithm etc.) to solve this. &lt;/li&gt;    &lt;li&gt;Of course a MIP model can still help to define the problem correctly and to solve small instances to optimality. &lt;/li&gt;    &lt;li&gt;Paper for data file is: “SCHEDULING IN A SEQUENCE DEPENDENT SETUP ENVIRONMENT WITH GENETIC SEARCH”, Paul A. Rubin, Gary L. Ragatz, Computers &amp;amp; Operations Research, 22, no 1, jan 1995, pp 85-99. &lt;/li&gt;    &lt;li&gt;The paper notes that according to a survey, 70% of scheduling problems may be subject to sequence dependent setup times (this number looks a little bit high to me). &lt;/li&gt;    &lt;li&gt;A generalization of setup times that are sequence dependent is to consider them history dependent, i.e. dependent on a number of preceding jobs. See for instance &lt;a href="http://onlinelibrary.wiley.com/doi/10.1002/nav.21472/abstract"&gt;http://onlinelibrary.wiley.com/doi/10.1002/nav.21472/abstract&lt;/a&gt;.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;PS. After the comment from Paul Rubin, I updated the big-M calculation. This reduces the size of M from 3819 to 1775. Although this is a better formulation, an example run with Cplex, 1 thread actually shows somewhat poorer performance of the new M. In the picture below we have M1 as the old M=3819 and M2 the results for M=1775.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-O75M4AvvPvE/TvrCdZ9tAGI/AAAAAAAAAzA/BpBZVkf09KY/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-8hvU-TRGcE8/TvrCdwdci2I/AAAAAAAAAzE/8H7CkGQOE0g/image_thumb%25255B1%25255D.png?imgmax=800" width="644" height="323" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Sometimes with a MIP we see that a better formulation can have worse performance on certain instances. &lt;/p&gt;  &lt;p&gt;PS2. See comment below. Officially we have tardiness = max(0,lateness). I hardly use the term tardiness: “normal people” tend to use the more intuitive earliness and lateness (both nonnegative). &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6586294626615028310?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6586294626615028310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/sequence-dependent-setup-times.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6586294626615028310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6586294626615028310'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/sequence-dependent-setup-times.html' title='Sequence dependent setup times: difficult MIPs'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-vPyot9ivHoA/TvA1TysVYeI/AAAAAAAAAyk/kI0H79irEJo/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-9080378907475352038</id><published>2011-12-19T16:07:00.001-05:00</published><updated>2011-12-19T22:00:05.903-05:00</updated><title type='text'>Optimization for Dummies</title><content type='html'>&lt;p&gt;Gurobi came out with a nice little booklet explaining optimization in basic non-geek terms. It may be useful to show your boss what you want him (or her) to spend some money on. If you want a copy, contact the Gurobi people (&lt;a href="http://www.gurobi.com"&gt;www.gurobi.com&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-D3YYk8dQfMY/Tu-nhIHXMEI/AAAAAAAAAyM/uQGO-auBkbI/s1600-h/Scanned%252520Photo-1-34%25255B1%25255D.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Scanned Photo-1-34" border="0" alt="Scanned Photo-1-34" src="http://lh5.ggpht.com/-556JxxLI59U/Tu-nifwEmQI/AAAAAAAAAyU/MTJvLbU8HnQ/Scanned%252520Photo-1-34_thumb%25255B1%25255D.jpg?imgmax=800" width="317" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Actually I have purchased a few of these “for dummies” books – there must be a ton of them by now –, and in general they are quite well written.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-9080378907475352038?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/9080378907475352038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/optimization-for-dummies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/9080378907475352038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/9080378907475352038'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/optimization-for-dummies.html' title='Optimization for Dummies'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-556JxxLI59U/Tu-nifwEmQI/AAAAAAAAAyU/MTJvLbU8HnQ/s72-c/Scanned%252520Photo-1-34_thumb%25255B1%25255D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-5301540146553159387</id><published>2011-12-14T23:55:00.001-05:00</published><updated>2011-12-19T16:41:30.768-05:00</updated><title type='text'>Logs in NLP</title><content type='html'>&lt;p&gt;In &lt;a href="http://www.or-exchange.com/questions/4214/entropy-maximization-log0-ampl-tricks"&gt;http://www.or-exchange.com/questions/4214/entropy-maximization-log0-ampl-tricks&lt;/a&gt; someone seems to claim that:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;y=log(x),          &lt;br /&gt;x.lo = 0.001&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;is not good modeling practice. I don’t agree: the better NLP solvers don’t evaluate nonlinear functions outside their bounds. And from my more than 20 year experience in nonlinear modeling: I have used this construct all the time.&lt;/p&gt;  &lt;p&gt;A large percentage of NLPs that fail can be fixed by looking into specifying:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;better bounds &lt;/li&gt;    &lt;li&gt;better starting point &lt;/li&gt;    &lt;li&gt;and better scaling &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The comment below talks about IPOPT. No, even IPOPT will not evaluate nl funcs outside their bounds (come on, it is an interior point code!!). See&amp;#160; &lt;a href="http://drops.dagstuhl.de/volltexte/2009/2089/pdf/09061.WaechterAndreas.Paper.2089.pdf"&gt;http://drops.dagstuhl.de/volltexte/2009/2089/pdf/09061.WaechterAndreas.Paper.2089.pdf&lt;/a&gt; . Slight complication is bound_relax_factor, but in practice that is not a problem. Maybe the poster is confusing infeasibility and interior points: a point can be inside the bounds but still be infeasible.&lt;/p&gt;  &lt;p&gt;Apart from this remark, indeed IPOPT is an excellent solver. It is a fantastic complement to the well-known active-set solvers like CONOPT, MINOS and SNOPT. If you have large models with many superbasics: these solvers tend to have problems with that, while an interior point algorithm does not really care. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-5301540146553159387?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/5301540146553159387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/logs-in-nlp.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5301540146553159387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5301540146553159387'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/logs-in-nlp.html' title='Logs in NLP'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-502967240982386386</id><published>2011-12-14T23:47:00.001-05:00</published><updated>2011-12-14T23:47:49.102-05:00</updated><title type='text'>Student posts (2)</title><content type='html'>&lt;p&gt;One more for my collection (&lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2010/09/student-mails.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2010/09/student-mails.html&lt;/a&gt;):&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="782"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="780"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Bonjour,&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Je viens de voir votre blog sur la programmation linéaire. En fait je débute sur GLPK et je voulais             &lt;br /&gt;vous poser la question: comment exprimer une condition dans une contrainte?              &lt;br /&gt;J'ai utilisé if mais ça marche pas. &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Merci d'avance.             &lt;br /&gt;Cordialement,&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Actually I understand enough French to understand this, but nevertheless it is somewhat indicative of how little effort is being employed before sending emails around asking for help.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-502967240982386386?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/502967240982386386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/student-posts-2.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/502967240982386386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/502967240982386386'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/student-posts-2.html' title='Student posts (2)'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1783826530986390015</id><published>2011-12-14T23:41:00.001-05:00</published><updated>2011-12-15T00:06:54.347-05:00</updated><title type='text'>Analytics in Retail</title><content type='html'>&lt;p&gt;The last few day I was working with some people on some reasonably complicated optimization problems in the retail industry. One of the great resources on using analytics in that environment is:&lt;/p&gt;  &lt;p&gt;&lt;img src="http://ecx.images-amazon.com/images/I/41KAmGYq0NL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU01_.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/New-Science-Retailing-Transforming-Performance/dp/1422110575/"&gt;http://www.amazon.com/New-Science-Retailing-Transforming-Performance/dp/1422110575/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;On my way back from Chicago there was bad weather and planes breaking down, so I had quite some time to read this. Highly recommended to get a feeling about some issues in this industry that can be tackled by some math.&lt;/p&gt;  &lt;p&gt;During the work we found again that it really helps to try to develop some models very early in the project. Even with invented data, it allows you to really focus on the problem. As a result you will find the weak spots in your knowledge about the problem and will generate often very pointed questions. The exercise of inventing data is also a very good tool to get a better understanding. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1783826530986390015?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1783826530986390015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/analytics-in-retail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1783826530986390015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1783826530986390015'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/analytics-in-retail.html' title='Analytics in Retail'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4436233818086671739</id><published>2011-12-01T07:53:00.001-05:00</published><updated>2011-12-01T07:53:18.615-05:00</updated><title type='text'>Modeling is more difficult than many people think…</title><content type='html'>&lt;p&gt;From a Bachelors thesis:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-gJJvvJfBneo/Ttd4uWkqQFI/AAAAAAAAAx4/jUq7YKHW5JY/s1600-h/Transportation%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transportation" border="0" alt="Transportation" src="http://lh6.ggpht.com/-CLVM7VrTq28/Ttd4vBXuENI/AAAAAAAAAx8/PjTj1J-05L0/Transportation_thumb%25255B1%25255D.png?imgmax=800" width="568" height="772" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this simple transportation model I see at least two problems.&lt;/p&gt;  &lt;p&gt;The capacity constraint should probably look like:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="567"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="565"&gt;forall (o in DCs)         &lt;br /&gt;&amp;#160; ctCapacity:          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum(p in Products, d in Stores)          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Trans[p][o][d] &amp;lt;= Capacity[o];&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The care needed to write correct models is often underestimated.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4436233818086671739?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4436233818086671739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/modeling-is-more-difficult-than-many.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4436233818086671739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4436233818086671739'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/modeling-is-more-difficult-than-many.html' title='Modeling is more difficult than many people think…'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-CLVM7VrTq28/Ttd4vBXuENI/AAAAAAAAAx8/PjTj1J-05L0/s72-c/Transportation_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-7914156778413808169</id><published>2011-12-01T00:23:00.001-05:00</published><updated>2011-12-01T00:23:50.256-05:00</updated><title type='text'>Matrix multiplication</title><content type='html'>&lt;ul&gt;   &lt;li&gt;Theory: &lt;a href="http://www.scottaaronson.com/blog/?p=839"&gt;http://www.scottaaronson.com/blog/?p=839&lt;/a&gt;. This really seems to excite the theorists. &lt;/li&gt;    &lt;li&gt;In practice: &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2010/06/sparse-matmul-revisited.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2010/06/sparse-matmul-revisited.html&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-7914156778413808169?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/7914156778413808169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/matrix-multiplication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7914156778413808169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7914156778413808169'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/12/matrix-multiplication.html' title='Matrix multiplication'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8833036898575297886</id><published>2011-11-30T16:46:00.001-05:00</published><updated>2011-11-30T23:00:45.051-05:00</updated><title type='text'>MPS files: this does not look right</title><content type='html'>&lt;p&gt;Writing an MPS for a QP model from GAMS using the Cplex option writemps I saw this:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="554"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="552"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;* ENCODING=ISO-8859-1              &lt;br /&gt;NAME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; gamsmodel               &lt;br /&gt;ROWS               &lt;br /&gt;N&amp;#160; &lt;font style="background-color: #ffff00"&gt;obj&lt;/font&gt;               &lt;br /&gt;E&amp;#160; &lt;font style="background-color: #ffff00"&gt;obj                &lt;br /&gt;&lt;/font&gt;E&amp;#160; budget               &lt;br /&gt;G&amp;#160; retcon               &lt;br /&gt;COLUMNS               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; z&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font style="background-color: #ffff00"&gt;obj&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; z&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font style="background-color: #ffff00"&gt;obj&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x(GAB)&amp;#160;&amp;#160;&amp;#160; budget&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x(GAB)&amp;#160;&amp;#160;&amp;#160; retcon&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0025               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x(GAP)&amp;#160;&amp;#160;&amp;#160; budget&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x(GAP)&amp;#160;&amp;#160;&amp;#160; retcon&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.1375               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;         &lt;font face="Consolas"&gt;…&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This does not look right. Probably a problem in the GAMS link where a new free row is added to the problem with the same name as an existing row.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8833036898575297886?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8833036898575297886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/mps-files-this-does-not-look-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8833036898575297886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8833036898575297886'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/mps-files-this-does-not-look-right.html' title='MPS files: this does not look right'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6346068285521138315</id><published>2011-11-23T11:05:00.001-05:00</published><updated>2011-11-23T11:05:54.851-05:00</updated><title type='text'>This does not compute</title><content type='html'>&lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;GLPK doesn't accept an constraint in which a variable is devided by an variable, i would like to know if there is some solution to linearize this constraint. knowning that var2 is binary and var 1 is reel in case var1 / var 2.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This means var2=1 and we can replace the expression var1/var2 by var1.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6346068285521138315?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6346068285521138315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/this-does-not-compute.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6346068285521138315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6346068285521138315'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/this-does-not-compute.html' title='This does not compute'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-60887891166310856</id><published>2011-11-23T05:57:00.001-05:00</published><updated>2011-11-23T05:57:40.918-05:00</updated><title type='text'>Recently read</title><content type='html'>&lt;p&gt;During a transatlantic flight I had the opportunity to read this book on parallel programming for .Net. It describes some of the higher level constructs available in .Net that make it easier to implement parallel algorithms. Of course the big issue is that you need to (re)design your algorithms to make parallel operations effective or even possible. Some algorithms are just not very amenable to be parallelized (the Simplex method for LP being a good example). The book contains enough warnings to make you think twice before starting to work on parallel implementations.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://akamaicovers.oreilly.com/images/0790145310262/lrg.jpg" /&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-60887891166310856?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/60887891166310856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/recently-read.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/60887891166310856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/60887891166310856'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/recently-read.html' title='Recently read'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-899717256509216633</id><published>2011-11-21T16:41:00.001-05:00</published><updated>2011-11-21T16:41:56.584-05:00</updated><title type='text'>MPS Files (2)</title><content type='html'>&lt;p&gt;As follow up on &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mps-files.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mps-files.html&lt;/a&gt; it is noted that Microsoft Solver Foundation also reads some MPS files incorrectly. E.g. consider the files:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="1000" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="1019"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;type mip4mps.oml              &lt;br /&gt;Model[               &lt;br /&gt;&amp;#160; Decisions[Integers[0, Infinity], x],               &lt;br /&gt;&amp;#160; Constraints[x &amp;lt;= 5],               &lt;br /&gt;&amp;#160; Goals[Maximize[x]]               &lt;br /&gt;]&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;type output.mps              &lt;br /&gt;NAME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MODEL               &lt;br /&gt;ROWS               &lt;br /&gt;L&amp;#160; constrai               &lt;br /&gt;N&amp;#160; goal_8ef               &lt;br /&gt;COLUMNS               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; INTMARK&amp;#160;&amp;#160; 'MARKER'&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'INTORG'               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; constrai&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; goal_8ef&amp;#160; -1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; INTMARK&amp;#160;&amp;#160; 'MARKER'&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'INTEND'               &lt;br /&gt;RHS               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; RHS&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; constrai&amp;#160;&amp;#160; 5               &lt;br /&gt;BOUNDS               &lt;br /&gt;ENDATA&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The MPS file was generated from the OML file. If we inspect the MPS file we see no bounds on x. This means the variable x should be binary.&lt;/p&gt;  &lt;p&gt;If we solve the MPS file with Solver Foundation we see:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="1000" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="1021"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;&amp;quot;\Program Files (x86)\Microsoft Solver Foundation\3.0.2.10889\Bin\MSFCli.exe&amp;quot; +verbose 3 output.mps              &lt;br /&gt;===== Processing .\output.mps =====               &lt;br /&gt;Solution Quality: Optimal               &lt;br /&gt;===Solver Foundation Service Report===               &lt;br /&gt;Date: 11/21/2011 10:27:00 PM               &lt;br /&gt;Version: Microsoft Solver Foundation 3.0.2.10889 Standard Edition               &lt;br /&gt;Model Name: DefaultModel               &lt;br /&gt;Capabilities Applied: MILP               &lt;br /&gt;Solve Time (ms): 367               &lt;br /&gt;Total Time (ms): 489               &lt;br /&gt;Solve Completion Status: Optimal               &lt;br /&gt;Solver Selected: Microsoft.SolverFoundation.Solvers.SimplexSolver               &lt;br /&gt;Algorithm: Primal               &lt;br /&gt;Arithmetic: Hybrid               &lt;br /&gt;Variables: 1 -&amp;gt; 1 + 2               &lt;br /&gt;Rows: 2 -&amp;gt; 2               &lt;br /&gt;Nonzeros: 2               &lt;br /&gt;Eliminated Slack Variables: 0               &lt;br /&gt;Pricing (exact): SteepestEdge               &lt;br /&gt;Pricing (double): SteepestEdge               &lt;br /&gt;Basis: Slack               &lt;br /&gt;Pivot Count: 1               &lt;br /&gt;Phase 1 Pivots: 0 + 0               &lt;br /&gt;Phase 2 Pivots: 1 + 0               &lt;br /&gt;Factorings: 4 + 1               &lt;br /&gt;Degenerate Pivots: 0 (0.00 %)               &lt;br /&gt;Branches: 0               &lt;br /&gt;===Solution Details===               &lt;br /&gt;Goals:               &lt;br /&gt;goal_8ef: -5&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Decisions:              &lt;br /&gt;x: 5               &lt;br /&gt;===== Finished .\output.mps: 00:00:00.5501834 =====&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This is incorrect. The reported value of x=5 indicates x is not read as a binary variable. If we solve the MPS file with CBC we see:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="1000" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="1025"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;..\Downloads\cbc output.mps -solve -solution stdout              &lt;br /&gt;Welcome to the CBC MILP Solver               &lt;br /&gt;Version: 2.7.5               &lt;br /&gt;Build Date: Nov 10 2011               &lt;br /&gt;Revision Number: 1759&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;command line - ..\Downloads\cbc output.mps -solve -solution stdout (default strategy 1)              &lt;br /&gt;At line 1 NAME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MODEL               &lt;br /&gt;At line 2 ROWS               &lt;br /&gt;At line 5 COLUMNS               &lt;br /&gt;At line 9 RHS               &lt;br /&gt;At line 11 BOUNDS               &lt;br /&gt;At line 12 ENDATA               &lt;br /&gt;Problem MODEL has 1 rows, 1 columns and 1 elements               &lt;br /&gt;Coin0008I MODEL read with 0 errors               &lt;br /&gt;Continuous objective value is -1 - 0.00 seconds               &lt;br /&gt;Cgl0004I processed model has 0 rows, 0 columns (0 integer) and 0 elements               &lt;br /&gt;Cbc3007W No integer variables - nothing to do               &lt;br /&gt;Cuts at root node changed objective from -1 to -1.79769e+308               &lt;br /&gt;Probing was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)               &lt;br /&gt;TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Result - Optimal solution found&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Objective value:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -1.00000000              &lt;br /&gt;Enumerated nodes:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0               &lt;br /&gt;Total iterations:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0               &lt;br /&gt;Time (CPU seconds):&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.01               &lt;br /&gt;Time (Wallclock seconds):&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.01&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Optimal - objective value -1.00000000              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 x&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -1               &lt;br /&gt;Total time (CPU seconds):&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.02&amp;#160;&amp;#160; (Wallclock seconds):&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.02&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;           &lt;br /&gt;&lt;font face="Consolas"&gt;C:\Users\erwin\Documents&amp;gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The output is a little bit confusing, but indeed x assumes the value 1. This confirms x is binary.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-899717256509216633?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/899717256509216633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/as-follow-up-on-httpyetanothermathprogr.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/899717256509216633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/899717256509216633'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/as-follow-up-on-httpyetanothermathprogr.html' title='MPS Files (2)'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8402437771104175171</id><published>2011-11-16T21:10:00.001-05:00</published><updated>2011-11-16T21:10:52.356-05:00</updated><title type='text'>Rick Rosenthal: Ten Keys to Success in Optimization Modeling</title><content type='html'>&lt;p&gt;I recently talked to a an ex-student of Rick Rosenthal. The following presentation contains some concise descriptions of his ideas and beliefs on modeling:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://faculty.nps.edu/rrosent/docs/rosenthalAtlanta.ppt" href="http://faculty.nps.edu/rrosent/docs/rosenthalAtlanta.ppt"&gt;http://faculty.nps.edu/rrosent/docs/rosenthalAtlanta.ppt&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8402437771104175171?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8402437771104175171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/i-recently-talked-to-an-ex-student-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8402437771104175171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8402437771104175171'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/i-recently-talked-to-an-ex-student-of.html' title='Rick Rosenthal: Ten Keys to Success in Optimization Modeling'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1909131740545088181</id><published>2011-11-16T21:03:00.001-05:00</published><updated>2011-11-16T21:03:05.083-05:00</updated><title type='text'>HPC applications in the Amazon cloud</title><content type='html'>&lt;p&gt;From &lt;a href="http://aws.amazon.com/hpc-applications/"&gt;http://aws.amazon.com/hpc-applications/&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“For example, a 1064 instance (17024 cores) cluster of &lt;em&gt;cc2.8xlarge&lt;/em&gt; instances was able to achieve 240.09 TeraFLOPS for the &lt;a href="http://www.netlib.org/benchmark/hpl/"&gt;High Performance Linpack&lt;/a&gt; benchmark, placing the cluster at #42 in the November 2011 Top500 list.”&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1909131740545088181?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1909131740545088181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/from-httpaws.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1909131740545088181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1909131740545088181'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/from-httpaws.html' title='HPC applications in the Amazon cloud'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-889185524459352563</id><published>2011-11-14T17:56:00.001-05:00</published><updated>2011-11-15T22:47:32.024-05:00</updated><title type='text'>Sulum Optimization</title><content type='html'>&lt;p&gt;Bo Jensen at &lt;a href="http://www.sulumoptimization.com/"&gt;http://www.sulumoptimization.com&lt;/a&gt; announced the availability of a new commercial LP solver. Some first impressions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;LP (+network) only for now, MIP will come later. &lt;/li&gt;    &lt;li&gt;Aggressively priced compared to the big ones (Cplex, Gurobi). I can see this can be a very attractive offering in certain cases. &lt;/li&gt;    &lt;li&gt;But it has a nasty license manager (somehow I always have troubles with these). The other commercial guys have similar drawbacks. &lt;/li&gt;    &lt;li&gt;I think if you have a single license you can solve one LP at the time (a result of the previous point). &lt;/li&gt;    &lt;li&gt;Low level API. In many cases, to be efficient you will need to use some more advanced modeling tools. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The product seems to be well-positioned between the Open Source offerings such as Lp-Solve, GLPK and CBC and the heavy guns (Cplex, Gurobi, Xpress). &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-889185524459352563?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/889185524459352563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/sulum-optimization.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/889185524459352563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/889185524459352563'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/sulum-optimization.html' title='Sulum Optimization'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4435974189759587083</id><published>2011-11-09T07:04:00.001-05:00</published><updated>2011-11-09T07:11:10.771-05:00</updated><title type='text'>Automatic Reformulations</title><content type='html'>&lt;p&gt;More and more we see that modeling systems apply automatic reformulations. &lt;/p&gt;  &lt;p&gt;For instance I see that Cplex’s Concert accepts&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;model.add (IloMin (x, y) == 0)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;for x≥0,y≥0. Essentially this is “x=0 or y=0”. This construct seems to get translated into&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;a+b≥1      &lt;br /&gt;a=1 ↔ x = 0       &lt;br /&gt;b=1 ↔ y = 0       &lt;br /&gt;x,y≥0, a,b∈{0,1}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here the indicator constraints of Cplex are used, so no upper-bounds are needed. For other MIP solvers one would likely use something like:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;x ≤ b * x.up      &lt;br /&gt;y ≤ (1-b) * y.up       &lt;br /&gt;x,y≥0, b∈{0,1}&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Similarly in the language CMPL we see that x*y is accepted and translated if x or y is a binary or integer variable (see &lt;a href="http://www.coliop.org/download/cmpl/CMPL-1-5-2.pdf"&gt;http://www.coliop.org/download/cmpl/CMPL-1-5-2.pdf&lt;/a&gt; section 7.3).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4435974189759587083?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4435974189759587083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/automatic-reformulations.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4435974189759587083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4435974189759587083'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/automatic-reformulations.html' title='Automatic Reformulations'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-2228852218238066001</id><published>2011-11-08T23:26:00.001-05:00</published><updated>2011-11-09T07:05:42.796-05:00</updated><title type='text'>Solver Options</title><content type='html'>&lt;p&gt;In general I don’t like to use solver options to improve performance. I would hope that a solver would do a good job with default settings. Hopefully it will figure out from the model what settings it should use, an if not, will detect slow performance and does something about it. In addition I often feel that my own solver settings are not that stable. A next version of the solver may well show slower performance with my own settings, and a next version of the model may have similar issues. Also there is this statement I have heard someone saying: “each solver option is a situation where the developer did not know what to do”. Sometimes I notice users are very impressed by the many options a solver offers (may be also intimidated by the sometimes obscure but very technically advanced sounding descriptions). Here I almost argue the opposite. As a result, I often spent more time on model reformulations than on solver options.&lt;/p&gt;  &lt;p&gt;But sometimes the differences are so dramatic, I have to break my own rules:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="1063" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="1061"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\lsi\src\Development\TMS\Source\TestResults\erwin_ERWIN-THINK 2011-11-07 14_32_27\Out&amp;gt;&lt;strong&gt;type model.oml&lt;/strong&gt;               &lt;br /&gt;Model[               &lt;br /&gt;Decisions[               &lt;br /&gt;Integers[0, 58],&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;&lt;em&gt;This model is a little bit ugly as it was generated automatically by SaveModel.&lt;/em&gt;                 &lt;br /&gt;&lt;/font&gt;Foreach[&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;em&gt;&lt;font color="#0000ff"&gt;However it shows it is pretty small.&lt;/font&gt;&lt;/em&gt;&amp;#160; &lt;br /&gt;{iter1, 59},               &lt;br /&gt;x[iter1]               &lt;br /&gt;]               &lt;br /&gt;],               &lt;br /&gt;Constraints[               &lt;br /&gt;prereq0 -&amp;gt; x[13] &amp;lt; x[0],               &lt;br /&gt;prereq1 -&amp;gt; x[20] &amp;lt; x[1],               &lt;br /&gt;prereq2 -&amp;gt; x[17] &amp;lt; x[2],               &lt;br /&gt;prereq3 -&amp;gt; x[7] &amp;lt; x[3],               &lt;br /&gt;prereq4 -&amp;gt; x[19] &amp;lt; x[4],               &lt;br /&gt;prereq5 -&amp;gt; x[26] &amp;lt; x[5],               &lt;br /&gt;prereq6 -&amp;gt; x[8] &amp;lt; x[6],               &lt;br /&gt;prereq7 -&amp;gt; x[21] &amp;lt; x[7],               &lt;br /&gt;prereq8 -&amp;gt; x[4] &amp;lt; x[8],               &lt;br /&gt;prereq9 -&amp;gt; x[12] &amp;lt; x[10],               &lt;br /&gt;prereq10 -&amp;gt; x[0] &amp;lt; x[11],               &lt;br /&gt;prereq11 -&amp;gt; x[18] &amp;lt; x[12],               &lt;br /&gt;prereq12 -&amp;gt; x[3] &amp;lt; x[13],               &lt;br /&gt;prereq13 -&amp;gt; x[9] &amp;lt; x[14],               &lt;br /&gt;prereq14 -&amp;gt; x[27] &amp;lt; x[15],               &lt;br /&gt;prereq15 -&amp;gt; x[5] &amp;lt; x[16],               &lt;br /&gt;prereq16 -&amp;gt; x[15] &amp;lt; x[17],               &lt;br /&gt;prereq17 -&amp;gt; x[6] &amp;lt; x[18],               &lt;br /&gt;prereq18 -&amp;gt; x[16] &amp;lt; x[19],               &lt;br /&gt;prereq19 -&amp;gt; x[22] &amp;lt; x[20],               &lt;br /&gt;prereq20 -&amp;gt; x[23] &amp;lt; x[21],               &lt;br /&gt;prereq21 -&amp;gt; x[14] &amp;lt; x[22],               &lt;br /&gt;prereq22 -&amp;gt; x[25] &amp;lt; x[23],               &lt;br /&gt;prereq23 -&amp;gt; x[10] &amp;lt; x[24],               &lt;br /&gt;prereq24 -&amp;gt; x[24] &amp;lt; x[25],               &lt;br /&gt;prereq25 -&amp;gt; x[2] &amp;lt; x[26],               &lt;br /&gt;prereq26 -&amp;gt; x[1] &amp;lt; x[27],               &lt;br /&gt;prereq27 -&amp;gt; x[29] &amp;lt; x[28],               &lt;br /&gt;prereq28 -&amp;gt; x[31] &amp;lt; x[29],               &lt;br /&gt;prereq29 -&amp;gt; x[32] &amp;lt; x[30],               &lt;br /&gt;prereq30 -&amp;gt; x[33] &amp;lt; x[31],               &lt;br /&gt;prereq31 -&amp;gt; x[28] &amp;lt; x[32],               &lt;br /&gt;prereq32 -&amp;gt; x[36] &amp;lt; x[34],               &lt;br /&gt;prereq33 -&amp;gt; x[34] &amp;lt; x[35],               &lt;br /&gt;prereq34 -&amp;gt; x[38] &amp;lt; x[36],               &lt;br /&gt;prereq35 -&amp;gt; x[35] &amp;lt; x[37],               &lt;br /&gt;prereq36 -&amp;gt; x[42] &amp;lt; x[39],               &lt;br /&gt;prereq37 -&amp;gt; x[39] &amp;lt; x[40],               &lt;br /&gt;prereq38 -&amp;gt; x[44] &amp;lt; x[40],               &lt;br /&gt;prereq39 -&amp;gt; x[45] &amp;lt; x[40],               &lt;br /&gt;prereq40 -&amp;gt; x[49] &amp;lt; x[40],               &lt;br /&gt;prereq41 -&amp;gt; x[53] &amp;lt; x[40],               &lt;br /&gt;prereq42 -&amp;gt; x[54] &amp;lt; x[40],               &lt;br /&gt;prereq43 -&amp;gt; x[56] &amp;lt; x[40],               &lt;br /&gt;prereq44 -&amp;gt; x[56] &amp;lt; x[41],               &lt;br /&gt;prereq45 -&amp;gt; x[56] &amp;lt; x[42],               &lt;br /&gt;prereq46 -&amp;gt; x[56] &amp;lt; x[43],               &lt;br /&gt;prereq47 -&amp;gt; x[50] &amp;lt; x[44],               &lt;br /&gt;prereq48 -&amp;gt; x[52] &amp;lt; x[45],               &lt;br /&gt;prereq49 -&amp;gt; x[57] &amp;lt; x[45],               &lt;br /&gt;prereq50 -&amp;gt; x[56] &amp;lt; x[46],               &lt;br /&gt;prereq51 -&amp;gt; x[56] &amp;lt; x[47],               &lt;br /&gt;prereq52 -&amp;gt; x[39] &amp;lt; x[48],               &lt;br /&gt;prereq53 -&amp;gt; x[44] &amp;lt; x[48],               &lt;br /&gt;prereq54 -&amp;gt; x[45] &amp;lt; x[48],               &lt;br /&gt;prereq55 -&amp;gt; x[49] &amp;lt; x[48],               &lt;br /&gt;prereq56 -&amp;gt; x[53] &amp;lt; x[48],               &lt;br /&gt;prereq57 -&amp;gt; x[54] &amp;lt; x[48],               &lt;br /&gt;prereq58 -&amp;gt; x[56] &amp;lt; x[48],               &lt;br /&gt;prereq59 -&amp;gt; x[43] &amp;lt; x[49],               &lt;br /&gt;prereq60 -&amp;gt; x[46] &amp;lt; x[49],               &lt;br /&gt;prereq61 -&amp;gt; x[56] &amp;lt; x[50],               &lt;br /&gt;prereq62 -&amp;gt; x[56] &amp;lt; x[52],               &lt;br /&gt;prereq63 -&amp;gt; x[41] &amp;lt; x[53],               &lt;br /&gt;prereq64 -&amp;gt; x[47] &amp;lt; x[54],               &lt;br /&gt;prereq65 -&amp;gt; x[40] &amp;lt; x[55],               &lt;br /&gt;prereq66 -&amp;gt; x[48] &amp;lt; x[55],               &lt;br /&gt;prereq67 -&amp;gt; x[51] &amp;lt; x[56],               &lt;br /&gt;prereq68 -&amp;gt; x[56] &amp;lt; x[57],               &lt;br /&gt;alldiff -&amp;gt; Unequal[Foreach[               &lt;br /&gt;{iter2, 59},               &lt;br /&gt;x[iter2]               &lt;br /&gt;]]               &lt;br /&gt;]               &lt;br /&gt;]               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\lsi\src\Development\TMS\Source\TestResults\erwin_ERWIN-THINK 2011-11-07 14_32_27\Out&amp;gt;&lt;strong&gt;&amp;quot;\Program Files (x86)\Microsoft Solver Foundation\3.0.2.10889\Bin\MSFCli.exe&amp;quot; +verbose 0 model.oml&lt;/strong&gt;               &lt;br /&gt;===== Processing .\model.oml =====               &lt;br /&gt;Solution Quality: Feasible               &lt;br /&gt;===Solver Foundation Service Report===               &lt;br /&gt;Date: 11/8/2011 11:09:55 PM               &lt;br /&gt;Version: Microsoft Solver Foundation 3.0.2.10889 Express Edition               &lt;br /&gt;Model Name: DefaultModel               &lt;br /&gt;Capabilities Applied: CP               &lt;br /&gt;Solve Time (ms): &lt;font style="background-color: #ffc000"&gt;184798&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;&lt;em&gt;Timings with default settings&lt;/em&gt;&lt;/font&gt;               &lt;br /&gt;Total Time (ms): &lt;font style="background-color: #ffc000"&gt;185031&lt;/font&gt;               &lt;br /&gt;Solve Completion Status: Feasible               &lt;br /&gt;Solver Selected: Microsoft.SolverFoundation.Solvers.ConstraintSystem               &lt;br /&gt;===Solution Details===               &lt;br /&gt;Goals:               &lt;br /&gt;===== Finished .\model.oml: 00:03:05.0714386 =====&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\lsi\src\Development\TMS\Source\TestResults\erwin_ERWIN-THINK 2011-11-07 14_32_27\Out&amp;gt;&lt;strong&gt;&amp;quot;\Program Files (x86)\Microsoft Solver Foundation\3.0.2.10889\Bin\MSFCli.exe&amp;quot; &lt;font style="background-color: #ffc000"&gt;+variable conflictdriven&lt;/font&gt; +verbose 0 model.oml&lt;/strong&gt;               &lt;br /&gt;===== Processing .\model.oml =====               &lt;br /&gt;Solution Quality: Feasible               &lt;br /&gt;===Solver Foundation Service Report===               &lt;br /&gt;Date: 11/8/2011 11:06:38 PM               &lt;br /&gt;Version: Microsoft Solver Foundation 3.0.2.10889 Express Edition               &lt;br /&gt;Model Name: DefaultModel               &lt;br /&gt;Capabilities Applied: CP               &lt;br /&gt;Solve Time (ms): &lt;font style="background-color: #ffc000"&gt;203&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000ff"&gt;&lt;em&gt;Timings with option&lt;/em&gt;&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;Total Time (ms): &lt;font style="background-color: #ffc000"&gt;433&lt;/font&gt;               &lt;br /&gt;Solve Completion Status: Feasible               &lt;br /&gt;Solver Selected: Microsoft.SolverFoundation.Solvers.ConstraintSystem               &lt;br /&gt;===Solution Details===               &lt;br /&gt;Goals:               &lt;br /&gt;===== Finished .\model.oml: 00:00:00.4739553 =====&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Note: it is not surprising that Cplex added a tuning option to suggest some good settings. A related effort is: &lt;a href="http://www.cs.ubc.ca/labs/beta/Projects/MIP-Config/"&gt;http://www.cs.ubc.ca/labs/beta/Projects/MIP-Config/&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-2228852218238066001?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/2228852218238066001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/solver-options.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2228852218238066001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2228852218238066001'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/solver-options.html' title='Solver Options'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-2136518667403818237</id><published>2011-11-07T18:57:00.001-05:00</published><updated>2011-11-09T00:28:59.703-05:00</updated><title type='text'>Finding feasible schedules for a column generation algorithm</title><content type='html'>&lt;p&gt;For a complex scheduling application, I need to generate a large number of feasible schedules for a class. Basically:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;find x[1]…x[n] in {1..n}      &lt;br /&gt;under some precedence constraints x[i] &amp;lt; x[j]       &lt;br /&gt;all-different(x[1]…x[n])&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;MIP models are not very good for this (see &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/sorting-by-mip.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/sorting-by-mip.html&lt;/a&gt;). But a constraint programming model should be very easy to formulate and may perform quite good.&lt;/p&gt;  &lt;p&gt;With Microsoft Solver Foundation I had to use some nondefault settings (VariableSelection=ConfictDriven) to get good performance. Genererating multiple solutions is easily performed with Solution.GetNext(). I don’t think it is easy to generate a subset of solutions that has a certain spread. The only thing that comes to mind is doing many calls to Solution.GetNext() and just using each K-th solution. As I don’t know in advance how many solutions there are, I am thinking about increasing K as we go.&lt;/p&gt;  &lt;p&gt;For some classes I have simply a very large number of possible schedules (or differently put: not enough precedence constraints to reduce this number). To find a reasonable subset we could augment the above system of equations with a random objective. Now we need to restate the objective each cycle, so we no longer can use Solution.GetNext().&lt;/p&gt;  &lt;p&gt;From what I see most modeling systems have available constraint programming support (e.g. Ilog OPL, MS Solver Foundation) or have something announced (AMPL, AIMMS).&lt;/p&gt;  &lt;p&gt;Update: link from comment below: &lt;a href="http://www.nicta.com.au/pub?doc=4759"&gt;www.nicta.com.au/pub?doc=4759&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-2136518667403818237?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/2136518667403818237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/finding-feasible-schedules-for-column.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2136518667403818237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2136518667403818237'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/11/finding-feasible-schedules-for-column.html' title='Finding feasible schedules for a column generation algorithm'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4893960167595000427</id><published>2011-10-31T03:17:00.001-04:00</published><updated>2011-10-31T06:46:37.503-04:00</updated><title type='text'>Slacks (with penalties) should not be integer variables</title><content type='html'>&lt;p&gt;In the paper &lt;a href="http://www.cs.nott.ac.uk/~jxm/timetabling/gor2007-paper.pdf"&gt;http://www.cs.nott.ac.uk/~jxm/timetabling/gor2007-paper.pdf&lt;/a&gt; a number of integer models for timetabling are discussed. The author also published the models used in this paper &lt;a title="http://www.cs.nott.ac.uk/~jxm/timetabling/gor2007-empirical.zip" href="http://www.cs.nott.ac.uk/~jxm/timetabling/gor2007-empirical.zip"&gt;http://www.cs.nott.ac.uk/~jxm/timetabling/gor2007-empirical.zip&lt;/a&gt; (this should be very much applauded). Of course that means that I can provide some criticism.&lt;/p&gt;  &lt;p&gt;In the scheduling models some soft constraints are modeled by introducing slacks, in this case CourseMinDayViolations:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="880" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="878"&gt;&lt;font face="Consolas"&gt;subto ctCountWorkingDays:            &lt;br /&gt;&amp;#160; forall &amp;lt;c&amp;gt; in Courses:             &lt;br /&gt;&amp;#160; sum &amp;lt;d&amp;gt; in Days:             &lt;br /&gt;&amp;#160; CourseSchedule[c,d] &amp;gt;= CourseHasMindays[c] - &lt;font style="background-color: #ffc000"&gt;CourseMinDayViolations&lt;/font&gt;[c];             &lt;br /&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;blockquote&gt;&lt;/blockquote&gt;  &lt;p&gt;This variable can then be minimized in the objective:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="880" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="878"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;minimize value:              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; (sum &amp;lt;p&amp;gt; in Periods: sum &amp;lt;r&amp;gt; in Rooms: sum &amp;lt;c&amp;gt; in Courses with CourseHasStudents[c] &amp;gt; RoomHasCapacity[r]:               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (Taught[p,r,c] * (CourseHasStudents[c] - RoomHasCapacity[r]))               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; )               &lt;br /&gt;&amp;#160; + 2 * (sum &amp;lt;cu&amp;gt; in Curricula: sum &amp;lt;d&amp;gt; in Days: sum &amp;lt;sc&amp;gt; in DaySingletonChecks: SingletonChecks[cu,d,sc])               &lt;br /&gt;&amp;#160; + 5 * (sum &amp;lt;c&amp;gt; in Courses: &lt;font style="background-color: #ffc000"&gt;CourseMinDayViolations&lt;/font&gt;[c])               &lt;br /&gt;;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;That looks all good. But I don’t agree with the declaration:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="880" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="878"&gt;&lt;font face="Consolas"&gt;var CourseMinDayViolations[Courses] integer &amp;gt;= 0 &amp;lt;= nbDays;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;A slack variable like this should be declared as a positive continuous variable. It will be integer automatically. With this declaration there is the possibility the solver will branch on this variable.&lt;/p&gt;  &lt;p&gt;My simplest argument would be: a model with fewer integer variables is likely to solve faster.&lt;/p&gt;  &lt;p&gt;But sometimes solvers actually add integer variables! See:&lt;/p&gt;    &lt;table border="1" cellspacing="0" cellpadding="2" width="880" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="878"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Tried aggregator 1 time.             &lt;br /&gt;MIP Presolve eliminated 1634 rows and 5 columns.              &lt;br /&gt;MIP Presolve modified 10 coefficients.              &lt;br /&gt;Reduced MIP has 2401 rows, 11512 columns, and 92222 nonzeros.              &lt;br /&gt;Reduced MIP has 11028 binaries, 0 generals, 0 SOSs, and 0 indicators.              &lt;br /&gt;Probing time =&amp;#160;&amp;#160;&amp;#160; 0.02 sec.              &lt;br /&gt;Tried aggregator 1 time.              &lt;br /&gt;MIP Presolve eliminated 10 rows and 0 columns.              &lt;br /&gt;Reduced MIP has 2391 rows, 11512 columns, and 91732 nonzeros.              &lt;br /&gt;Reduced MIP has 11032 binaries, &lt;font style="background-color: #ffff00"&gt;480 generals&lt;/font&gt;, 0 SOSs, and 0 indicators.              &lt;br /&gt;Presolve time =&amp;#160;&amp;#160;&amp;#160; 0.20 sec.              &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;(This model had originally only binary and continuous variables).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4893960167595000427?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4893960167595000427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/slacks-with-penalties-should-not-be.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4893960167595000427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4893960167595000427'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/slacks-with-penalties-should-not-be.html' title='Slacks (with penalties) should not be integer variables'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3409719318988522102</id><published>2011-10-26T23:14:00.001-04:00</published><updated>2011-10-27T19:29:31.127-04:00</updated><title type='text'>Still not proven optimal…</title><content type='html'>&lt;p&gt;This is a very small MIP:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="690" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="688"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Starting Gurobi...              &lt;br /&gt;Optimize a model with 24 rows, 54 columns and 132 nonzeros               &lt;br /&gt;Presolve removed 6 rows and 6 columns               &lt;br /&gt;Presolve time: 0.11s               &lt;br /&gt;Presolved: 18 rows, 48 columns, 114 nonzeros               &lt;br /&gt;Variable types: 12 continuous, 36 integer (0 binary)               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;so I expected to run this very quickly on a fast 8 core Xeon machine. The time limit of 9999 seconds should be no problem even with the OPTCR (rel. gap tolerance) of 0.0. But I see:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="690" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="689"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;835689342 7572026 infeasible&amp;#160;&amp;#160; 63&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.00062&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 100%&amp;#160;&amp;#160; 1.0 9980s              &lt;br /&gt;836077602 7576642&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 65&amp;#160;&amp;#160; 14&amp;#160;&amp;#160;&amp;#160; 0.00062&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 100%&amp;#160;&amp;#160; 1.0 9985s               &lt;br /&gt;836454289 7582365&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 56&amp;#160;&amp;#160; 15&amp;#160;&amp;#160;&amp;#160; 0.00062&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 100%&amp;#160;&amp;#160; 1.0 9990s               &lt;br /&gt;836850333 7587882&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 45&amp;#160;&amp;#160; 15&amp;#160;&amp;#160;&amp;#160; 0.00062&amp;#160;&amp;#160;&amp;#160; 0.00000&amp;#160;&amp;#160; 100%&amp;#160;&amp;#160; 1.0 9995s&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Cutting planes:              &lt;br /&gt;&amp;#160; Gomory: 1               &lt;br /&gt;&amp;#160; MIR: 2&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Explored 837155963 nodes (841647794 simplex iterations) in 9999.00 seconds              &lt;br /&gt;Thread count was 8 (of 8 available processors)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Time limit reached              &lt;br /&gt;Best objective 6.179540598832e-04, best bound 0.000000000000e+00, gap 100.0000%               &lt;br /&gt;MIP status(9): Optimization terminated due to time limit.               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This is not a Gurobi problem: Cplex is just as bad. Apparently these branch and bound methods are just not suited very well for this problem. I have solved some huge problems with hundreds of thousands of binary variables, but here we see some evidence, not all problems are that easy.&lt;/p&gt;  &lt;p&gt;Recently I saw someone writing:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;gurobi&amp;gt; m.setParam('Threads',80)&lt;/font&gt;       &lt;br /&gt;You may all drool now.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Guess we need something like that to solve my tiny 36 integer variable problem….&lt;/p&gt;  &lt;p&gt;Notes:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The OPTCR (gap tolerance) setting is not an issue as it turns out the best bound remains at 0.0, so a gap of 100% is reported. &lt;/li&gt;    &lt;li&gt;Gurobi is solving the nodes pretty efficiently. Approx. 1 simplex iteration per node, and &amp;gt; 80k nodes per second. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Update&lt;/h4&gt;  &lt;p&gt;Some Cplex runs solve this fast (see comments below), but on some machines I see the same problem:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="690" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="689"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Cplex 12.3.0.0&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Reading data...              &lt;br /&gt;Starting Cplex...               &lt;br /&gt;Tried aggregator 2 times.               &lt;br /&gt;MIP Presolve eliminated 1 rows and 1 columns.               &lt;br /&gt;MIP Presolve modified 36 coefficients.               &lt;br /&gt;Aggregator did 6 substitutions.               &lt;br /&gt;Reduced MIP has 18 rows, 48 columns, and 114 nonzeros.               &lt;br /&gt;Reduced MIP has 0 binaries, 36 generals, 0 SOSs, and 0 indicators.               &lt;br /&gt;…               &lt;br /&gt;Elapsed real time = 9880.28 sec. (tree size = 1251.36 MB, solutions = 70)               &lt;br /&gt;Nodefile size = 1123.85 MB (527.18 MB after compression)               &lt;br /&gt;478309344 6481362&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 15&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.26e+008&amp;#160; 100.00%               &lt;br /&gt;479049990 6483695&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 15&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.27e+008&amp;#160; 100.00%               &lt;br /&gt;479749224 6499596&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 15&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.27e+008&amp;#160; 100.00%               &lt;br /&gt;480524806 6502892&amp;#160;&amp;#160;&amp;#160; infeasible&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.28e+008&amp;#160; 100.00%               &lt;br /&gt;481284148 6500253&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 16&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.29e+008&amp;#160; 100.00%               &lt;br /&gt;482022525 6501343&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 16&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.30e+008&amp;#160; 100.00%               &lt;br /&gt;482764367 6511470&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000&amp;#160;&amp;#160;&amp;#160; 16&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0012&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0000 5.31e+008&amp;#160; 100.00%&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Mixed integer rounding cuts applied:&amp;#160; 2              &lt;br /&gt;Zero-half cuts applied:&amp;#160; 2               &lt;br /&gt;Gomory fractional cuts applied:&amp;#160; 2&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Root node processing (before b&amp;amp;c):              &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 0.03               &lt;br /&gt;Parallel b&amp;amp;c, 4 threads:               &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 9998.98               &lt;br /&gt;&amp;#160; Sync time (average)&amp;#160;&amp;#160; =&amp;#160; 420.45               &lt;br /&gt;&amp;#160; Wait time (average)&amp;#160;&amp;#160; =&amp;#160;&amp;#160; 45.69               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -------               &lt;br /&gt;Total (root+branch&amp;amp;cut) = 9999.01 sec.               &lt;br /&gt;MIP status(107): time limit exceeded               &lt;br /&gt;Fixing integer variables, and solving final LP...               &lt;br /&gt;Parallel mode: deterministic, using up to 2 threads for concurrent optimization.               &lt;br /&gt;Tried aggregator 1 time.               &lt;br /&gt;LP Presolve eliminated 25 rows and 55 columns.               &lt;br /&gt;All rows and columns eliminated.               &lt;br /&gt;Fixed MIP status(1): optimal&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Resource limit exceeded.&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;MIP Solution:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.001230&amp;#160;&amp;#160;&amp;#160; (530937464 iterations, 482992718 nodes)              &lt;br /&gt;Final Solve:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.001230&amp;#160;&amp;#160;&amp;#160; (0 iterations)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Best possible:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000000              &lt;br /&gt;Absolute gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.001230               &lt;br /&gt;Relative gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000000&lt;/font&gt;&lt;font face="Consolas"&gt;              &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This is a worse solution than Gurobi found. But on a different machine using 8 threads:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="690" bgcolor="#d3d3d3"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="688"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Cplex 12.3.0.0&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Reading data...             &lt;br /&gt;Starting Cplex...              &lt;br /&gt;Tried aggregator 2 times.              &lt;br /&gt;MIP Presolve eliminated 1 rows and 1 columns.              &lt;br /&gt;MIP Presolve modified 36 coefficients.              &lt;br /&gt;Aggregator did 6 substitutions.              &lt;br /&gt;Reduced MIP has 18 rows, 48 columns, and 114 nonzeros.              &lt;br /&gt;Reduced MIP has 0 binaries, 36 generals, 0 SOSs, and 0 indicators.              &lt;br /&gt;…              &lt;br /&gt;&lt;/font&gt;&lt;font face="Consolas"&gt; 129959&amp;#160; 4046&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0003&amp;#160;&amp;#160;&amp;#160; 10&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0031&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0003&amp;#160;&amp;#160; 113627&amp;#160;&amp;#160; 91.54%             &lt;br /&gt;*165794&amp;#160; 5594&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; integral&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0027&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0005&amp;#160;&amp;#160; 146606&amp;#160;&amp;#160; 81.09%              &lt;br /&gt;*170030&amp;#160; 4859&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; integral&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0019&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0005&amp;#160;&amp;#160; 149634&amp;#160;&amp;#160; 72.63%              &lt;br /&gt;*193953&amp;#160; 3702&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; integral&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0007&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0006&amp;#160;&amp;#160; 171409&amp;#160;&amp;#160; 15.85%              &lt;br /&gt;*195840&amp;#160;&amp;#160; 418&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; integral&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0006&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.0006&amp;#160;&amp;#160; 172394&amp;#160;&amp;#160;&amp;#160; 2.03%&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Mixed integer rounding cuts applied:&amp;#160; 3             &lt;br /&gt;Gomory fractional cuts applied:&amp;#160; 1&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Root node processing (before b&amp;amp;c):             &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 0.12              &lt;br /&gt;Parallel b&amp;amp;c, 8 threads:              &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 4.10              &lt;br /&gt;&amp;#160; Sync time (average)&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 0.39              &lt;br /&gt;&amp;#160; Wait time (average)&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 0.02              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -------              &lt;br /&gt;Total (root+branch&amp;amp;cut) =&amp;#160;&amp;#160;&amp;#160; 4.23 sec.              &lt;br /&gt;MIP status(101): integer optimal solution              &lt;br /&gt;Fixing integer variables, and solving final LP...              &lt;br /&gt;Parallel mode: deterministic, using up to 2 threads for concurrent optimization.              &lt;br /&gt;Tried aggregator 1 time.              &lt;br /&gt;LP Presolve eliminated 25 rows and 55 columns.              &lt;br /&gt;All rows and columns eliminated.              &lt;br /&gt;Fixed MIP status(1): optimal&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Proven optimal solution.&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;MIP Solution:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000616&amp;#160;&amp;#160;&amp;#160; (175023 iterations, 203294 nodes)             &lt;br /&gt;Final Solve:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000616&amp;#160;&amp;#160;&amp;#160; (0 iterations)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Best possible:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000616             &lt;br /&gt;Absolute gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000000              &lt;br /&gt;Relative gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.000000              &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;So we have some very different behavior here: optimal in just 4 seconds.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3409719318988522102?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3409719318988522102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/still-not-proven-optimal.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3409719318988522102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3409719318988522102'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/still-not-proven-optimal.html' title='Still not proven optimal…'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-314798395849830871</id><published>2011-10-20T21:12:00.001-04:00</published><updated>2011-10-20T21:12:57.818-04:00</updated><title type='text'>Special case of integer cuts</title><content type='html'>&lt;p&gt;In &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/integer-cuts.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/integer-cuts.html&lt;/a&gt; we derive a constraint that forbids an integer configuration &lt;i&gt;y&lt;sup&gt;*&lt;/sup&gt;&lt;/i&gt;. &lt;/p&gt;  &lt;p&gt;If the model contains a constraint like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-G5IcIGBHvZE/TqDHFWIHnNI/AAAAAAAAAxA/hmILOu7ijpc/s1600-h/image%25255B8%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-haJDRMLXMIg/TqDHFjn2wVI/AAAAAAAAAxI/zNWGu5unBw0/image_thumb%25255B2%25255D.png?imgmax=800" width="146" height="84" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;then we can simplify the integer cut to:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-hJ3MdTLSUjo/TqDHF5tvXUI/AAAAAAAAAxQ/X__yrrtb0Do/s1600-h/image%25255B5%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-kKafoyC8X_Q/TqDHGdmdnII/AAAAAAAAAxY/PH7FknfO3R0/image_thumb%25255B1%25255D.png?imgmax=800" width="233" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;as we only need to keep track of the variables flipping from 1 → 0. This is because any variable moving from 0 → 1 will cause another variable to move from 1 → 0. &lt;/p&gt;  &lt;p&gt;This simpler constraint has fewer nonzeroes which is important if we add a lot of such cuts, as is the case in one of my models.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-314798395849830871?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/314798395849830871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/special-case-of-integer-cuts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/314798395849830871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/314798395849830871'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/special-case-of-integer-cuts.html' title='Special case of integer cuts'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-haJDRMLXMIg/TqDHFjn2wVI/AAAAAAAAAxI/zNWGu5unBw0/s72-c/image_thumb%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1774782970643117083</id><published>2011-10-18T05:35:00.001-04:00</published><updated>2011-10-18T11:00:40.412-04:00</updated><title type='text'>MPS files</title><content type='html'>&lt;p&gt;Yesterday we found out that Microsoft Solver Foundation is writing incorrect MPS files when the model has general integer variables without an upper bound. See: &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/solverfoundation/thread/7669081f-18ac-445b-850e-434bff80da38"&gt;http://social.msdn.microsoft.com/Forums/en-US/solverfoundation/thread/7669081f-18ac-445b-850e-434bff80da38&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Right after I submitted an error report, the following e-mail arrived:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="827"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="825"&gt;         &lt;p&gt;I trying to convert one problem on gmpl format to free mps format, both in attached, and the solve it.            &lt;br /&gt;Unfortunately, when solve the mps file I get an answer different from the answer that I get when solve using the gmpl file.&lt;/p&gt;          &lt;p&gt;I was using the following commands:            &lt;br /&gt;$ glpsol --math exemp01.mod             &lt;br /&gt;$ glpsol --math exemp01.mod --check --wfreemps exemp01.mps             &lt;br /&gt;$ glpsol --freemps exemp01.mps &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;See: &lt;a href="http://lists.gnu.org/archive/html/help-glpk/2011-10/msg00049.html"&gt;http://lists.gnu.org/archive/html/help-glpk/2011-10/msg00049.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Lo and behold, this is exactly the same problem!&lt;/p&gt;  &lt;p&gt;The problem is shown in the following MPS file (generated by Cplex, comments added by me):&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="824"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="822"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;NAME&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; gamsmodel              &lt;br /&gt;ROWS               &lt;br /&gt;N&amp;#160; obj               &lt;br /&gt;E&amp;#160; e1               &lt;br /&gt;L&amp;#160; e2               &lt;br /&gt;COLUMNS               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MARK0000&amp;#160; 'MARKER'&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'INTORG'               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; obj&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; x&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MARK0001&amp;#160; 'MARKER'&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'INTEND'               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; z&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; obj&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -1               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; z&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1               &lt;br /&gt;RHS               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; rhs&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; e2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 200               &lt;br /&gt;BOUNDS               &lt;br /&gt;&lt;em&gt;* column x is a general integer variable                &lt;br /&gt;* it needs an LI card to make sure it is not                 &lt;br /&gt;* interpreted as a binary variable                 &lt;br /&gt;&lt;/em&gt;&lt;font style="background-color: #ffff00"&gt;LI bnd&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; x&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0                &lt;br /&gt;&lt;/font&gt;FR bnd&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; z               &lt;br /&gt;ENDATA               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This LI card is missing from the GLPSOL and Solver Foundation generated files. The rule is: if no bounds are specified, an integer variable has default bounds 0 and 1. Obviously this will change the meaning of the model.&lt;/p&gt;  &lt;p&gt;Note: In GAMS by default all integer variables have a finite upper bound, so no problem there. It is possible (with some effort) to create a model with +INF bounds on integer variables (using PF4=0 command line option). It turns out that with such a model, the tool &lt;a href="www.gams.com/dd/docs/solvers/convert.pdf"&gt;CONVERT&lt;/a&gt; (this tool can write MPS files), produces an MPS file with the same error. Admittedly somewhat contrived, but not correct anyway.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1774782970643117083?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1774782970643117083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mps-files.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1774782970643117083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1774782970643117083'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mps-files.html' title='MPS files'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-321296204809159219</id><published>2011-10-16T20:31:00.001-04:00</published><updated>2011-10-17T05:24:11.320-04:00</updated><title type='text'>Sorting by MIP</title><content type='html'>&lt;p&gt;Here is a toy model that illustrates that certain models are poorly suited for solving by MIP solvers. &lt;/p&gt;  &lt;p&gt;Sorting data is a rather elementary operation. Surprisingly, GAMS has nothing built in for this. There is an external tool for sorting (&lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2008/08/gdxrank-help.html"&gt;gdxrank&lt;/a&gt;), but in some environments (e.g. NEOS) this is not allowed. There are some slower &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/sorting-in-gams.html"&gt;GAMS coding tricks that can help&lt;/a&gt;. Of course we can also write a simple MIP model that performs sorting:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="623"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="621"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9pt"&gt;$ontext                    &lt;br /&gt;                    &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;i&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;mip model for sorting&lt;/font&gt;                     &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; i &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/i1*i100/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; p(i) &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&amp;quot;original data&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;                    &lt;br /&gt;p(i) = uniform(0,1);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; (i,j);&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;binary&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variable&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; x(i,j) &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&amp;quot;permutation matrix&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variable&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; y(i) &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;&amp;quot;sorted version of p&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variable&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; z;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;dummy&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&amp;quot;dummy objective&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;assign1&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&amp;quot;assignment constraint&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;assign2&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&amp;quot;assignment constraint&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;ydef&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&amp;quot;y is permuted version of x&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;sort&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;&amp;quot;require y to be sorted&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000" face="Consolas"&gt;;                  &lt;br /&gt;                  &lt;br /&gt;dummy.. z =e= 0;                   &lt;br /&gt;                  &lt;br /&gt;assign1(i).. &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(j, x(i,j)) =e= 1;                    &lt;br /&gt;assign2(j).. &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(i, x(i,j)) =e= 1;                    &lt;br /&gt;ydef(i)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;y(i) =e= &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(j, x(i,j)*p(j));                    &lt;br /&gt;sort(i+1)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;y(i+1) =g= y(i);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/all/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m minimizing z using mip;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#800000" face="Consolas"&gt;&amp;quot;-----------------------------------------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;,                    &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#800000"&gt;&amp;quot;Results&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;,                    &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#800000"&gt;&amp;quot;-----------------------------------------------------------------------&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt;,                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;p,y.l;&lt;/font&gt;&lt;/font&gt;               &lt;br style="mso-special-character: line-break" /&gt;              &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This is quite slow however. n=100 is no problem, but n&amp;gt;200 will require significant time (&amp;gt;1000 seconds). Constraints &lt;strong&gt;assign1&lt;/strong&gt; and &lt;strong&gt;assign2&lt;/strong&gt; form an assignment problem, which is easy to solve. The simple extension will cause relaxation based MIP solvers to slow down enormously. Obvious question: are there better formulations? I would guess constraint programming solvers would do better on this.&lt;/p&gt;  &lt;p&gt;For some instances Gurobi is doing very good, probably because of its excellent heuristics. But this is not the case for all instances: in some cases it is just as slow as other solvers.&lt;/p&gt;  &lt;p&gt;The above model contains two noteworthy modeling tricks:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a dummy objective so that we stop after the first integer solution is found &lt;/li&gt;    &lt;li&gt;the equation &lt;strong&gt;sort&lt;/strong&gt; is indexed over &lt;em&gt;i+1&lt;/em&gt; so that the last one is not generated: this equation has &lt;em&gt;card(i)−1&lt;/em&gt; members. &lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-321296204809159219?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/321296204809159219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/sorting-by-mip.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/321296204809159219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/321296204809159219'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/sorting-by-mip.html' title='Sorting by MIP'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6493854942475399980</id><published>2011-10-16T01:22:00.001-04:00</published><updated>2011-10-17T17:28:49.509-04:00</updated><title type='text'>MIQP: optimality tolerances vs objective scaling</title><content type='html'>&lt;p&gt;I was working on a MIQP model in finance: the optimal allocation of contracts to client accounts so that each client observes an average price that is as &lt;a href="http://www.nfa.futures.org/nfamanual/NFAManual.aspx?RuleID=9029&amp;amp;Section=9"&gt;close as possible to the average contract price&lt;/a&gt;. The model was implemented in Solver Foundation (for the client) and GAMS (for prototyping).&lt;/p&gt;  &lt;p&gt;With one data set we observed Gurobi was giving slightly sub-optimal solutions. I.e. the obj was 1.396560E-5 instead of the number found by other solvers: 0. Most likely this is a tolerance problem. I tried the optimality tolerance (from 1e-6 to 1e-8 and 1e-9) but that did not help. That option is just for the LP/QP subproblems. What actually did the trick was multiplying the objective by a 1000:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="616"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="614"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Goals[Minimize[&amp;quot;Objective&amp;quot;-&amp;gt;              &lt;br /&gt;&amp;#160;&amp;#160; 1000*Sum[{a,accounts}, (PriceAlloc[a]-AvgPrice)^2]               &lt;br /&gt;]],&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Apparently this is not scaled away (somewhat to my surprise), allowing us to convey the solver not to stop too early. &lt;/p&gt;  &lt;p&gt;I also checked: reset the relative gap tolerance to 0 from its default of 1.0e-4. In the GAMS and Solver Foundation version of the model this did not help.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Update:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;On some new data sets we still see somewhat unstable behavior: different solutions with different objs by just reordering data.&lt;/li&gt;    &lt;li&gt;Gurobi solves KKT conditions, so may need to tighten feasibility tolerance. This helps somewhat, but not completely. Question: I suppose this introduces some danger of declaring models infeasible.&lt;/li&gt;    &lt;li&gt;I get better stability when formulated as a MIP (using an absolute value formulation).&lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6493854942475399980?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6493854942475399980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/miqp-optimality-tolerances-vs-objective.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6493854942475399980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6493854942475399980'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/miqp-optimality-tolerances-vs-objective.html' title='MIQP: optimality tolerances vs objective scaling'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4802119867552341224</id><published>2011-10-04T12:40:00.001-04:00</published><updated>2011-10-07T00:21:48.824-04:00</updated><title type='text'>Solving a large sparse system of equations with an LP solver</title><content type='html'>&lt;p&gt;When we want to solve a large, sparse system of linear equations&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-DWapKUH7vH0/Tos3rgGMkfI/AAAAAAAAAv0/O1mdWsS2fRo/s1600-h/image%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-l1WTmLMxWDM/Tos3sKPVArI/AAAAAAAAAv4/mSA-b1WVlxA/image_thumb.png?imgmax=800" width="146" height="83" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;using an LP solver we expect this to be reasonably fast. After all, solving systems of equations is what an LP solver does all the time. So we introduce a zero objective and solve. With Gurobi a sample problem gives:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="646"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="644"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Starting Gurobi...              &lt;br /&gt;Optimize a model with 9801 rows, 9801 columns and 48609 nonzeros               &lt;br /&gt;Presolve removed 4599 rows and 4599 columns               &lt;br /&gt;Presolve time: 0.06s               &lt;br /&gt;Presolved: 5202 rows, 5202 columns, 47242 nonzeros&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Iteration&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Primal Inf.&amp;#160;&amp;#160;&amp;#160; Dual Inf.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Time              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; handle free variables&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0s               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 3958&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; handle free variables&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5s               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 4975&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; handle free variables&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 11s               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 5199&amp;#160;&amp;#160;&amp;#160; 0.0000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 25s               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 5199&amp;#160;&amp;#160;&amp;#160; 0.0000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160;&amp;#160;&amp;#160; 25s&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;&lt;font style="background-color: #ffff00"&gt;Solved in 5199 iterations and 25.19 seconds&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Actually we can much improve on this. By specifying an advanced basis. We know the equations (slacks) will be non-basic in the solution and all the variables will be basic. If we set up an advanced basis for this we see for the same problem:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="645"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="643"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Starting Gurobi...              &lt;br /&gt;Optimize a model with 9801 rows, 9801 columns and 48609 nonzeros               &lt;br /&gt;Iteration&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Primal Inf.&amp;#160;&amp;#160;&amp;#160; Dual Inf.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Time               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160; 0.0000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160; 0.000000e+00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0s&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font style="background-color: #ffff00" face="Consolas"&gt;Solved in 0 iterations and 0.45 seconds&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Indeed no simplex iterations were needed: just an invert.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Update&lt;/h3&gt;  &lt;p&gt;In response to a comment about Octave: that is still faster:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="642"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="640"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;octave-3.2.4.exe:3&amp;gt; tmp=load(&amp;quot;-ascii&amp;quot;,&amp;quot;mat.txt&amp;quot;);              &lt;br /&gt;octave-3.2.4.exe:4&amp;gt; b=load(&amp;quot;-ascii&amp;quot;,&amp;quot;rhs.txt&amp;quot;);               &lt;br /&gt;octave-3.2.4.exe:5&amp;gt; a=sparse(tmp(:,1),tmp(:,2),tmp(:,3));               &lt;br /&gt;octave-3.2.4.exe:6&amp;gt; nnz(a)               &lt;br /&gt;ans =&amp;#160; 48609               &lt;br /&gt;octave-3.2.4.exe:7&amp;gt; tic();x=a\b;toc()               &lt;br /&gt;Elapsed time is 0.057 seconds.               &lt;br /&gt;octave-3.2.4.exe:8&amp;gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Notes:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Not completely fair of course: the LP solver does still a lot of extra things (scaling, pricing etc.). &lt;/li&gt;    &lt;li&gt;Note that I used a sparse matrix in Octave. Not sure what method they use to solve this system.&lt;/li&gt;    &lt;li&gt;This was a structured test matrix: see: &lt;a title="http://www.public.iastate.edu/~akmitra/aero361/design_web/Laplace.pdf" href="http://www.public.iastate.edu/~akmitra/aero361/design_web/Laplace.pdf"&gt;http://www.public.iastate.edu/~akmitra/aero361/design_web/Laplace.pdf&lt;/a&gt;. For more unstructured matrices Gurobi may do much better relative to Octave.&lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4802119867552341224?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4802119867552341224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/solving-large-sparse-system-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4802119867552341224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4802119867552341224'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/solving-large-sparse-system-of.html' title='Solving a large sparse system of equations with an LP solver'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-l1WTmLMxWDM/Tos3sKPVArI/AAAAAAAAAv4/mSA-b1WVlxA/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6169315682158622243</id><published>2011-10-03T13:41:00.001-04:00</published><updated>2011-10-03T19:19:18.499-04:00</updated><title type='text'>MIP caveats</title><content type='html'>&lt;p&gt;In &lt;a href="http://www.or-exchange.com/questions/3316/metrics-rules-of-thumb-tool-support-to-assess-mip-models"&gt;http://www.or-exchange.com/questions/3316/metrics-rules-of-thumb-tool-support-to-assess-mip-models&lt;/a&gt; a number of caveats when doing MIP modeling are listed:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;All 0 objective&lt;/strong&gt;: although it should be easier to find any solution than one specific, in certain situations it might pay off to add a fake objective function to guide the search. Anything reasonably stable should work and preferable all variables would have different objective coefficients. This sometimes works, sometimes not. I guess it also has to do with the fact that solvers usually detect this and do something about it. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Unstable objective&lt;/strong&gt;: Very big and very small coefficients in the objective function, especially values below the dual tolerance, can cause issues with dual feasibility and very unexpected results. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;One or few objective coeffcients&lt;/strong&gt;: One can observe that MIP solvers have trouble solving instances with only one (or a few) non-zeros in the objective function. At least part of the problems with these models is dual degeneracy. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Point 1: I am not sure about this one. With Obj=0 we really want to stop as soon as a feasible integer solution is found. With an obj&amp;lt;&amp;gt;0 this is no longer the case (or am I misreading this; may be additionally the stopping criterion “stop after first feasible solution” is implied). I don’t have many MIPs without an objective (and first integer solution found is not always very good), so my experience is limited. Somehow I feel this would need more empirical evidence.&lt;/p&gt;  &lt;p&gt;Point 2: agreed. E.g. with long planning horizons (like in forestry models) some of the reduced cost can become very small. Playing with LP optimality tolerances can help in such cases (I usually don’t want to touch those, but this is an exception).&lt;/p&gt;  &lt;p&gt;Point 3: I don’t understand that completely. I have many MIPs with very few cost coefficients (often just one: e.g. max profit). I have seen cases where small “random” obj coefficients can help to break symmetry and force solutions to be different. But that is different than is described here.&lt;/p&gt;  &lt;p&gt;I.e. in general these are not the problem areas I would quickly consider if I have a difficult MIP. Either this user has access to different solvers than I do or he is solving different types of models. Or both.&lt;/p&gt;  &lt;p&gt;Anyway, it is interesting to see I have such a different experience about problem areas in MIP modeling. I also think that many “older” tricks (such as I mentioned under point 3, another one is using priorities) are more and more becoming obsolete due to smarter and more sophisticated MIP solvers. I have a few “old” models with some tuning tricks, that really nowadays solve faster without all the tricks.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6169315682158622243?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6169315682158622243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mip-caveats.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6169315682158622243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6169315682158622243'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mip-caveats.html' title='MIP caveats'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-7375137228452055185</id><published>2011-10-02T18:25:00.001-04:00</published><updated>2011-10-06T20:20:27.512-04:00</updated><title type='text'>Ateji defunct: OptimJ now free</title><content type='html'>&lt;p&gt;Unfortunately, the company Ateji has ceased to operate (&lt;a href="http://www.ateji.com/blog/ateji-is-closed/"&gt;http://www.ateji.com/blog/ateji-is-closed/&lt;/a&gt;, &lt;a href="http://www.ateji.com/"&gt;http://www.ateji.com/&lt;/a&gt;). They had an interesting modeling framework based on Java. &lt;/p&gt;  &lt;p&gt;Sometimes I divide modeling tools up as follows:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Matrix generators: write LP or MPS file from application. This is done since the very early times. The main difference is that Fortran is no longer the obvious choice for programming language to use. &lt;/li&gt;    &lt;li&gt;Specialized modeling languages: AMPL, GAMS, … &lt;/li&gt;    &lt;li&gt;Low level solver APIs. This is essentially like writing a matrix generator, minus the part where you write a file. In many cases the solver API can help a little bit by providing routines like addrow() and addcol(). &lt;/li&gt;    &lt;li&gt;Hybrids, somewhere between 2 and 3, where modeling constructs are added to traditional programming languages. E.g. Cplex Concert, and OptimJ. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I suspect that OptimJ is mainly attractive for the intersection of the set of Java programmers and the set of modelers of optimization models. Besides that this subset may be somewhat small (many modelers are not proficient Java programmers), there is also a lot of competition targeting this particular group of users.&lt;/p&gt;  &lt;p&gt;I believe that some of the more complex data issues in practical modeling are often better (i.e. more efficiently) dealt with in a specialized language than in a traditional programming language. In statistics this has largely been accepted. Much statistical work is done inside specialized “language” environments such as SAS, SPSS and Stata. In optimization this is not (yet) the case: the lower level APIs still have a large following. This while data is often more irregular in practical optimization than in statistics. Of course much statistical computing is done “off-line” so the integration issues that plague modeling languages are just not there.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-7375137228452055185?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/7375137228452055185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/ateji-defunct-optimj-now-free.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7375137228452055185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7375137228452055185'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/ateji-defunct-optimj-now-free.html' title='Ateji defunct: OptimJ now free'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-580014002525614893</id><published>2011-10-02T17:57:00.001-04:00</published><updated>2011-10-02T18:33:11.855-04:00</updated><title type='text'>Integer cuts</title><content type='html'>&lt;p&gt;I received a few questions about how to form constraints that exclude a known 0-1 integer solution. Assume our solution we want to exclude is called &lt;em&gt;y&lt;sup&gt;* &lt;/sup&gt;&lt;/em&gt;then we can write:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-GvaT-el9Csc/TojmoC6rvuI/AAAAAAAAAvc/8Ra9n54oynw/s1600-h/image%25255B21%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-vVScttzFiFs/TojmoWih-lI/AAAAAAAAAvg/Vxv5hjatV6o/image_thumb%25255B11%25255D.png?imgmax=800" width="179" height="72" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This can be linearized as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-KT8eybIcJRo/TojmogGY8JI/AAAAAAAAAvk/tOpdGdBxOYs/s1600-h/image%25255B10%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-T8ioV36rda4/TojmpB5jdkI/AAAAAAAAAvo/QMdt8DO7tqw/image_thumb%25255B4%25255D.png?imgmax=800" width="355" height="285" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The final result is also sometimes written as the following constraint:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-4EV4K-IbrcU/TojmpbRW7RI/AAAAAAAAAvs/NjPnmdYukxU/s1600-h/image%25255B17%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-A8GWOwq4O7c/TojmpjC4LMI/AAAAAAAAAvw/6DmLkV4hjcE/image_thumb%25255B7%25255D.png?imgmax=800" width="414" height="97" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that y is a binary decision variable.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-580014002525614893?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/580014002525614893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/integer-cuts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/580014002525614893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/580014002525614893'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/integer-cuts.html' title='Integer cuts'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-vVScttzFiFs/TojmoWih-lI/AAAAAAAAAvg/Vxv5hjatV6o/s72-c/image_thumb%25255B11%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6226262862909992216</id><published>2011-09-22T06:27:00.001-04:00</published><updated>2011-09-23T17:27:35.901-04:00</updated><title type='text'>Most popular programming languages</title><content type='html'>&lt;p&gt;&lt;a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html"&gt;http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html&lt;/a&gt;. I never know how to interpret these things exactly. May be the trends are more important than the absolute positions.&lt;/p&gt;  &lt;p&gt;Some of my impressions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Fortran did not make the top 20, event though some people are still using it: &lt;a href="http://www.intelligenceinsoftware.com/feature/expert_insight/programming_languages_fortran/"&gt;http://www.intelligenceinsoftware.com/feature/expert_insight/programming_languages_fortran/&lt;/a&gt;. (I only use Fortran occasionally mostly when the client has some legacy code, or if I found some good old numerical routine).&lt;/li&gt;    &lt;li&gt;Pascal is at 12. I still use Delphi regularly, and the latest version seems to hold some promise: &lt;a href="http://www.embarcadero.com/products/delphi"&gt;http://www.embarcadero.com/products/delphi&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;I am somewhat surprised at &lt;a href="http://en.wikipedia.org/wiki/D_(programming_language)"&gt;D&lt;/a&gt; at 20. Also &lt;a href="http://en.wikipedia.org/wiki/Lua_(programming_language)"&gt;Lua&lt;/a&gt; is higher than I would suspect. &lt;/li&gt;    &lt;li&gt;Many of the top 20 languages are interpreted (e.g. via some byte code) opposed to targeting bare bones machine code.&lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6226262862909992216?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6226262862909992216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/most-popular-programming-languages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6226262862909992216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6226262862909992216'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/most-popular-programming-languages.html' title='Most popular programming languages'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1376516109109946306</id><published>2011-09-20T04:30:00.001-04:00</published><updated>2011-09-22T06:18:58.520-04:00</updated><title type='text'>Time schedules</title><content type='html'>&lt;p&gt;Here is a good example how a web based rostering system can look like: &lt;a href="http://www.timeforge.com"&gt;http://www.timeforge.com&lt;/a&gt;. The videos at &lt;a href="http://www.timeforge.com/manual/video-manual/"&gt;http://www.timeforge.com/manual/video-manual/&lt;/a&gt; are an easy way to see how this all works. &lt;/p&gt;  &lt;p&gt;They are in fact using MIPs in some of their algorithms!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1376516109109946306?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1376516109109946306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/time-schedules.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1376516109109946306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1376516109109946306'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/time-schedules.html' title='Time schedules'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3145859496948384176</id><published>2011-09-19T19:37:00.001-04:00</published><updated>2011-09-22T06:16:37.744-04:00</updated><title type='text'>Cplex MIP and time limits</title><content type='html'>&lt;p&gt;Looks like Cplex tries to do something smart just before it hits a time limit: see the logs in &lt;a href="http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14684289&amp;amp;tstart=0#14684289"&gt;http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14684289&amp;amp;tstart=0#14684289&lt;/a&gt;. In there you see that the gap is reduced just before the time limit kicks in, almost independent of the value of the time limit itself.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-Rv3k7EXPshw/TnfSOZjYmRI/AAAAAAAAAuM/V9xjdb5lFXw/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-Sia4FZO3UQc/TnfSOwsGjOI/AAAAAAAAAuQ/BD2j6D_DcYI/image_thumb%25255B1%25255D.png?imgmax=800" width="451" height="242" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Above: run with 100 seconds time limit and below: 1000 seconds time limit.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-qo2pD9GVc-g/TnfSPF_sb5I/AAAAAAAAAuU/eDEPBgcWLtI/s1600-h/image%25255B7%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-Fy7Yg-7tL64/TnfSPtu7sLI/AAAAAAAAAuY/2X8qwhjz-N8/image_thumb%25255B3%25255D.png?imgmax=800" width="457" height="246" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You would almost think it would be beneficial for Cplex to have this end-of-time behavior every now and then. &lt;/p&gt;  &lt;p&gt;Note: these runs are on one thread (thus hopefully deterministic – may be apart from the exact iteration number where the time limit kicks in). The statement “The answer to this is an implementational detail: when you use time limits, the solving process becomes non-deterministic close to the end of the time limit.” does not completely satisfy me. I would like to have a better understanding about what is happening here.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3145859496948384176?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3145859496948384176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/cplex-mip-and-time-limits.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3145859496948384176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3145859496948384176'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/cplex-mip-and-time-limits.html' title='Cplex MIP and time limits'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-Sia4FZO3UQc/TnfSOwsGjOI/AAAAAAAAAuQ/BD2j6D_DcYI/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8582659979292810389</id><published>2011-09-19T05:49:00.001-04:00</published><updated>2011-09-19T05:49:25.230-04:00</updated><title type='text'>GPU computing on Amazon cloud</title><content type='html'>&lt;p&gt;May be this can help bringing parallel computation on GPUs to business applications:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Dear Amazon Web Services Customer,&lt;/p&gt;    &lt;p&gt;We are excited to announce that starting today you can run Microsoft Windows Server 2008 R2 and Microsoft Windows SQL Server Standard 2008 R2 on Cluster Compute and Cluster GPU instances for Amazon EC2. Cluster Compute Instances provide customers with high CPU capability within a high bandwidth, low latency network for IO intensive computing. Cluster GPU instances allow customers to additionally take advantage of NVidia Tesla GPUs for general purpose GPU (GPGPU) computing using the CUDA or OpenCL programming models. A number of customers with database workloads and applications in areas such as media processing, rendering, and computational finance, have expressed interest in running Microsoft Windows Server on the most powerful Amazon EC2 instances. Starting today, customers can run applications on Microsoft Windows Server across all Amazon EC2 instance types.     &lt;br /&gt;Cluster Compute and Cluster GPU instances are currently available in the US-East (N. Virginia) region. For more information, please visit &lt;a href="http://www.amazon.com/gp/r.html?R=RYYC2OVANJW3&amp;amp;C=1EIUMI7B6S75J&amp;amp;H=FH61SDG4KQSMEQ2DOIFKWEKUJNYA&amp;amp;T=C&amp;amp;U=http%3A%2F%2Faws.amazon.com%2Fec2%3Fref_%3Dpe_12300_21176300"&gt;http://aws.amazon.com/ec2&lt;/a&gt; and&lt;a href="http://www.amazon.com/gp/r.html?R=RYYC2OVANJW3&amp;amp;C=1EIUMI7B6S75J&amp;amp;H=S2XSA3AN2ANAMVNBIHCNR4SKZXGA&amp;amp;T=C&amp;amp;U=http%3A%2F%2Faws.amazon.com%2Fwindows%3Fref_%3Dpe_12300_21176300"&gt;http://aws.amazon.com/windows&lt;/a&gt;.&lt;/p&gt;    &lt;p&gt;Sincerely,     &lt;br /&gt;The Amazon EC2 Team&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8582659979292810389?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8582659979292810389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/gpu-computing-on-amazon-cloud.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8582659979292810389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8582659979292810389'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/gpu-computing-on-amazon-cloud.html' title='GPU computing on Amazon cloud'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4859712459830418990</id><published>2011-09-13T09:29:00.001-04:00</published><updated>2011-09-13T13:57:56.718-04:00</updated><title type='text'>Big-M and Scaling</title><content type='html'>&lt;p&gt;I was working on a client MIP model that showed strange behavior: with Cplex and Mosek optimal values were found while Gurobi and Xpress reported the model to be infeasible. There were a few Big-M values in the model, in equations like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-SVYvW0BfRE4/Tm9ao8toWPI/AAAAAAAAAuE/eYSW5ANwqyw/s1600-h/Capture5%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="Capture5" border="0" alt="Capture5" src="http://lh4.ggpht.com/-bPgcLo4aD1U/Tm9apd0j9CI/AAAAAAAAAuI/laf5PXlGB1U/Capture5_thumb.png?imgmax=800" width="173" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Some of the big M values were very large e.g. 99999999. The actual value of this M should be equal to the upper bound of x. Unfortunately x can assume very large values, something like $100,000,000. This meant we could only reduce the big M values by a small amount. With some trial and error we found some big M values that worked. Of course this was just a band-aid solution.&lt;/p&gt;  &lt;p&gt;In the end we chose to scale the model by changing units for x. Instead of $ we now use millions of $. As a result the new big M values can just be M=100. As the model was rather complex we needed to spend half a day on this exercise. After this work, the model solved with all solvers without a problem.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4859712459830418990?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4859712459830418990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/big-m-and-scaling.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4859712459830418990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4859712459830418990'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/big-m-and-scaling.html' title='Big-M and Scaling'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-bPgcLo4aD1U/Tm9apd0j9CI/AAAAAAAAAuI/laf5PXlGB1U/s72-c/Capture5_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1513636639791265702</id><published>2011-09-06T17:29:00.001-04:00</published><updated>2011-09-06T20:38:37.751-04:00</updated><title type='text'>Open source MIP solvers</title><content type='html'>&lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Hi Erwin,        &lt;br /&gt;I have a 2 questions, could you please point me into a good direction?&lt;/em&gt;&lt;/p&gt;   &lt;em&gt;     &lt;p&gt;       &lt;br /&gt;1. Which open source optimization solver do you recommend? (One that can withstand a large and complex problem)         &lt;br /&gt;I've been researching online and I've come across with lpsolve, coin-or lp (CLP), and GLPK.&lt;/p&gt;      &lt;p&gt;       &lt;br /&gt;2. I've been having a really tough time to get GLPK to work. I'm new to this field of open source software but I've found out that I need an interface from where I should call the GLPK library. My question is, which application (or interface) should I use?         &lt;br /&gt;&lt;/p&gt;      &lt;p&gt;Thanks in advance!&lt;/p&gt;   &lt;/em&gt;&lt;/blockquote&gt;  &lt;p&gt;CBC (&lt;a href="https://projects.coin-or.org/Cbc"&gt;https://projects.coin-or.org/Cbc&lt;/a&gt;) seems to be the fastest open source MIP solver (see &lt;a href="http://plato.asu.edu/ftp/milpc.html"&gt;http://plato.asu.edu/ftp/milpc.html&lt;/a&gt;). The academic code SCIP is also quite good but is not open source (it requires a license for any non-academic application). Of course the commercial codes are often (much) faster.&lt;/p&gt;  &lt;p&gt;The GLPK API is simpler to use than CBC however. &lt;/p&gt;  &lt;p&gt;In general I would say the low level solver API are often not a good idea to use for larger, more complex models. For those a modeling language is often more appropriate.&amp;#160; &lt;/p&gt;  &lt;p&gt;You may want to consider making your application solver independent. Then you can pick the solver most suited for the occasion. Again this is most easily done using a modeling framework.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1513636639791265702?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1513636639791265702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/open-source-mip-solvers.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1513636639791265702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1513636639791265702'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/open-source-mip-solvers.html' title='Open source MIP solvers'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-5236453051065604430</id><published>2011-09-06T00:26:00.001-04:00</published><updated>2011-09-06T02:31:25.885-04:00</updated><title type='text'>Implementing Parsers</title><content type='html'>&lt;p&gt;During my transatlantic flight I was reading &lt;/p&gt;  &lt;p&gt;&lt;img src="http://ecx.images-amazon.com/images/I/51c1qdl81VL._SL500_AA300_.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;Although it was a good read I expected a little bit more info about implementing funky languages and some advice about that. Actually this book is largely about parsing (parsing using the ANTRL parser generator to be more precise) and largely about traditional programming languages.&lt;/p&gt;  &lt;p&gt;I usually write simple recursive-descent parsers directly (i.e. without the aid of a parser generator) as typically I only parse very simple things. in addition I feel a little more sure-footed this way as I have a little bit more control to handle an occasional dirty thing. So this is a little bit outside my direct interest. However, I learned a bit about memoizing parsers, a term I was not yet familiar with. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-5236453051065604430?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/5236453051065604430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/implementing-parsers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5236453051065604430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5236453051065604430'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/09/implementing-parsers.html' title='Implementing Parsers'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3546051619539000024</id><published>2011-08-22T17:10:00.001-04:00</published><updated>2011-08-22T17:18:21.286-04:00</updated><title type='text'>More on network models (2)</title><content type='html'>&lt;p&gt;Re: &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;What if you go bigger? Here some results with two of the leading commercial LP solvers (using default settings) compared to GAMS:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-UU7AtT1S0YU/TlLFxnT1YWI/AAAAAAAAAts/CV5Joc6uPYc/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-C-41Tinuggo/TlLFyWYy7-I/AAAAAAAAAtw/kyIAK_74Gfk/image_thumb%25255B1%25255D.png?imgmax=800" width="658" height="368" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;LP solution times are a little bit more unpredictable (in this case this is positive: somewhat quicker than thought by extrapolating from first picture in &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html"&gt;more-on-network-models.html&lt;/a&gt;), but GAMS execution time (including generation time) is still nicely linear.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3546051619539000024?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3546051619539000024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3546051619539000024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3546051619539000024'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models-2.html' title='More on network models (2)'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-C-41Tinuggo/TlLFyWYy7-I/AAAAAAAAAtw/kyIAK_74Gfk/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-5641514808529534917</id><published>2011-08-22T10:36:00.001-04:00</published><updated>2011-08-22T19:03:57.288-04:00</updated><title type='text'>Shipping problem</title><content type='html'>&lt;p&gt;I am starting to work on a problem that looks like a shipping problem I worked on earlier: garments (shirts) are sent from China to stores in the US either directly in a number of packages containing standard contents or through a US warehouse. The cheapest is to send the standard boxes from China but as there are just a few standard configurations, stores will need to be supplied with additional shirts from the US warehouse. Shirts come in different sizes. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/--dNYzH-Y-TE/TlLgWhWhaCI/AAAAAAAAAt0/04bZAGrEtCQ/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-xbZO9vc1hxM/TlLgXBhCjII/AAAAAAAAAt4/RDUupTN4GhY/image_thumb%25255B1%25255D.png?imgmax=800" width="644" height="417" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The basic model looked like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-53yIjKUMxYc/TlKR2aURWxI/AAAAAAAAAtk/lBNkffsJMxc/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-l6O8eZ115xI/TlKR26C1I_I/AAAAAAAAAto/L1MMhfI8cXM/image_thumb%25255B1%25255D.png?imgmax=800" width="744" height="302" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;All quantities with bars are parameters (constants). Even though this is a simple model it was not completely trivial to get good solutions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The model as presented is an MINLP. We linearized to make it a MIP. &lt;/li&gt;    &lt;li&gt;The data set was rather large because of a large number of stores. &lt;/li&gt;    &lt;li&gt;We could preprocess the demand data as some stores have the same demand; this reduced the size by about a third. We added weights to the objective to represent how many times a demand pattern was used. &lt;/li&gt;    &lt;li&gt;In practice over-supplying a store was expensive, so we can fix OverShipped(Store,Size)=0. &lt;/li&gt;    &lt;li&gt;It was not practical to solve this model in one swoop. We found good solutions by first finding a good content for a single standard box, and then (after fixing the content of this first box) finding a good proposal for a second standard box. Adding more standard boxes was not reducing the objective by much. &lt;/li&gt;    &lt;li&gt;The set sizes can also include other attributes such as color etc. &lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-5641514808529534917?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/5641514808529534917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/shipping-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5641514808529534917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5641514808529534917'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/shipping-problem.html' title='Shipping problem'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-xbZO9vc1hxM/TlLgXBhCjII/AAAAAAAAAt4/RDUupTN4GhY/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4981411810066244095</id><published>2011-08-15T13:55:00.001-04:00</published><updated>2011-08-15T16:18:38.698-04:00</updated><title type='text'>Bin Packing</title><content type='html'>&lt;p&gt;For pure bin packing problems some really good heuristics exist. For the problem illustrated in &lt;a href="http://www.developerfusion.com/article/5540/bin-packing/"&gt;http://www.developerfusion.com/article/5540/bin-packing/&lt;/a&gt; one of the best solutions is:&lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.developerfusion.com/res/content/5540/Best%20Fit/" /&gt;&lt;/p&gt;  &lt;p&gt;So if we solve to optimality, do we gain a lot? From &lt;a href="http://en.wikipedia.org/wiki/Bin_packing_problem"&gt;http://en.wikipedia.org/wiki/Bin_packing_problem&lt;/a&gt; is looks doubtful. Indeed when I solve:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="804"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="802"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9pt"&gt;$ontext                    &lt;br /&gt;                    &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9pt"&gt;&lt;i&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;Bin packing example&lt;/font&gt;                     &lt;br /&gt;                    &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;sets&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;b &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'bins' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/bin1*bin19/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;i &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'items' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/item1*item45/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;scalar&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; binsize &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/80/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; itemsize(i) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item1&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;26, item2&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;57, item3&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;18, item4&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;8, item5&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;45&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item6&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;16, item7&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;22, item8&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;29, item9&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;5, item10&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;11&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item11&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;8, item12&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;27, item13&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;54, item14&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;13, item15&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;17&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item16&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;21, item17&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;63, item18&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;14, item19&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;16, item20&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;45&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item21&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;6, item22&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;32, item23&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;57, item24&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;24, item25&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;18&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item26&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;27, item27&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;54, item28&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;35, item29&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;12, item30&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;43&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item31&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;36, item32&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;72, item33&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;14, item34&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;28, item35&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item36&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;11, item37&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;46, item38&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;27, item39&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;42, item40&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;59&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;item41&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;26, item42&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;41, item43&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;15, item44&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;41, item45&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;68&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000" face="Consolas"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;x(i,b)&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'assignment'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;y(b)&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'whether bin is used'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;z&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 10pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'count used bins'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;binary&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variable&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; x,y;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080"&gt;* relax y: automatically integer&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000" face="Consolas"&gt;y.prior(b) = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;INF&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;onebin(i)                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;cap(b)                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;binusd                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;obj                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;symmetry(b)                     &lt;br /&gt;;                     &lt;br /&gt;                    &lt;br /&gt;onebin(i)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(b, x(i,b)) =e= 1;                    &lt;br /&gt;cap(b)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(i, x(i,b)*itemsize(i)) =l= binsize;                    &lt;br /&gt;binusd(i,b)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;y(b) =g= x(i,b);                     &lt;br /&gt;obj..&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;z =e= &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(b, y(b));                    &lt;br /&gt;symmetry(b+1)..&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;y(b) =g= y(b+1);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m1 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/onebin,cap,binusd,obj/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m2 &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/onebin,cap,binusd,obj,symmetry/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; optcr=0;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: 10pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9pt" color="#000000"&gt; m1 minimizing z using mip;&lt;/font&gt;&lt;/font&gt;               &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;we get an optimal solution with 17 bins. &lt;/p&gt;  &lt;p&gt;Of course as discussed in &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/scheduling-of-tv-advertisement-theory.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/scheduling-of-tv-advertisement-theory.html&lt;/a&gt; my real models are almost always much more complicated than shown in these stylized bin packing examples. In those cases a MIP-based solution algorithm can be even more worthwhile than a (simple) heuristic as there is more room for improvement. In the real case we dealt with a complicated multi-objective model where our model seems to outperform the heuristic in almost all objectives. This is the case even after the heuristic was improved using some fine-tuning after looking at our solutions.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4981411810066244095?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4981411810066244095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/bin-packing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4981411810066244095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4981411810066244095'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/bin-packing.html' title='Bin Packing'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6226044617066981172</id><published>2011-08-01T16:52:00.001-04:00</published><updated>2011-08-15T13:17:31.914-04:00</updated><title type='text'>More on network models</title><content type='html'>&lt;p&gt;I received some additional questions on solving some very large network models. Basically we used the formulation presented here: &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html&lt;/a&gt;. A slightly more optimized version is shown below:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="924"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="922"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 8pt"&gt;$ontext                    &lt;br /&gt;                    &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 8pt"&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;large sparse max flow network example&lt;/font&gt;                     &lt;br /&gt;                    &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;Performance&lt;/font&gt;                     &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;nodes&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;arcs&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;gams&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;solver&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;execution&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;time&lt;/font&gt;                     &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;1k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;10k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.031&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.045&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;2k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;20k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.047&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.112&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;5k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;50k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.156&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.286&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;10k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;100k&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;0.343&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;1.125&lt;/font&gt;                     &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;Erwin Kalvelagen,&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#808080" face="Consolas"&gt;Amsterdam Optimization,&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Consolas"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;erwin@amsterdamoptimization.com&lt;/font&gt;                     &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;               &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;$offtext                    &lt;br /&gt;                    &lt;br /&gt;$set n 10000&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; limrow=0, limcol=0, solprint=off;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sets&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;i                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;source(i)                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;sink(i)                     &lt;br /&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff" face="Consolas"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(i,j);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; capacity(i,j) &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'capacity, but also defines network'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;                    &lt;br /&gt;                    &lt;br /&gt;$gdxin network%n%                     &lt;br /&gt;$loaddc i source sink capacity&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;abort&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;card&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(source)&amp;lt;&amp;gt;1) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#800000"&gt;&amp;quot;We want one source node&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;abort&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;card&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(sink)&amp;lt;&amp;gt;1) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#800000"&gt;&amp;quot;We want one sink node&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; arcs(i,j) &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'we have an arc if capacity&amp;lt;&amp;gt;0'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;                    &lt;br /&gt;arcs(i,j)$capacity(i,j) = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;yes&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;scalar&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; narcs &lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'number of arcs'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;                    &lt;br /&gt;narcs = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;card&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(arcs);&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; narcs;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; rhs(i);                    &lt;br /&gt;rhs(source) = -1;                     &lt;br /&gt;rhs(sink) = 1;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;x(i,j) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'flow along arcs'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;f&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'total flow'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;positive&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; x;                    &lt;br /&gt;x.up(arcs) = capacity(arcs);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;                &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;flowbal(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; line-height: 9pt; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Consolas"&gt;'flow balance' &lt;/font&gt;&lt;/span&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;                    &lt;br /&gt;                    &lt;br /&gt;flowbal(i)..                     &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(arcs(j,i), x(j,i)) - &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;(arcs(i,j), x(i,j)) =e= f*rhs(i);&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#008000"&gt;/flowbal/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                   &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#000000"&gt; m maximizing f using lp;&lt;/font&gt;                   &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="line-height: 9pt; font-family: ; color: ; mso-bidi-font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 8pt" color="#000000"&gt; f.l;&lt;/font&gt;&lt;/font&gt;               &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The performance of GAMS looks very good. GAMS execution time scales slightly better than the LP solver used to solve the problem:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-sAbl076pqg0/TjcSHirqiYI/AAAAAAAAAsc/TN2rJTMCqWQ/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-oU20h5MVkqk/TjcSH_MWOaI/AAAAAAAAAsg/gqpUPOc5csU/image_thumb%25255B1%25255D.png?imgmax=800" width="664" height="370" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;GAMS almost scales linearly with the number of nonzero elements to be generated. In this case that means linearly with the number of nodes (because the number of nonzeroes is equal to 10*nodes in these models). &lt;/p&gt;  &lt;p&gt;The main difference with the earlier model is that we replaced:&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;&lt;span style="line-height: normal; widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; border-collapse: separate; font-family: ; white-space: normal; orphans: 2; color: ; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="text-align: left; line-height: 16px; font-family: " class="Apple-style-span"&gt;&lt;font style="font-size: 9.8pt" face="Consolas"&gt;x.up(i,j) = capacity(i,j);&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 12pt"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Times New Roman"&gt;by&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;x.up(arcs) = capacity(arcs);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This actually saves some time and memory. In the first case we set many x.up’s to zero even though they are not used in the model. These variables with non-default bounds will need to be created and use up memory. In the second case, we only touch variables that are really used. &lt;/p&gt;  &lt;p&gt;This small change makes a lot of difference for larger models. For &lt;em&gt;n&lt;/em&gt;=5k we see GAMS execution time decrease from 3.775 seconds to 0.156 seconds. If things get large one needs to pay attention to detail!&lt;/p&gt;  &lt;h3&gt;AMPL Version&lt;/h3&gt;  &lt;p&gt;A direct translation to AMPL can look like:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="825"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="823"&gt;         &lt;p&gt;set nodes;            &lt;br /&gt;set source within nodes;             &lt;br /&gt;set sink within nodes;             &lt;br /&gt;param capacity {(i,j) in (nodes cross nodes)}, default 0;&lt;/p&gt;          &lt;p&gt;set arcs within (nodes cross nodes) := {i in nodes, j in nodes: capacity[i,j]}; # version 1 : slow calc of arcs            &lt;br /&gt;# set arcs := {i in nodes, j in nodes: capacity[i,j]};&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; # version 2 : slow calc of x             &lt;br /&gt;# set arcs within (nodes cross nodes);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; # version 3 : fast, read from data file &lt;/p&gt;          &lt;p&gt;param rhs{i in nodes} := if i in source then -1 else if i in sink then +1;&lt;/p&gt;          &lt;p&gt;var x {(i,j) in arcs} &amp;gt;= 0, &amp;lt;= capacity[i,j];            &lt;br /&gt;var f;&lt;/p&gt;          &lt;p&gt;maximize obj:f;&lt;/p&gt;          &lt;p&gt;subject to flowbal{i in nodes}:            &lt;br /&gt;&amp;#160;&amp;#160; sum{(j,i) in arcs} x[j,i] - sum{(i,j) in arcs} x[i,j] = f*rhs[i];             &lt;br /&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This formulation is not handled very efficiently by AMPL: the timings for n=5k are&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="827"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="825"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;##genmod times:              &lt;br /&gt;##seq&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; seconds&amp;#160;&amp;#160;&amp;#160; cum. sec.&amp;#160;&amp;#160;&amp;#160; mem. inc.&amp;#160; name               &lt;br /&gt;## 77&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; derstage               &lt;br /&gt;## 81&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; sstatus               &lt;br /&gt;## 95&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; nodes               &lt;br /&gt;## 96&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; source               &lt;br /&gt;## 97&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; sink               &lt;br /&gt;## 98&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; capacity               &lt;br /&gt;## 99&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4521&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4521&amp;#160;&amp;#160; 1146012664&amp;#160; arcs               &lt;br /&gt;## 100&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4521&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; rhs               &lt;br /&gt;## 101&amp;#160;&amp;#160;&amp;#160; 0.0156001&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4677&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 65544&amp;#160; x               &lt;br /&gt;## 103&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4677&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; f               &lt;br /&gt;## 105&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.4677&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; obj               &lt;br /&gt;## 107&amp;#160;&amp;#160;&amp;#160; 0.0624004&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.5301&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4148296&amp;#160; flowbal&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Especially the calculation of the set arcs is expensive. &lt;/p&gt;  &lt;p&gt;Note that if we use an alternative for arcs:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;set arcs := {i in nodes, j in nodes: capacity[i,j]};&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;the burden is moved to x:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="829"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="827"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;##genmod times:              &lt;br /&gt;##seq&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; seconds&amp;#160;&amp;#160;&amp;#160; cum. sec.&amp;#160;&amp;#160;&amp;#160; mem. inc.&amp;#160; name               &lt;br /&gt;## 77&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; derstage               &lt;br /&gt;## 81&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; sstatus               &lt;br /&gt;## 95&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; nodes               &lt;br /&gt;## 96&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; source               &lt;br /&gt;## 97&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; sink               &lt;br /&gt;## 98&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; capacity               &lt;br /&gt;## 99&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; arcs               &lt;br /&gt;## 100&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; rhs               &lt;br /&gt;## 101&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.5301&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.5301&amp;#160;&amp;#160; 1147323392&amp;#160; x               &lt;br /&gt;## 103&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.5301&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; f               &lt;br /&gt;## 105&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.5301&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160; obj               &lt;br /&gt;## 107&amp;#160;&amp;#160;&amp;#160; 0.0780005&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.6081&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4147928&amp;#160; flowbal&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;When we run a few different instances we see we do something causing non-linear scaling:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-26eE5_a1qgo/Tjm1rAIkKnI/AAAAAAAAAsk/3A4fzC7whNY/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-0nTQHQmjyUk/Tjm1rhFe6VI/AAAAAAAAAso/2y37MxaKRy8/image_thumb%25255B1%25255D.png?imgmax=800" width="717" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is clear this is not a good approach. We need to do something about this set arcs. In AMPL we don’t really need to calculate this set, we can directly populate this from the data by replacing in the data file:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="255"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="253"&gt;         &lt;p&gt;param: capacity :=            &lt;br /&gt;n1 n32 87             &lt;br /&gt;n1 n37 44             &lt;br /&gt;n1 n124 38             &lt;br /&gt;&lt;/p&gt; …&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;by&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="255"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="253"&gt;         &lt;p&gt;param: arcs : capacity :=            &lt;br /&gt;n1 n32 87             &lt;br /&gt;n1 n37 44             &lt;br /&gt;n1 n124 38             &lt;br /&gt;…&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Now we get the set arcs basically for free, and we get linear scaling:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-VDEkR5oDDH8/Tjm1r4JKZ0I/AAAAAAAAAss/oG5Bvssfd8Q/s1600-h/image%25255B11%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-e9N3dHeu_Hc/Tjm1sHVi7MI/AAAAAAAAAsw/6eFbFBr4uXI/image_thumb%25255B4%25255D.png?imgmax=800" width="717" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The total AMPL generation time vs. LP solution time is here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-QIN7PS-jaBM/Tjm7e6aFrXI/AAAAAAAAAs0/TLPecRzD6jY/s1600-h/image%25255B15%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-ERcnNmmulvQ/Tjm7fFlIUpI/AAAAAAAAAs4/A0MDfHnF7Wk/image_thumb%25255B6%25255D.png?imgmax=800" width="624" height="324" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is very close to the GAMS timings given that this was on a different machine.&lt;/p&gt;  &lt;h3&gt;GLPK&lt;/h3&gt;  &lt;p&gt;The open source tool GLPK can handle many AMPL linear models. However, in some cases it is substantial slower. This model demonstrates this behavior. We run the model as:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="862"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="860"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;timeit \Projects\glpk\glpk\bin\glpsol.exe -m network.mod -d network1000.dat&lt;/em&gt;               &lt;br /&gt;Reading model section from network.mod...               &lt;br /&gt;network.mod:24: warning: unexpected end of file; missing end statement inserted               &lt;br /&gt;24 lines were read               &lt;br /&gt;Reading data section from network1000.dat...               &lt;br /&gt;network1000.dat:10108: warning: unexpected end of file; missing end statement inserted               &lt;br /&gt;10108 lines were read               &lt;br /&gt;Generating obj...               &lt;br /&gt;Generating flowbal...               &lt;br /&gt;Model has been successfully generated               &lt;br /&gt;lpx_simplex: original LP has 1001 rows, 10001 columns, 20003 non-zeros               &lt;br /&gt;lpx_simplex: presolved LP has 1000 rows, 10001 columns, 20002 non-zeros               &lt;br /&gt;lpx_adv_basis: size of triangular part = 999               &lt;br /&gt;*&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0:&amp;#160;&amp;#160; objval =&amp;#160; 0.000000000e+000&amp;#160;&amp;#160; infeas =&amp;#160; 0.000000000e+000 (1)               &lt;br /&gt;*&amp;#160;&amp;#160; 171:&amp;#160;&amp;#160; objval =&amp;#160; 4.780000000e+002&amp;#160;&amp;#160; infeas =&amp;#160; 0.000000000e+000 (1)               &lt;br /&gt;OPTIMAL SOLUTION FOUND               &lt;br /&gt;Time used:&amp;#160;&amp;#160; 0.1 secs               &lt;br /&gt;Memory used: 13.4M (14073536 bytes)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Version Number:&amp;#160;&amp;#160; Windows NT 6.0 (Build 6002)              &lt;br /&gt;Exit Time:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0:32 am, Thursday, August 4 2011               &lt;br /&gt;Elapsed Time:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0:00:05.563               &lt;br /&gt;Process Time:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0:00:05.600               &lt;br /&gt;System Calls:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 160954               &lt;br /&gt;Context Switches: 89933               &lt;br /&gt;Page Faults:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20453               &lt;br /&gt;Bytes Read:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 248437               &lt;br /&gt;Bytes Written:&amp;#160;&amp;#160;&amp;#160; 87315               &lt;br /&gt;Bytes Other:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 130434&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Besides being much slower than AMPL, the performance of the model generation phase is showing more than linear scaling:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-OJvMHVhTPd8/Tjoj5H5947I/AAAAAAAAAs8/oQWDtdJresI/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-V1xGmvvFvkk/Tjoj5bFEuxI/AAAAAAAAAtA/fXdwLUzfmDs/image_thumb%25255B1%25255D.png?imgmax=800" width="598" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Model generation is here calculated as total elapsed time minus time used for the LP solver.&lt;/p&gt;  &lt;p&gt;My conclusions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;AMPL and GAMS are capable of generating simple network models faster than a good LP solver can solve them &lt;/li&gt;    &lt;li&gt;But a simple mistake and performance goes down the drain &lt;/li&gt;    &lt;li&gt;Direct translations between GAMS and AMPL models are not always a good idea. &lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6226044617066981172?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6226044617066981172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6226044617066981172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6226044617066981172'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/08/more-on-network-models.html' title='More on network models'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-oU20h5MVkqk/TjcSH_MWOaI/AAAAAAAAAsg/gqpUPOc5csU/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3983346400798370069</id><published>2011-07-28T00:06:00.001-04:00</published><updated>2011-07-28T00:50:17.028-04:00</updated><title type='text'>Scheduling of TV Advertisement: Theory vs Practice</title><content type='html'>&lt;p&gt;I am working on a model for scheduling TV advertisements. Looking at the paper: &lt;a title="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.37.292&amp;amp;rep=rep1&amp;amp;type=pdf" href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.37.292&amp;amp;rep=rep1&amp;amp;type=pdf"&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.37.292&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt; this is easy to model (but difficult to solve). My model seems at least 10 times as complicated than what this academic study suggests. We needed more complexity to deal with:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The number of spots to broadcast is not known in advance (depends on expected ratings of a break) &lt;/li&gt;    &lt;li&gt;There are complicated issues with spread over time &lt;/li&gt;    &lt;li&gt;There is a rather complex issue with the quality of the remaining unused space (this needs to be valued with respect to expected ratings and optimized) &lt;/li&gt;    &lt;li&gt;Different contracts have different requirements, and these requirements are not always easily modeled &lt;/li&gt;    &lt;li&gt;The model is huge (&amp;gt; 150K binary variables) for a monthly schedule &lt;/li&gt;    &lt;li&gt;The input data (from a database) is large and complex (this is sometimes called “data-intensive”)&lt;/li&gt;    &lt;li&gt;Numerous other things&lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3983346400798370069?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3983346400798370069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/scheduling-of-tv-advertisement-theory.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3983346400798370069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3983346400798370069'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/scheduling-of-tv-advertisement-theory.html' title='Scheduling of TV Advertisement: Theory vs Practice'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8476381434691662403</id><published>2011-07-21T13:39:00.001-04:00</published><updated>2011-07-21T16:04:26.895-04:00</updated><title type='text'>Pyomo</title><content type='html'>&lt;p&gt;For a thoughtful comment on the design of Python based modeling system see: &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/04/performance-of-python-based-modeling.html?showComment=1310240113570#c3299569615459362578"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/04/performance-of-python-based-modeling.html?showComment=1310240113570#c3299569615459362578&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;My assessment was clearly not convincing. To summarize: essentially the modeling framework Pyomo is a scalar system. This compares somewhat to the difference between AMPL and GLPK (&lt;a href="http://www.gnu.org/software/glpk/glpk.html"&gt;http://www.gnu.org/software/glpk/glpk.html&lt;/a&gt;). Both systems are written in C so we have taken out the language issue (i.e. Python is slow compared to C). The modeling system in GLPK (called Mathprog) is dense (except for the final generated matrix which is of course sparse). This actually work in many cases just fine: many sub-matrices used in the model are often small enough that dense handling is not really a problem. I have seen this in my practice: the majority of the models implemented in GLPK/Mathprog just work fine. Of course there are some models (the big sparse suckers) that bring GLPK/Mathprog on its knees while AMPL will happily generate the model very quickly. If I see this I generally suggest some reformulation or more often just give the advise: buy AMPL. &lt;/p&gt;  &lt;p&gt;I suspect this can also happen with Pyomo. For some models a simple dense/scalar structure where we iterate over the carthesian product of indices will not perform. Of course with a system like Pyomo the modeler has more possibilities to implement better data-structures so we can skip zeros quickly and efficiently. But that means we have moved the burden from modeling system to the modeler.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8476381434691662403?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8476381434691662403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/pyomo.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8476381434691662403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8476381434691662403'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/pyomo.html' title='Pyomo'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-551399829731186384</id><published>2011-07-21T12:48:00.001-04:00</published><updated>2011-07-21T12:48:26.364-04:00</updated><title type='text'>Patent Application</title><content type='html'>&lt;p&gt;One of my clients is applying for a patent on a model I helped them with. I am mentioned as co-inventor. That is mostly just an ego-booster I suspect, as this was work-for-hire. From what I understand the patent application is quite narrowly defined, so hopefully I am still able to use my bag of LP tricks for other clients.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-551399829731186384?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/551399829731186384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/patent-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/551399829731186384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/551399829731186384'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/patent-application.html' title='Patent Application'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8793559590300986362</id><published>2011-07-06T10:36:00.001-04:00</published><updated>2011-07-06T10:36:07.814-04:00</updated><title type='text'>Dashboards in Powerpoint</title><content type='html'>&lt;p&gt;I have built several “dashboards”&amp;#160; in Excel (e.g. &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2010/01/excel-reporting.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2010/01/excel-reporting.html&lt;/a&gt;), but here is a different approach: use Powerpoint.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://office.microsoft.com/en-us/support/interactive-dashboards-using-powerpoint-and-excel-HA102298884.aspx?redir=0"&gt;http://office.microsoft.com/en-us/support/interactive-dashboards-using-powerpoint-and-excel-HA102298884.aspx?redir=0&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8793559590300986362?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8793559590300986362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/dashboards-in-powerpoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8793559590300986362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8793559590300986362'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/dashboards-in-powerpoint.html' title='Dashboards in Powerpoint'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1962572785142089161</id><published>2011-07-05T18:49:00.001-04:00</published><updated>2011-07-05T18:51:54.403-04:00</updated><title type='text'>Min sum or min num</title><content type='html'>&lt;p&gt;In an advertisement model we may have to deal with underdelivery: the delivery of less impressions, visitors, &lt;a href="http://en.wikipedia.org/wiki/Gross_Rating_Point"&gt;GRPs&lt;/a&gt; than contractually agreed upon. So what to do. We can minimize the SUM of this quantity with the possible effect of many orders with small underdelivery numbers (spreading the pain). When minimizing the MAX this effect is even guaranteed. Or we can minimize the NUMber of orders with underdelivery.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-3NM1J9LpF9M/ThOU9poGSZI/AAAAAAAAAsU/BqQ9Z9xKNH4/s1600-h/image%25255B7%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-iyRpOUZ5_6U/ThOU-fIlrnI/AAAAAAAAAsY/vymEO-hm-IE/image_thumb%25255B3%25255D.png?imgmax=800" width="644" height="479" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In practice, a good approach is to minimize a linear combination of both the SUM and the NUM objectives.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1962572785142089161?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1962572785142089161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/min-sum-or-min-num.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1962572785142089161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1962572785142089161'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/min-sum-or-min-num.html' title='Min sum or min num'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-iyRpOUZ5_6U/ThOU-fIlrnI/AAAAAAAAAsY/vymEO-hm-IE/s72-c/image_thumb%25255B3%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1511901770842311562</id><published>2011-07-05T17:17:00.001-04:00</published><updated>2011-07-06T16:53:47.642-04:00</updated><title type='text'>GAMS: GDXDUMP and Equations</title><content type='html'>&lt;p&gt;There is a fairly deep issue when comparing GDX files if one of the GDX files has the following properties:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It is produced by GDXDUMP &lt;/li&gt;    &lt;li&gt;It contains Equation records &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The following illustrates the problem: &lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="821"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="819"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;&lt;strong&gt;gamslib indus89                  &lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;Copy ASCII: indus89.gms&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;&lt;strong&gt;gams indus89 lo=0 gdx=1&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;&lt;strong&gt;gdxdump 1.gdx output=2.gms&lt;/strong&gt;&lt;/em&gt;               &lt;br /&gt;*&amp;#160; GDX dump of 1.gdx               &lt;br /&gt;*&amp;#160; Library in use : C:\PROGRA~1\GAMS23.7               &lt;br /&gt;*&amp;#160; Library version: GDX Library&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;*&amp;#160; File version&amp;#160;&amp;#160; : GDX Library&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;*&amp;#160; Producer&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : GAMS Base Module BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;*&amp;#160; File format&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160;&amp;#160; 7               &lt;br /&gt;*&amp;#160; Compression&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160;&amp;#160; 0               &lt;br /&gt;*&amp;#160; Symbols&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; :&amp;#160; 281               &lt;br /&gt;*&amp;#160; Unique Elements:&amp;#160; 245&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;&lt;strong&gt;gams 2.gms lo=0 gdx=2&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;em&gt;&lt;strong&gt;gdxdiff 1.gdx 2.gdx eps=1.0e-6                  &lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;GDXDIFF&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;File1 : 1.gdx               &lt;br /&gt;File2 : 2.gdx               &lt;br /&gt;Summary of differences:               &lt;br /&gt;&amp;#160;&amp;#160; bdraft&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; brepco&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; ccombal&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; consbal&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cost&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; demnat&amp;#160;&amp;#160; Data are different               &lt;br /&gt;divcnlsea&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; divsea&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; fodder&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; grnfdr&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; laborc&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nbal&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; nwfpalc&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objn&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; objnn&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objz&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; objzn&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; protein&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; prseaw&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; qcombal&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; subirrc&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160;&amp;#160; tdraft&amp;#160;&amp;#160; Data are different               &lt;br /&gt;watalcpro&amp;#160;&amp;#160; Data are different               &lt;br /&gt;watalcsea&amp;#160;&amp;#160; Data are different               &lt;br /&gt;&amp;#160; watalcz&amp;#160;&amp;#160; Data are different               &lt;br /&gt;waterbaln&amp;#160;&amp;#160; Data are different               &lt;br /&gt;Output: diffile.gdx               &lt;br /&gt;GDXDiff finished&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;strong&gt;&lt;em&gt;gdxdump diffile.gdx Symbols&lt;/em&gt;&lt;/strong&gt;               &lt;br /&gt;*&amp;#160; GDX dump of diffile.gdx               &lt;br /&gt;*&amp;#160; Library in use : C:\PROGRA~1\GAMS23.7               &lt;br /&gt;*&amp;#160; Library version: GDX Library&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;*&amp;#160; File version&amp;#160;&amp;#160; : GDX Library&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BETA&amp;#160; 8Jun11 23.7.0 WEX 25828.25830 WEI x86_64/MS Windows               &lt;br /&gt;*&amp;#160; Producer&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : GDXDIFF               &lt;br /&gt;*&amp;#160; File format&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160;&amp;#160; 7               &lt;br /&gt;*&amp;#160; Compression&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160;&amp;#160; 0               &lt;br /&gt;*&amp;#160; Symbols&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160; 26               &lt;br /&gt;*&amp;#160; Unique Elements:&amp;#160; 249               &lt;br /&gt;&amp;#160;&amp;#160; Symbol&amp;#160;&amp;#160;&amp;#160; Dim Type&amp;#160; Explanatory text               &lt;br /&gt;1 bdraft&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;2 brepco&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;3 ccombal&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;4 consbal&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;5 cost&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;6 demnat&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;7 divcnlsea&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;8 divsea&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;9 fodder&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;10 grnfdr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;11 laborc&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;12 nbal&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;13 nwfpalc&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;14 objn&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;15 objnn&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;16 objz&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;17 objzn&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;18 protein&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;19 prseaw&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;20 qcombal&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;21 subirrc&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;22 tdraft&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;23 watalcpro&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;24 watalcsea&amp;#160;&amp;#160; 3&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;25 watalcz&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences               &lt;br /&gt;26 waterbaln&amp;#160;&amp;#160; 4&amp;#160; Equ&amp;#160; Differences&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;C:\projects\tmp&amp;gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Apart from a small bug related to $ONEMPTY, it turns out that the way GDXDUMP exports equations records, it looses information about the equation type. This leads to the above results. Luckily in practice this will not be an issue, as equations are not often part of such an exercise.&lt;/p&gt;  &lt;h4&gt;Background.&lt;/h4&gt;  &lt;p&gt;During a course I taught about GAMS I was asked if it is possible to edit GDX files. The answer is: GDXDUMP will give you a GAMS representation of a GDX file which you can edit. Using the call:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;GAMS gmsfile gdx=newgdxfile&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;you can make a new GDX file with the changes incorporated. The tool GDXDIFF will allow you to monitor the changes. &lt;/p&gt;  &lt;p&gt;Although this is correct, I chose the INDUS89 example as illustration. That was unfortunate, as that failed because of the exotic Equation problem.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1511901770842311562?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1511901770842311562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/gams-gdxdump-and-equations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1511901770842311562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1511901770842311562'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/gams-gdxdump-and-equations.html' title='GAMS: GDXDUMP and Equations'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-2282940023285086202</id><published>2011-07-05T15:59:00.001-04:00</published><updated>2011-07-07T19:26:28.800-04:00</updated><title type='text'>Excel issue</title><content type='html'>&lt;p&gt;I was doing some reporting on the results of a large, complex MIP model. I made the unfortunate error of having some spurious blank cells. With the =SUM() function, skipping such cells is identical as considering them as zero, so there is no problem. With a =MIN() function however this is not the case. Even =MINA() will not help there:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-5jWlY1L7TQQ/ThNtFZVXL6I/AAAAAAAAAsM/0-aTNv2yi_A/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-lWCMaKafLsE/ThNtGDikdDI/AAAAAAAAAsQ/XUI24KpN-vA/image_thumb%25255B1%25255D.png?imgmax=800" width="293" height="114" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is sometimes good to work with different people on a project so that one of your collaborators can catch this before submitting results to the customer!&lt;/p&gt;  &lt;p&gt;In this case the result was beneficial for us. With this, our estimated improvement in monthly revenue when using a MIP based model, increased from 250K euros to 300K euros. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-2282940023285086202?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/2282940023285086202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/excel-issue.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2282940023285086202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/2282940023285086202'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/excel-issue.html' title='Excel issue'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-lWCMaKafLsE/ThNtGDikdDI/AAAAAAAAAsQ/XUI24KpN-vA/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-3782323781343255910</id><published>2011-07-01T00:07:00.001-04:00</published><updated>2011-07-01T00:07:58.516-04:00</updated><title type='text'>How bumblebees tackle the traveling salesman problem</title><content type='html'>&lt;p&gt;&lt;a href="http://www.eurekalert.org/pub_releases/2011-06/qmuo-hbt062811.php"&gt;http://www.eurekalert.org/pub_releases/2011-06/qmuo-hbt062811.php&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-3782323781343255910?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/3782323781343255910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/how-bumblebees-tackle-traveling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3782323781343255910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/3782323781343255910'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/how-bumblebees-tackle-traveling.html' title='How bumblebees tackle the traveling salesman problem'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-7448164765867289873</id><published>2011-07-01T00:06:00.001-04:00</published><updated>2011-07-01T00:06:39.670-04:00</updated><title type='text'>Sorting in GAMS</title><content type='html'>&lt;p&gt;This question came up during a workshop I taught at a large power company:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I want to generate a number of load-duration and price-duration curves, but it takes too long.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here is a small example demonstrating some formulations for sorting a 1d parameter:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="831"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="829"&gt;         &lt;p style="line-height: 13pt; margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;option&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font style="font-size: 10pt"&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; profile=1;&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; i &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#008000"&gt;/i1*i10000/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p(i);                   &lt;br /&gt;p(i) = uniform(1,100);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p;&lt;/font&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;execute_unload&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#800000"&gt;&amp;quot;p&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;,p;&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;execute&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#800000"&gt;&amp;quot;gdxrank p.gdx p2.gdx&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; pindex(i);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;execute_load&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#800000"&gt;&amp;quot;p2.gdx&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;,pindex=p;&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; pindex;&lt;/font&gt;                  &lt;br /&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#808080"&gt;* slow&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: "&gt;               &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p2(i);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(i,j);                   &lt;br /&gt;p2(i)=&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(j$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(i)=pindex(j)),p(j));&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p2;&lt;/font&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#808080"&gt;* almost as slow&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: "&gt;               &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p3(i);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(i,j);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;loop&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;((i,j)$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(i)=pindex(j)),                   &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;p3(i)=p(j);                    &lt;br /&gt;);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p3;&lt;/font&gt;                  &lt;br /&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#808080"&gt;* fast using trick:&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: "&gt;               &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt; p4(i);                   &lt;br /&gt;p4(i+(pindex(i)-&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;ord&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#000000"&gt;(i))) = p(i);&lt;/font&gt;                  &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: "&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; p4;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The timings are:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Method&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Time (seconds)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;SUM (assignment to p2)&lt;/td&gt;        &lt;td valign="top" width="200"&gt;28.407&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;LOOP (assignment to p3)&lt;/td&gt;        &lt;td valign="top" width="200"&gt;22.230&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;TRICK (assignment to p4)&lt;/td&gt;        &lt;td valign="top" width="200"&gt;0.265&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-7448164765867289873?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/7448164765867289873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/sorting-in-gams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7448164765867289873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/7448164765867289873'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/07/sorting-in-gams.html' title='Sorting in GAMS'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1097625471732106865</id><published>2011-06-30T07:45:00.001-04:00</published><updated>2011-06-30T07:45:16.688-04:00</updated><title type='text'>Cplex polishing</title><content type='html'>&lt;p&gt;For some difficult large models, the Polishing facility in Cplex can sometimes do extremely well. This is an example:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="809"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="807"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Elapsed real time = 874.90 sec. (tree size = 11.31 MB, solutions = 2)             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 233&amp;#160;&amp;#160; 235&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9737&amp;#160; 3551&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 258914&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 234&amp;#160;&amp;#160; 236&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9448&amp;#160; 3578&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 258964&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 266&amp;#160;&amp;#160; 268&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9498&amp;#160; 3578&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 265158&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 306&amp;#160;&amp;#160; 308&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9338&amp;#160; 3568&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 271534&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 310&amp;#160;&amp;#160; 312&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9315&amp;#160; 3511&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 272354&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 312&amp;#160;&amp;#160; 314&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9489&amp;#160; 3581&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 272367&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 322&amp;#160;&amp;#160; 324&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9310&amp;#160; 3574&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 273646&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 346&amp;#160;&amp;#160; 348&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.8857&amp;#160; 3561&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 277217&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 354&amp;#160;&amp;#160; 356&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.8368&amp;#160; 3532&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 278697&amp;#160; 125.65%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 370&amp;#160;&amp;#160; 372&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.8741&amp;#160; 3567&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 621.0895&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 281105&amp;#160; 125.65%              &lt;br /&gt;Elapsed real time = 995.15 sec. (tree size = 49.71 MB, solutions = 2)&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Starting condition for polishing reached (PolishAfterTime).             &lt;br /&gt;Starting solution polishing.&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;*&amp;#160;&amp;#160; 390+&amp;#160; 390&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 360.3876&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 285698&amp;#160; 144.20%             &lt;br /&gt;*&amp;#160;&amp;#160; 390+&amp;#160; 390&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 231.7287&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 285698&amp;#160; 168.75%              &lt;br /&gt;*&amp;#160;&amp;#160; 390+&amp;#160; 390&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 285698&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 390&amp;#160;&amp;#160; 392&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.8957&amp;#160; 3503&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 285698&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 391&amp;#160;&amp;#160; 393&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9880&amp;#160; 3601&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 286729&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 392&amp;#160;&amp;#160; 394&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9935&amp;#160; 3613&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 286790&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 393&amp;#160;&amp;#160; 395&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9735&amp;#160; 3574&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 287216&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 394&amp;#160;&amp;#160; 396&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9763&amp;#160; 3595&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 287247&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 395&amp;#160;&amp;#160; 397&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9980&amp;#160; 3601&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 287328&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 396&amp;#160;&amp;#160; 398&amp;#160;&amp;#160;&amp;#160;&amp;#160; -158.9806&amp;#160; 3600&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 287599&amp;#160; 258.95%              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 397&amp;#160;&amp;#160; 399&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.0641&amp;#160; 3615&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100.2251&amp;#160;&amp;#160;&amp;#160;&amp;#160; -159.3086&amp;#160;&amp;#160; 296751&amp;#160; 258.95%&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;GUB cover cuts applied:&amp;#160; 854             &lt;br /&gt;Clique cuts applied:&amp;#160; 14              &lt;br /&gt;Cover cuts applied:&amp;#160; 1540              &lt;br /&gt;Implied bound cuts applied:&amp;#160; 20              &lt;br /&gt;Flow cuts applied:&amp;#160; 922              &lt;br /&gt;Mixed integer rounding cuts applied:&amp;#160; 67              &lt;br /&gt;Zero-half cuts applied:&amp;#160; 1169              &lt;br /&gt;Gomory fractional cuts applied:&amp;#160; 236&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Root node processing (before b&amp;amp;c):             &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160; 127.44              &lt;br /&gt;Parallel b&amp;amp;c, 8 threads:              &lt;br /&gt;&amp;#160; Real time&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = 7070.70              &lt;br /&gt;&amp;#160; Sync time (average)&amp;#160;&amp;#160; =&amp;#160; 168.52              &lt;br /&gt;&amp;#160; Wait time (average)&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160; 0.00              &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -------              &lt;br /&gt;Total (root+branch&amp;amp;cut) = 7198.14 sec.              &lt;br /&gt;MIP status(107): time limit exceeded&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Although the relative gap looks bad, this is in fact a very good solution. The reason for the gap problem is that we are relatively close to zero in our objective (compared to solutions found by heuristics) and the fact that we are crossing zero in the gap calculation does not help.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1097625471732106865?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1097625471732106865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/cplex-polishing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1097625471732106865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1097625471732106865'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/cplex-polishing.html' title='Cplex polishing'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-8526430089839351075</id><published>2011-06-18T02:58:00.001-04:00</published><updated>2011-06-22T01:11:43.679-04:00</updated><title type='text'>Advanced basis with Cplex</title><content type='html'>&lt;p&gt;Usually Cplex behaves very predictable with LP’s that have an advanced basis to start from. But now I have something that puzzles me. Basically I do a solve from an optimal solution. This should normally run in just a few iterations. But with the default setting I see:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="731"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="142"&gt;First model&lt;/td&gt;        &lt;td valign="top" width="587"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Iteration log . . .              &lt;br /&gt;Iteration:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160; Dual objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.005320               &lt;br /&gt;Iteration:&amp;#160;&amp;#160; 581&amp;#160;&amp;#160; Dual objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 296.751221               &lt;br /&gt;Iteration:&amp;#160; 1247&amp;#160;&amp;#160; Dual objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 511.623938               &lt;br /&gt;Iteration:&amp;#160; 1681&amp;#160;&amp;#160; Dual objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 514.072257               &lt;br /&gt;LP status(1): optimal&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="146"&gt;Restart&lt;/td&gt;        &lt;td valign="top" width="584"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Iteration log . . .              &lt;br /&gt;Iteration:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.104554               &lt;br /&gt;Perturbation started.               &lt;br /&gt;Iteration:&amp;#160;&amp;#160; 402&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.104554               &lt;br /&gt;Iteration:&amp;#160;&amp;#160; 806&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.104088               &lt;br /&gt;Iteration:&amp;#160; 1107&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103794               &lt;br /&gt;Iteration:&amp;#160; 1406&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103557               &lt;br /&gt;Iteration:&amp;#160; 1684&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103314               &lt;br /&gt;Iteration:&amp;#160; 1939&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103216               &lt;br /&gt;Iteration:&amp;#160; 2186&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103124               &lt;br /&gt;Iteration:&amp;#160; 2434&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.103037               &lt;br /&gt;Iteration:&amp;#160; 2672&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102875               &lt;br /&gt;Iteration:&amp;#160; 2951&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102790               &lt;br /&gt;Iteration:&amp;#160; 3210&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102730               &lt;br /&gt;Iteration:&amp;#160; 3472&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102670               &lt;br /&gt;Iteration:&amp;#160; 3709&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102630               &lt;br /&gt;Iteration:&amp;#160; 3943&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102592               &lt;br /&gt;Iteration:&amp;#160; 4199&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102525               &lt;br /&gt;Iteration:&amp;#160; 4445&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102493               &lt;br /&gt;Iteration:&amp;#160; 4692&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102468               &lt;br /&gt;Iteration:&amp;#160; 4933&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102448               &lt;br /&gt;Iteration:&amp;#160; 5181&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102428               &lt;br /&gt;Iteration:&amp;#160; 5431&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102411               &lt;br /&gt;Iteration:&amp;#160; 5689&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102395               &lt;br /&gt;Iteration:&amp;#160; 5962&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102379               &lt;br /&gt;Iteration:&amp;#160; 6224&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102362               &lt;br /&gt;Iteration:&amp;#160; 6487&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102353               &lt;br /&gt;Iteration:&amp;#160; 6765&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102342               &lt;br /&gt;Iteration:&amp;#160; 7041&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.102335               &lt;br /&gt;Removing perturbation.               &lt;br /&gt;LP status(1): optimal               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;The restart from an optimal basis takes more iterations than solving from scratch. This is with a default setting of LPMETHOD=0 (automatic). When I use LPMETHOD=1 (Primal Simplex) or LPMETHOD=2 (Dual Simplex) I see:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="732"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="144"&gt;Restart with LPMETHOD=1&lt;/td&gt;        &lt;td valign="top" width="586"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Primal crossover.              &lt;br /&gt;&amp;#160; Primal:&amp;#160; Fixed no variables.               &lt;br /&gt;&amp;#160; Dual:&amp;#160; Fixing 993 variables.               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 992 DMoves:&amp;#160; Infeasibility 6.76704726e+000&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 394 DMoves:&amp;#160; Infeasibility 1.33823843e+000&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 DMoves:&amp;#160; Infeasibility 7.17019911e-001&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160; Dual:&amp;#160; Pushed 0, exchanged 993.&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;Iteration log . . .              &lt;br /&gt;Iteration:&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160;&amp;#160;&amp;#160;&amp;#160; =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 515.104554               &lt;br /&gt;LP status(1): optimal&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="148"&gt;Restart with LPMETHOD=2&lt;/td&gt;        &lt;td valign="top" width="582"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;Dual crossover.              &lt;br /&gt;&amp;#160; Dual:&amp;#160; Fixing 994 variables.               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 993 DMoves:&amp;#160; Infeasibility 2.07167616e-013&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 414 DMoves:&amp;#160; Infeasibility 7.97140132e-014&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 DMoves:&amp;#160; Infeasibility 0.00000000e+000&amp;#160; Objective 5.15104554e+002               &lt;br /&gt;&amp;#160; Dual:&amp;#160; Pushed 1, exchanged 993.               &lt;br /&gt;&amp;#160; Primal:&amp;#160; Fixed no variables.               &lt;br /&gt;LP status(1): optimal&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;These seem indeed to take fewer iterations to solve the restarted model. I always assumed LPMETHOD=0 would just choose primal or dual simplex, but apparently it also does other things, and in this case that is not helping.&lt;/p&gt;  &lt;h4&gt;Update&lt;/h4&gt;  &lt;p&gt;I did some more experiments. With LPMETHOD=0 I can now also achieve a restart if I set all variable levels to zero. I.e. &lt;/p&gt;  &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;font face="Courier New"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m minimizing z using lp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;          &lt;br /&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000" face="Courier New"&gt; m minimizing z using lp;&lt;/font&gt;       &lt;br style="mso-special-character: line-break" /&gt;      &lt;br style="mso-special-character: line-break" /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;gives a bad restart, while:&lt;/p&gt; &lt;b style="line-height: normal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;font color="#0000ff" face="Courier New"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;font color="#000000"&gt; m minimizing z using lp;        &lt;br /&gt;x.l(i,j) = 0;         &lt;br /&gt;z.l=0;&lt;/font&gt;       &lt;br /&gt;&lt;/span&gt;&lt;b style="line-height: normal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: ; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-us; mso-fareast-language: en-us; mso-bidi-language: ar-sa"&gt;&lt;font color="#000000" face="Courier New"&gt; m minimizing z using lp;&lt;/font&gt;     &lt;br style="mso-special-character: line-break" /&gt;    &lt;br style="mso-special-character: line-break" /&gt;gives me zero iterations for the restart. Something is not completely right. As Bo suggested in his comments, the reason may be related to Cplex trying to do a presolve on an advanced basis. (I have heard about some ancient solvers that tried a basis preserving presolve, may be more limited than what current presolvers do). The difference between LPMETHOD=0 and both LPMETHOD=1 and LPMETHOD=2 is still a mystery to me.&lt;/span&gt;  &lt;h4&gt;Update 2&lt;/h4&gt;  &lt;p&gt;The behavior can be partially explained by looking at the Cplex documentation describing the Advind parameter:&lt;/p&gt;  &lt;p&gt;&lt;a name="260928"&gt;&lt;/a&gt;    &lt;blockquote&gt;     &lt;p&gt;For continuous models solved with simplex, setting 1 (one) will use the currently loaded basis. If a basis is available only for the original, unpresolved model, or if CPLEX has a start vector rather than a simplex basis, then the simplex algorithm will proceed on the unpresolved model. With setting 2, CPLEX will first perform presolve on the model and on the basis or start vector, and then proceed with optimization on the presolved problem.&lt;/p&gt;   &lt;/blockquote&gt; &lt;/p&gt; &lt;a name="260703"&gt;   &lt;p&gt;I was using the model from a GAMS environment. There the default is 2. The documentation for GAMS/Cplex is somewhat more limited than the above paragraph:&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;Advind (Integer)       &lt;br /&gt;Use an Advanced Basis. GAMS/Cplex will automatically use an advanced basis from a previous solve        &lt;br /&gt;statement. The GAMS Bratio option can be used to specify when not to use an advanced basis. The Cplex        &lt;br /&gt;option advind can be used to ignore a basis passed on by GAMS (it overrides Bratio).        &lt;br /&gt;(default = determined by GAMS Bratio)        &lt;br /&gt;0 Do not use advanced basis        &lt;br /&gt;1 Use advanced basis if available        &lt;br /&gt;2 Crash an advanced basis if available (use basis with presolve)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;Looks like 1 is better for a very good basis, 2 may be better for models with a basis that is not very good (in that case presolving will pay off even when destroying some basis information).     &lt;br /&gt;&lt;/p&gt; &lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-8526430089839351075?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/8526430089839351075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/advanced-basis-with-cplex.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8526430089839351075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/8526430089839351075'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/advanced-basis-with-cplex.html' title='Advanced basis with Cplex'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-668733503308971999</id><published>2011-06-17T01:00:00.001-04:00</published><updated>2011-06-17T01:00:34.855-04:00</updated><title type='text'>Network formulation</title><content type='html'>&lt;p&gt;I was looking at a model containing underlying traffic network. Such a network can be quite elegantly formulated in GAMS, but apparently many users still have problems with this. The mathematical formulation is:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-LFkvlMdivVM/Tfrfb90tFOI/AAAAAAAAAsE/qFRxe_klsIg/s1600-h/image%25255B5%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-7YZTK4V-Xf4/TfrfcR31vlI/AAAAAAAAAsI/DHt3C21oXdE/image_thumb%25255B3%25255D.png?imgmax=800" width="498" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The GAMS formulation can look like:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="731"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="729"&gt;         &lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;$ontext                 &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#808080"&gt;max flow network example&lt;/font&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Courier New"&gt;Data from example in&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Courier New"&gt;Mitsuo Gen, Runwei Cheng, Lin Lin&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Courier New"&gt;Network Models and Optimization: Multiobjective Genetic Algorithm Approach&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#808080"&gt;Springer, 2008&lt;/font&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Courier New"&gt;Erwin Kalvelagen,&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#808080" face="Courier New"&gt;Amsterdam Optimization,&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font face="Courier New"&gt;&lt;font color="#808080"&gt;May 2008&lt;/font&gt;                  &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;$offtext&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;sets&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;i &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; background: none transparent scroll repeat 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff"&gt;'nodes' &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/node1*node11/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;source(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;/node1/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;sink(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;/node11/&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff" face="Courier New"&gt;alias&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(i,j);&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;abort&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;card&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(source)&amp;lt;&amp;gt;1) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;We want one source node&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;abort&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;$(&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;card&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(sink)&amp;lt;&amp;gt;1) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#800000"&gt;&amp;quot;We want one sink node&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; capacity(i,j) &lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node1.node2 60,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node1.node3 60,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node1.node4 60,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node2.node3 30&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node2.node5 40,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node2.node6 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node3.node4 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node3.node6 50&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node3.node7 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node4.node7 40,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node5.node8 60,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node6.node5 20&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node6.node8 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node6.node9 40,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node6.node10 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;node7.node6 20&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node7.node10 40,&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;node8.node9 30,&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;node8.node11 60,&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;node9.node10 30&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000" face="Courier New"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000" face="Courier New"&gt;node9.node11 50,&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;node10.node11 50 /&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; arcs(i,j);                 &lt;br /&gt;arcs(i,j)$capacity(i,j) = &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;yes&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;display&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; arcs;&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;parameter&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; rhs(i);                 &lt;br /&gt;rhs(source) = -1;                  &lt;br /&gt;rhs(sink) = 1;&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;x(i,j) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; background: none transparent scroll repeat 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'flow along arcs'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;f&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; background: none transparent scroll repeat 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'total flow'&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;positive&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;variables&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; x;                 &lt;br /&gt;x.up(i,j) = capacity(i,j);&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;equations&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;             &lt;br /&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;flowbal(i) &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; background: none transparent scroll repeat 0% 0%; color: ; mso-highlight: white"&gt;&lt;font color="#0000ff" face="Courier New"&gt;'flow balance' &lt;/font&gt;&lt;/span&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;                 &lt;br /&gt;                  &lt;br /&gt;flowbal(i)..                  &lt;br /&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(arcs(j,i), x(j,i)) - &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;sum&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;(arcs(i,j), x(i,j)) =e= f*rhs(i);&lt;/font&gt;                &lt;br /&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;model&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m&lt;/font&gt;&lt;/span&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#008000"&gt;/flowbal/&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;                &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;solve&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="line-height: 12pt; font-family: ; color: "&gt;&lt;font color="#000000"&gt; m maximizing f using lp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-668733503308971999?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/668733503308971999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/668733503308971999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/668733503308971999'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/network-formulation.html' title='Network formulation'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-7YZTK4V-Xf4/TfrfcR31vlI/AAAAAAAAAsI/DHt3C21oXdE/s72-c/image_thumb%25255B3%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1298645293853282482</id><published>2011-06-14T12:46:00.001-04:00</published><updated>2011-06-15T02:25:21.048-04:00</updated><title type='text'>MIP Gap not decreasing</title><content type='html'>&lt;p&gt;Here is a small fragment of a Cplex log:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="669"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="667"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Nodes&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Cuts/              &lt;br /&gt;&amp;#160;&amp;#160; Node&amp;#160; Left&amp;#160;&amp;#160;&amp;#160;&amp;#160; Objective&amp;#160; IInf&amp;#160; Best Integer&amp;#160;&amp;#160;&amp;#160; Best Bound&amp;#160;&amp;#160;&amp;#160; ItCnt&amp;#160;&amp;#160;&amp;#160;&amp;#160; Gap&lt;/font&gt;&lt;/p&gt;          &lt;br /&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160; 3186&amp;#160; 2520&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.6217&amp;#160; 4096&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 956.6330&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1313338&amp;#160; 169.74%              &lt;br /&gt;&amp;#160;&amp;#160; 3226&amp;#160; 2560&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.6205&amp;#160; 4097&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 956.6330&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1323797&amp;#160; 169.74%               &lt;br /&gt;&amp;#160;&amp;#160; 3266&amp;#160; 2600&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.6201&amp;#160; 4095&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 956.6330&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1335602&amp;#160; 169.74%               &lt;br /&gt;Elapsed real time = 2801.61 sec. (tree size = 77.54 MB, solutions = 2)               &lt;br /&gt;*&amp;#160; 3324+ 2656&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -125.5775&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1363079&amp;#160; 431.31%               &lt;br /&gt;&amp;#160;&amp;#160; 3334&amp;#160; 2668&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.5811&amp;#160; 4052&amp;#160;&amp;#160;&amp;#160;&amp;#160; -125.5775&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1370748&amp;#160; 431.31%               &lt;br /&gt;&amp;#160;&amp;#160; 3380&amp;#160; 2714&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.5799&amp;#160; 4017&amp;#160;&amp;#160;&amp;#160;&amp;#160; -125.5775&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1388391&amp;#160; 431.31%               &lt;br /&gt;&amp;#160;&amp;#160; 3422&amp;#160; 2756&amp;#160;&amp;#160;&amp;#160;&amp;#160; -666.5791&amp;#160; 4011&amp;#160;&amp;#160;&amp;#160;&amp;#160; -125.5775&amp;#160;&amp;#160;&amp;#160;&amp;#160; -667.2010&amp;#160; 1403440&amp;#160; 431.31%               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Usually we expect the gap to decrease while the MIP solver is working its way. Here we see a different behavior. Because we go through zero the gap% is actually increasing here. &lt;/p&gt;  &lt;p&gt;I believe the gap calculation used by Cplex is:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-uV3z7nZ_Uz4/TfeQb5ejmFI/AAAAAAAAAr8/F-Lh9mHFJNI/s1600-h/image%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-Fny1ajGP-jU/TfeQeEJfHDI/AAAAAAAAAsA/8gQV1KCR4Ms/image_thumb.png?imgmax=800" width="244" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Obviously this is sensitive w.r.t. to the sign of BestInteger. Of course in practice we don’t see this behavior very often (in many models BestInteger and BestNode have the same sign). &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1298645293853282482?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1298645293853282482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/mip-gap-not-increasing.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1298645293853282482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1298645293853282482'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/mip-gap-not-increasing.html' title='MIP Gap not decreasing'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-Fny1ajGP-jU/TfeQeEJfHDI/AAAAAAAAAsA/8gQV1KCR4Ms/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-4342904923295308793</id><published>2011-06-07T14:13:00.001-04:00</published><updated>2011-06-08T00:35:19.868-04:00</updated><title type='text'>Writing solutions back into a database</title><content type='html'>&lt;p&gt;The issue of writing optimization results back into a database is often a little bit more complex than reading input data (see &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/04/live-databases.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/04/live-databases.html&lt;/a&gt; for some thoughts on reading data).&lt;/p&gt;  &lt;p&gt;First with writing more things can go wrong: you need additional permissions, you can overwrite data, and conceptual there are some issues. Here are some questions and possibilities that come to mind:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Do we have a say in how the tables look like or do we need to follow some existing data model? &lt;/li&gt;    &lt;li&gt;Update or Insert. Do we use an SQL INSERT or SQL UPDATE to populate solution tables? &lt;/li&gt;    &lt;li&gt;Some databases have SQL extensions that implement an UPSERT. E.g. MySQL has INSERT INTO … ON DUPLICATE KEY UPDATE, or REPLACE INTO, Oracle and SQL Server have MERGE. &lt;/li&gt;    &lt;li&gt;It may be better to erase the solution tables first. &lt;/li&gt;    &lt;li&gt;Or always INSERT with a new key indicating the run id. A new solution gets a new run id. &lt;/li&gt;    &lt;li&gt;For very large data some RDBMS systems have a BULK INSERT facility (SQL Server: BCP or BULK INSERT, SQL*Loader for Oracle). &lt;/li&gt;    &lt;li&gt;We can write to temporary tables and deal with the problem of merging results into the real tables further down the road. &lt;/li&gt;    &lt;li&gt;Just write a well-designed temp database (e.g. in Access) and let the IT people deal with getting the data into their systems. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In general I prefer 8, let others take responsibility for plugging things into the database. Note that this step can be expensive. A few weeks ago I was discussing a complex model where we needed to get the results into the RDBMS. To achieve a reasonable turnaround time, I was given a time limit of about an hour to come up with solutions for the model, while the system guy allocated 2 hours for himself to put the solution back into the database (much time is spent on checks).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-4342904923295308793?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/4342904923295308793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/writing-solutions-back-into-database.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4342904923295308793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/4342904923295308793'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/writing-solutions-back-into-database.html' title='Writing solutions back into a database'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-5060924453256341662</id><published>2011-06-05T22:50:00.001-04:00</published><updated>2011-06-05T22:50:51.531-04:00</updated><title type='text'>Remote Desktop adventure</title><content type='html'>&lt;p&gt;Suddenly my remote desktop window went black. Even after reconnecting, I got again just a black screen. Took me a little while to figure out that with Ctrl-Alt-End I could send a Ctrl-Alt-Del to the remote session, so I could log out. That solved the problem: after logging on again everything was fine. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-5060924453256341662?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/5060924453256341662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/remote-desktop-adventure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5060924453256341662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/5060924453256341662'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/06/remote-desktop-adventure.html' title='Remote Desktop adventure'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-6653633072587678655</id><published>2011-05-30T00:47:00.001-04:00</published><updated>2011-06-08T01:29:54.422-04:00</updated><title type='text'>GAMS/Gurobi and Ctrl-C</title><content type='html'>&lt;p&gt;I am seeing some strange results when I interrupt a GAMS/Gurobi run with Ctrl-c (in the IDE using the Interrupt button). The GAMS link should give in that case the best integer solution found so far, basically identical to an iteration or time limit. However the solution seems wrong: many of the binary variables x(i,j) in a large model are off (they are reported as zero instead of one). I suspect this is a problem in the GAMS link (i.e. not in Gurobi itself). From what I can see the link it passing back levels of integer variables incorrectly in these circumstances (I have seen this before: integer variables should have basis status SUPERBASIC to prevent only a basis status being sent back).&lt;/p&gt;  &lt;p&gt;Btw, for this (huge) model the Gurobi heuristics do a fantastic job finding good solutions:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="872"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="870"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; Nodes&amp;#160;&amp;#160;&amp;#160; |&amp;#160;&amp;#160;&amp;#160; Current Node&amp;#160;&amp;#160;&amp;#160; |&amp;#160;&amp;#160;&amp;#160;&amp;#160; Objective Bounds&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; |&amp;#160;&amp;#160;&amp;#160;&amp;#160; Work              &lt;br /&gt;Expl Unexpl |&amp;#160; Obj&amp;#160; Depth IntInf | Incumbent&amp;#160;&amp;#160;&amp;#160; BestBd&amp;#160;&amp;#160; Gap | It/Node Time&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 179791.544&amp;#160;&amp;#160;&amp;#160; 0 6744 1511067.07 179791.544&amp;#160; 88.1%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160;&amp;#160; 91s              &lt;br /&gt;H&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 247836.12285 179791.544&amp;#160; 27.5%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160;&amp;#160; 93s               &lt;br /&gt;H&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 232489.21120 179791.544&amp;#160; 22.7%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160;&amp;#160; 96s               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 181272.276&amp;#160;&amp;#160;&amp;#160; 0 7366 232489.211 181272.276&amp;#160; 22.0%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160; 397s               &lt;br /&gt;H&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 226736.43968 181272.276&amp;#160; 20.1%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160; 399s               &lt;br /&gt;H&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 218612.71830 181272.276&amp;#160; 17.1%&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;#160; 404s               &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Just need to remember not to use the Interrupt button.&lt;/p&gt;  &lt;p&gt;PS. Another minor issue with the link:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="874"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="872"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;MIP&amp;#160; Solution:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7259.007800&amp;#160;&amp;#160;&amp;#160; (&lt;font style="background-color: #ffff00"&gt;-2147483648&lt;/font&gt; iterations, 0 nodes)               &lt;br /&gt;Best possible:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6916.876514               &lt;br /&gt;Absolute gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 342.131286               &lt;br /&gt;Relative gap:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0.047132&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;it has troubles with the iteration count (which actually is 120570, a number that should not overflow).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-6653633072587678655?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/6653633072587678655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/gamsgurobi-and-ctrl-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6653633072587678655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/6653633072587678655'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/gamsgurobi-and-ctrl-c.html' title='GAMS/Gurobi and Ctrl-C'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-170731823004160368</id><published>2011-05-19T09:08:00.001-04:00</published><updated>2011-05-19T09:08:05.794-04:00</updated><title type='text'>Optimal Spread (2)</title><content type='html'>&lt;p&gt;Is turns out we also have to distribute x(t)’s such that we follow a non-uniform parameter. In the previous section &lt;a href="http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread.html"&gt;http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread.html&lt;/a&gt; we used a function v(t) = 1 with cumulative function w(t) = t.&lt;/p&gt;  &lt;p&gt;In this case we consider a generic parameter v(t), with its cumulative cousin w(t)=w(t-1)+v(t). To trace this function as closely as possible we can use:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_1xChIhrNQN0/TdUWM2rtNcI/AAAAAAAAArc/rnwjRNA08pI/s1600-h/spread6%5B2%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="spread6" border="0" alt="spread6" src="http://lh4.ggpht.com/_1xChIhrNQN0/TdUWNPZ-QgI/AAAAAAAAArg/DmibxgNMKT4/spread6_thumb.png?imgmax=800" width="244" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;E.g. when we use v(t)=t, then we see:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="581"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="579"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 77 PARAMETER result&amp;#160; &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; v&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; x&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;i1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000             &lt;br /&gt;i2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2.000              &lt;br /&gt;i3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3.000              &lt;br /&gt;i4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4.000              &lt;br /&gt;i5&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i6&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 6.000              &lt;br /&gt;i7&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 7.000              &lt;br /&gt;i8&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 8.000              &lt;br /&gt;i9&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 9.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i10&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 10.000              &lt;br /&gt;i11&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 11.000              &lt;br /&gt;i12&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 12.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i13&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 13.000              &lt;br /&gt;i14&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 14.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i15&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 15.000              &lt;br /&gt;i16&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 16.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i17&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 17.000              &lt;br /&gt;i18&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 18.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000              &lt;br /&gt;i19&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 19.000              &lt;br /&gt;i20&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20.000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1.000&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-170731823004160368?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/170731823004160368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/170731823004160368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/170731823004160368'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread-2.html' title='Optimal Spread (2)'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_1xChIhrNQN0/TdUWNPZ-QgI/AAAAAAAAArg/DmibxgNMKT4/s72-c/spread6_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-9014781438906758822</id><published>2011-05-14T18:55:00.001-04:00</published><updated>2011-05-15T09:09:42.010-04:00</updated><title type='text'>Optimal spread</title><content type='html'>&lt;p&gt;In a multi-objective MIP model I am working I have a binary variable &lt;em&gt;x(t)&lt;/em&gt;. This variable is mostly zero but now and then it is one. One of the goals is to achieve an even spread of the ones. I.e.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_1xChIhrNQN0/Tc8IXTTvyvI/AAAAAAAAAq0/XDWUdFmHLgE/s1600-h/spread1%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="spread1" border="0" alt="spread1" src="http://lh3.ggpht.com/_1xChIhrNQN0/Tc8IXxgwCJI/AAAAAAAAAq4/970AK22ohNg/spread1_thumb%5B1%5D.png?imgmax=800" width="727" height="72" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;The first row has the ones clustered in the middle. The second one looks pretty good.&lt;/p&gt;  &lt;p&gt;The following idea is based on how Q-Q plots are used to find distributions in statistical data (&lt;a href="http://en.wikipedia.org/wiki/Q-Q_plot"&gt;http://en.wikipedia.org/wiki/Q-Q_plot&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;First we form a running sum:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8IYLZaj2I/AAAAAAAAAq8/EtWBQkcGRA4/s1600-h/spread2%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="spread2" border="0" alt="spread2" src="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8IYwhzkGI/AAAAAAAAArA/qU_FoV8Yk0E/spread2_thumb%5B1%5D.png?imgmax=800" width="719" height="70" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The “predicted’ running sum for an evenly distributed &lt;em&gt;x(t)&lt;/em&gt; can be expressed as &lt;em&gt;tn/T&lt;/em&gt; where &lt;em&gt;n&lt;/em&gt; is the total number of ones, &lt;em&gt;t&lt;/em&gt; is the current index and &lt;em&gt;T&lt;/em&gt; is the last &lt;em&gt;t&lt;/em&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_1xChIhrNQN0/Tc8IZIoAwhI/AAAAAAAAArE/a0x3pUkLrKs/s1600-h/image%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8IZtfM1NI/AAAAAAAAArI/Yl-pqmvEMUw/image_thumb%5B1%5D.png?imgmax=800" width="718" height="91" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now we try to keep the values &lt;em&gt;s(t)&lt;/em&gt; as close as possible to the predicted values &lt;em&gt;tn/T&lt;/em&gt;. I.e.:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8IZ8f70VI/AAAAAAAAArM/LzoPNSdGHAU/s1600-h/spread4%5B2%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="spread4" border="0" alt="spread4" src="http://lh4.ggpht.com/_1xChIhrNQN0/Tc8Iaa4_EFI/AAAAAAAAArQ/aX5Za0L00dA/spread4_thumb.png?imgmax=800" width="244" height="193" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that n is a variable in my model: I don’t know in advance how many x(t)’s are turned on. Indeed when I run this (with n=3) I see:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;         &lt;p&gt;&lt;font face="Consolas"&gt;----&amp;#160;&amp;#160;&amp;#160;&amp;#160; 42 VARIABLE x.L&amp;#160; &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font face="Consolas"&gt;t3&amp;#160; 1.000,&amp;#160;&amp;#160;&amp;#160; t7&amp;#160; 1.000,&amp;#160;&amp;#160;&amp;#160; t10 1.000             &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Here are the results when we compare the two solutions (click to enlarge):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8Ia4_L65I/AAAAAAAAArU/S6BY8yg9Weo/s1600-h/spread5%5B5%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="spread5" border="0" alt="spread5" src="http://lh6.ggpht.com/_1xChIhrNQN0/Tc8IbW6d1-I/AAAAAAAAArY/Ztdzex_0pcI/spread5_thumb%5B3%5D.png?imgmax=800" width="644" height="145" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Indeed this seems to confirm this approach could work, and we can add d(max)-d(min) as an extra objective to minimize.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-9014781438906758822?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/9014781438906758822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/9014781438906758822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/9014781438906758822'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/optimal-spread.html' title='Optimal spread'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_1xChIhrNQN0/Tc8IXxgwCJI/AAAAAAAAAq4/970AK22ohNg/s72-c/spread1_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-1845512584375930945</id><published>2011-05-04T16:22:00.001-04:00</published><updated>2011-05-04T16:22:51.260-04:00</updated><title type='text'>Excel: Trace Dependents</title><content type='html'>&lt;p&gt;I often use the “Trace Dependents” tool in Excel to quickly see which formulas use a given cell. Here is an example where I was a bit overwhelmed:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_1xChIhrNQN0/TcG1l2G6U7I/AAAAAAAAAqs/2Uc63O4ieoo/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_1xChIhrNQN0/TcG1mohqWsI/AAAAAAAAAqw/oYyPvYamVgU/image_thumb%5B2%5D.png?imgmax=800" width="422" height="772" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/593563533834706486-1845512584375930945?l=yetanothermathprogrammingconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yetanothermathprogrammingconsultant.blogspot.com/feeds/1845512584375930945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/excel-trace-dependents.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1845512584375930945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593563533834706486/posts/default/1845512584375930945'/><link rel='alternate' type='text/html' href='http://yetanothermathprogrammingconsultant.blogspot.com/2011/05/excel-trace-dependents.html' title='Excel: Trace Dependents'/><author><name>Erwin Kalvelagen</name><uri>http://www.blogger.com/profile/09496091402502236997</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_1xChIhrNQN0/SzvdvXVOocI/AAAAAAAAAcg/Tqsbg57K1UE/S220/erwin2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_1xChIhrNQN0/TcG1mohqWsI/AAAAAAAAAqw/oYyPvYamVgU/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593563533834706486.post-43993819916339702</id><published>2011-05-03T16:25:00.001-04:00</published><updated>2011-05-03T16:29:21.416-04:00</updated><title type='text'>Large (almost) triangular spreadsheet?</title><content type='html'>&lt;p&gt;A spreadsheet model without circular references can be called “triangular”. Excel can form a dependency graph and ordering such that recalculation can be done in one iteration. If there are circular references the spreadsheet needs to perform more iterations before the results converge. &lt;/p&gt;  &lt;p&gt;I was given a very large spreadsheet implementing an agricultural country trade model. The question was how near triangular is this? With the Excel tool to find circular references, we only find a single case:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_1xChIhrNQN0/TcBkny9Ba-I/AAAAAAAAAqE/Jy2_ZkEUWmQ/s1600-h/circular%5B3%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="circular" border="0" alt="circular" src="http://lh5.ggpht.com/_1xChIhrNQN0/TcBkoBuEvyI/AAAAAAAAAqI/dB2s8UWjxlY/circular_thumb%5B1%5D.png?imgmax=800" width="412" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Luckily I have a tool that takes an Excel spreadsheet and parses Excel 
