Page MenuHomec4science

gurobi.html
No OneTemporary

File Metadata

Created
Sat, Jul 12, 15:05

gurobi.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Using Gurobi with CVX &mdash; CVX Users&#39; Guide</title>
<link rel="stylesheet" href="_static/cloud.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noticia+Text|Open+Sans|Droid+Sans+Mono" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '2.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/jquery.cookie.js"></script>
<script type="text/javascript" src="_static/cloud.js"></script>
<link rel="top" title="CVX Users&#39; Guide" href="index.html" />
<link rel="next" title="Using MOSEK with CVX" href="mosek.html" />
<link rel="prev" title="Credits and Acknowledgements" href="credits.html" />
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="relbar-top">
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="mosek.html" title="Using MOSEK with CVX"
accesskey="N">next</a> &nbsp; &nbsp;</li>
<li class="right" >
<a href="credits.html" title="Credits and Acknowledgements"
accesskey="P">previous</a> &nbsp; &nbsp;</li>
<li><a href="index.html">CVX Users&#39; Guide</a> &raquo;</li>
</ul>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="using-gurobi-with-cvx">
<span id="gurobi"></span><h1>Using Gurobi with CVX<a class="headerlink" href="#using-gurobi-with-cvx" title="Permalink to this headline"></a></h1>
<div class="section" id="about-gurobi">
<h2>About Gurobi<a class="headerlink" href="#about-gurobi" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://www.gurobi.com">Gurobi Optimization</a> was founded in 2008 by some of the most
experienced and respected members of the optimization community. The Gurobi solver quickly became an industry performance leader in linear, quadratic, and mixed-integer programming. Gurobi is a fantastic solver for use with CVX, particularly with the new integer and binary variable capability added in CVX 2.0.</p>
<p>Using CVX with Gurobi requires both a CVX Professional license and a
Gurobi license. Please visit <a class="reference external" href="http://cvxr.com/cvx/licensing">Licensing</a> for information about
CVX licensing, and Gurobi&#8217;s <a class="reference external" href="http://www.gurobi.com/products/licensing-and-pricing/licensing-overview">Licensing Overview</a>
page for information about Gurobi licenses.</p>
<p>Academic users can obtain both licenses at no charge. An academic
CVX Professional license is obtained by submitting an <a class="reference external" href="http://cvxr.com/cvx/academic">Academic License Request</a>.
For instructions on obtaining an academic license for Gurobi, please see
Gurobi&#8217;s <a class="reference external" href="http://www.gurobi.com/products/licensing-and-pricing/academic-licensing">Academic Licenses</a> page.</p>
</div>
<div class="section" id="using-the-bundled-version-of-gurobi">
<span id="gurobilic"></span><h2>Using the bundled version of Gurobi<a class="headerlink" href="#using-the-bundled-version-of-gurobi" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The bundled version of Gurobi can only be used within CVX. If you wish to use Gurobi
outside of CVX as well, you will need a standalone Gurobi installation.</p>
</div>
<p>If you wish to use CVX with the bundled version of Gurobi, you will need three things:</p>
<ul class="simple">
<li>A CVX Professional Solver Bundle, available <a class="reference external" href="http://cvxr.com/cvx/download">here</a>.</li>
<li>A Gurobi license code, which is composed of 32 hexidecimal digits in the format
<tt class="docutils literal"><span class="pre">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</span></tt>. If you purchase a commercial CVX+Gurobi
package, you will receive this code in an email from CVX Research. If you are an
academic user, you will receive it directly from Gurobi.</li>
<li>A CVX Professional license, saved to a convenient location on your local disk.</li>
</ul>
<p>Installation proceeds as follows:</p>
<ul>
<li><p class="first">First, install CVX in the standard manner according to the directions found in
<a class="reference internal" href="install.html#install"><em>Installation</em></a>. Do not attempt to install either license at this stage.</p>
</li>
<li><p class="first">Next, retrieve your Gurobi license key by running the command <tt class="docutils literal"><span class="pre">cvx_grbgetkey</span></tt> <em>{code}</em>,
where <em>{code}</em> is the 32-digit Gurobi key. The command will look something like this:</p>
<div class="highlight-none"><div class="highlight"><pre>cvx_grbgetkey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
</pre></div>
</div>
<p><em>Important note for academic users:</em> this step must be run from a computer
connected to your university network (a VPN is usually sufficient). Please
consult <a class="reference external" href="http://www.gurobi.com/documentation/5.5/quick-start-guide/node9">this page</a>
of the Gurobi documentation for details.</p>
</li>
<li><p class="first">Finally, install your CVX Professional license according to the directions
found in <a class="reference internal" href="install.html#licinstall"><em>Installing a CVX Professional license</em></a>.</p>
</li>
</ul>
<p>If you complete these steps successfully, <tt class="docutils literal"><span class="pre">cvx_setup</span></tt> will add Gurobi to its solver
list. If you have an academic or dual-solver CVX Professional license, the MOSEK solver
will be added to the solver list as well. If for some reason installation fails, the
output of <tt class="docutils literal"><span class="pre">cvx_setup</span></tt> will provide diagnostic information that you can use to rectify
the problem. If you are still unable to complete the installation, feel free to contact
<a class="reference external" href="http://support.cvxr.com/">CVX Support</a>.</p>
</div>
<div class="section" id="using-cvx-with-a-standalone-gurobi-installation">
<span id="gurobistandalone"></span><h2>Using CVX with a standalone Gurobi installation<a class="headerlink" href="#using-cvx-with-a-standalone-gurobi-installation" title="Permalink to this headline"></a></h2>
<p>If you wish to use CVX with a standalone installation of Gurobi, you will
need the following four things:</p>
<ul class="simple">
<li>A Gurobi installation package, or a pre-existing Gurobi installation.
CVX works with Gurobi 5.0 or later, but use
of the latest version is always recommended.</li>
<li>A Gurobi license code or key file, if you are installing Gurobi for the first time.</li>
<li>A standard CVX package, available <a class="reference external" href="http://cvxr.com/cvx/download">here</a>.
You do not need the Professional Solver bundle.</li>
<li>A CVX Professional license, saved to a convenient location on your local disk.</li>
</ul>
<p>Installation proceeds as follows:</p>
<ul class="simple">
<li><em>Install Gurobi</em>. See <a class="reference external" href="http://www.gurobi.com/documentation/5.5/quick-start-guide/node1">Downloading and Installation</a>
from the Gurobi Quick Start Guide.</li>
<li><em>Install the Gurobi license.</em> See <a class="reference external" href="http://www.gurobi.com/documentation/5.5/quick-start-guide/node5">How to Obtain and Install a Gurobi License</a>.</li>
<li><em>Connect your Gurobi installation to MATLAB.</em> See <a class="reference external" href="http://www.gurobi.com/documentation/5.5/quick-start-guide/node120">Setting up Gurobi for MATLAB</a>.</li>
<li><em>Install CVX and/or the CVX Professional license</em>. See <a class="reference internal" href="install.html#install"><em>Installation</em></a> and <a class="reference internal" href="install.html#licinstall"><em>Installing a CVX Professional license</em></a>.
Even if these have already been installed, you <em>must</em> at least re-run <tt class="docutils literal"><span class="pre">cvx_setup</span></tt>
so that CVX can locate Gurobi and add it to your solver list.</li>
</ul>
<p>If you complete these steps successfully, <tt class="docutils literal"><span class="pre">cvx_setup</span></tt> will show that Gurobi has been
recognized and added to the solver list. If for some reason installation fails, the
output of <tt class="docutils literal"><span class="pre">cvx_setup</span></tt> will provide diagnostic information that you can use to rectify
the problem. If you are still unable to complete the installation, feel free to contact
<a class="reference external" href="http://support.cvxr.com/">CVX Support</a>.</p>
</div>
<div class="section" id="selecting-gurobi-as-your-default-solver">
<h2>Selecting Gurobi as your default solver<a class="headerlink" href="#selecting-gurobi-as-your-default-solver" title="Permalink to this headline"></a></h2>
<p>Even if Gurobi is successfully added to your solver list, it will not automatically
be selected as your default solver. To change this, type the following two commands
on the MATLAB command line:</p>
<div class="highlight-none"><div class="highlight"><pre>cvx_solver gurobi
cvx_save_prefs
</pre></div>
</div>
<p>The first command changes the active solver to Gurobi, but only for the current session.
The second line saves that change to CVX&#8217;s preference file, so that Gurobi will be
selected as the active solver every time you start MATLAB.</p>
</div>
<div class="section" id="obtaining-support-for-cvx-and-gurobi">
<h2>Obtaining support for CVX and Gurobi<a class="headerlink" href="#obtaining-support-for-cvx-and-gurobi" title="Permalink to this headline"></a></h2>
<p>If you encounter problems using CVX and Gurobi, please contact
<a class="reference external" href="http://support.cvxr.com/">CVX Support</a> first instead of Gurobi Optimization.
If we can reproduce your problem, we will determine whether or not it is an
issue that is unique to CVX or needs to be forwarded to Gurobi for further
analysis.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html" title="index">
<img class="logo" src="_static/cvxrlogo.png" alt="Logo"/>
</a></p><div class="sphinxlocaltoc">
<h3><a href="index.html">Page contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Using Gurobi with CVX</a><ul>
<li><a class="reference internal" href="#about-gurobi">About Gurobi</a></li>
<li><a class="reference internal" href="#using-the-bundled-version-of-gurobi">Using the bundled version of Gurobi</a></li>
<li><a class="reference internal" href="#using-cvx-with-a-standalone-gurobi-installation">Using CVX with a standalone Gurobi installation</a></li>
<li><a class="reference internal" href="#selecting-gurobi-as-your-default-solver">Selecting Gurobi as your default solver</a></li>
<li><a class="reference internal" href="#obtaining-support-for-cvx-and-gurobi">Obtaining support for CVX and Gurobi</a></li>
</ul>
</li>
</ul>
</div>
<div class="sphinxprev">
<h4>Previous page</h4>
<p class="topless"><a href="credits.html"
title="Previous page">&larr; Credits and Acknowledgements</a></p>
</div>
<div class="sphinxnext">
<h4>Next page</h4>
<p class="topless"><a href="mosek.html"
title="Next page">&rarr; Using MOSEK with CVX</a></p>
</div>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/gurobi.txt"
rel="nofollow">Show Source</a></li>
</ul><h3>Other links</h3>
<ul class="this-page-menu">
<li><a href="CVX.pdf" target="_blank">Download the PDF</a></li>
<li><a href="http://cvxr.com/cvx">CVX home page</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="relbar-bottom">
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="mosek.html" title="Using MOSEK with CVX"
>next</a> &nbsp; &nbsp;</li>
<li class="right" >
<a href="credits.html" title="Credits and Acknowledgements"
>previous</a> &nbsp; &nbsp;</li>
<li><a href="index.html">CVX Users&#39; Guide</a> &raquo;</li>
</ul>
</div>
</div>
<div class="footer">
&copy; Copyright © 2012, CVX Research, Inc..
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
</div>
<!-- cloud_sptheme 1.4 -->
</body>
</html>

Event Timeline