<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>MIP Solver Archives - CenterSpace</title>
	<atom:link href="https://www.centerspace.net/tag/mip-solver/feed" rel="self" type="application/rss+xml" />
	<link>https://www.centerspace.net/tag/mip-solver</link>
	<description>.NET numerical class libraries</description>
	<lastBuildDate>Wed, 30 Dec 2020 18:16:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
<site xmlns="com-wordpress:feed-additions:1">104092929</site>	<item>
		<title>Updated NMath API for LP and MIP related classes</title>
		<link>https://www.centerspace.net/updated-lp-and-mip-classes</link>
					<comments>https://www.centerspace.net/updated-lp-and-mip-classes#respond</comments>
		
		<dc:creator><![CDATA[Paul Shirkey]]></dc:creator>
		<pubDate>Wed, 11 Nov 2020 18:15:12 +0000</pubDate>
				<category><![CDATA[NMath]]></category>
		<category><![CDATA[Google OR-Tools]]></category>
		<category><![CDATA[Linear Programming]]></category>
		<category><![CDATA[LP Solver]]></category>
		<category><![CDATA[MIP Solver]]></category>
		<category><![CDATA[Mixed Integer Programming]]></category>
		<category><![CDATA[MS Solver Foundation]]></category>
		<guid isPermaLink="false">https://www.centerspace.net/?p=8126</guid>

					<description><![CDATA[<p>NMath is moving from Microsoft Solver Foundation to Google OR Tools. This change improves our LP and MIP Solver performance.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/updated-lp-and-mip-classes">Updated NMath API for LP and MIP related classes</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The Linear Programming (LP) and Mixed Integer Programming (MIP) classes in <strong>NMath </strong>are currently built upon the Microsoft Solver Foundation (MSF) library.  However development and maintenance of the library was stopped in January 2017 with the final release of 3.1.0.  With the release of <strong>NMath 7.2</strong> the LP and MIP solver classes will be built on the <a href="https://github.com/google/or-tools">Google OR-Tools</a> library (GORT).  With this change the API has been simplified primarily by reducing the complexity of the algorithm parameterization.  And most importantly to many users, migrating to GORT will free <strong>NMath </strong>users from the MSF variable limits [1].  Finally, GORT is a modern .NET Standard Library and therefore can be used with .NET Framework, .NET Core, and .NET 5 projects, whereas MS Solver Foundation is restricted to NET Framework.</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>MS Solver Foundation</strong></td><td><strong>Google OR-Tools</strong></td></tr><tr><td>Variable Limits</td><td>No Variable Limits</td></tr><tr><td>Requires .NET Framework</td><td>.NET Standard Library</td></tr><tr><td>Unsupported as of January 2017</td><td>Actively Supported</td></tr></tbody></table><figcaption>Key differences between MS Solver Foundation and Google OR-Tools</figcaption></figure>



<p>Beginning with the release of <strong>NMath </strong>7.2 the following table lists the deprecated MS Solver Foundation classes on the left and their Google OR-Tools replacements, if necessary.</p>



<div class="is-layout-flex wp-container-2 wp-block-columns">
<div class="is-layout-flow wp-block-column" style="flex-basis:100%">
<figure class="wp-block-table is-style-stripes"><table><tbody><tr><td>Deprecated</td><td>Replacement</td></tr><tr><td><code>PrimalSimplexSolver</code></td><td><code>PrimalSimplexSolverORTools</code></td></tr><tr><td><code>DualSimplexSolver</code></td><td><code>DualSimplexSolverORTools</code></td></tr><tr><td><code>SimplexSolverBase</code></td><td><code>SimpleSolverBaseORTools</code></td></tr><tr><td><code>SimplexSolverMixedIntParams</code></td><td><em><code>replacement not needed</code></em></td></tr><tr><td><code>SimplexSolverParams</code></td><td><em><code>replacement not needed</code></em></td></tr></tbody></table><figcaption>Deprecated LP and MIP classes in NMath 7.2</figcaption></figure>
</div>
</div>



<h2>API Changes</h2>



<p>The primary change between the deprecated MSF classes and the GORT classes is in the reduced algorithm parameterization.  For example, in the toy MIP problem coded below the only change in the API regards constructing the new GORT solver and the lack of need for the parameter helper class.  Note that the entire problem setup and related classes are unchanged making it a simple job to migrate to the new solver classes.</p>



<div class="is-layout-flex wp-container-4 wp-block-columns">
<div class="is-layout-flow wp-block-column">
<pre class="wp-block-code"><code>  // The problem setup is identical between the new and the deprecated API. 

  // minimize -3*x1 -2*x2 -x3
  var mip = new MixedIntegerLinearProgrammingProblem( new DoubleVector( -3.0, -2.0, -1.0 ) );

  // x1 + x2 + x3 &lt;= 7
  mip.AddUpperBoundConstraint( new DoubleVector( 1.0, 1.0, 1.0 ), 7.0 );

  // 4*x1 + 2*x2 +x3 = 12
  mip.AddEqualityConstraint( new DoubleVector( 4.0, 2.0, 1.0 ), 12.0 );

  // x1, x2 &gt;= 0
  mip.AddLowerBound( 0, 0.0 );
  mip.AddLowerBound( 1, 0.0 );

  // x3 is 0 or 1
  mip.AddBinaryConstraint( 2 );
 
  // Make a new Google OR-Tools solver and solve the MIP
  var solver = new PrimalSimplexSolverORTools();
  solver.Solve( mip, true ); // true -&gt; minimize

  // Solve the same MIP with the old deprecated API
  var solver = new PrimalSimplexSolver();
  var solverParams = new PrimalSimplexSolverParams { Minimize = true };
  solver.Solve( mip, solverParams );</code></pre>



<p><strong>NMath </strong>7.2 is released on <a href="https://www.nuget.org/profiles/centerspace">Nuget </a>as usual.</p>
</div>
</div>



<p class="has-text-align-left"><sub>[1] MS Solver Foundation variable limits: NonzeroLimit = 100000, MipVariableLimit = 2000, MipRowLimit = 2000, MipNonzeroLimit = 10000, CspTermLimit = 25000, LP variable limit = 1000</sub></p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/updated-lp-and-mip-classes">Updated NMath API for LP and MIP related classes</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.centerspace.net/updated-lp-and-mip-classes/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8126</post-id>	</item>
	</channel>
</rss>
