Gurobi: Difference between revisions

Jump to navigation Jump to search
No change in size ,  3 months ago
no edit summary
No edit summary
No edit summary
Line 79: Line 79:
Once a Slurm script has been prepared for a Gurobi problem, it can be submitted to the queue by running the <code>sbatch script-name.sh</code> command.  The jobs status in the queue can then be checked by running the <code>sq</code> command.  The following Slurm scripts demonstrate solving 2 problems provided in the <tt> examples</tt> directory of each Gurobi module.
Once a Slurm script has been prepared for a Gurobi problem, it can be submitted to the queue by running the <code>sbatch script-name.sh</code> command.  The jobs status in the queue can then be checked by running the <code>sq</code> command.  The following Slurm scripts demonstrate solving 2 problems provided in the <tt> examples</tt> directory of each Gurobi module.


=== Data Example === <!--T:71-->  
=== Data example === <!--T:71-->  


<!--T:73-->
<!--T:73-->
Line 106: Line 106:
}}
}}


=== Python Example === <!--T:81-->  
=== Python example === <!--T:81-->  


<!--T:83-->
<!--T:83-->
Line 138: Line 138:


<!--T:91-->
<!--T:91-->
Gurobi brings it's own version of Python which does not contain any 3rd-party Python packages except Gurobi.  In order to use Gurobi together with popular Python packages like NumPy, Matplotlib, Pandas and others, we need to create a [[Python#Creating_and_using_a_virtual_environment|virtual Python environment]] in which we can install both <code>gurobipy</code> and for example <code>pandas</code>.  Before we start, we need to decide which combination of versions for Gurobi and Python to use.  A listing of the Python version(s) supported by the major gurobi versions installed in the previous through current standard environments (StdEnv) follows:
Gurobi brings it's own version of Python which does not contain any 3rd-party Python packages except Gurobi.  In order to use Gurobi together with popular Python packages like NumPy, Matplotlib, Pandas and others, we need to create a [[Python#Creating_and_using_a_virtual_environment|virtual Python environment]] in which we can install both <code>gurobipy</code> and for example <code>pandas</code>.  Before we start, we need to decide which combination of versions for Gurobi and Python to use.  A listing of the Python version(s) supported by the major Gurobi versions installed in the previous through current standard environments (StdEnv) follows:


<!--T:201-->
<!--T:201-->
Line 158: Line 158:
As mentioned near the bottom of this official document [http://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python How-do-I-install-Gurobi-for-Python] the previously recommended method for installing Gurobi for Python with <code>setup.py</code> has been deprecated to be only usable with Gurobi 10 versions (and older).  Therefore a new section has been added below which shows how to simultaneously download a compatible binary wheel from [[pypi.org/project/gurobipy|pypi.org]] and convert it into a format usable with a newly recommended command to install Gurobi for Python with Gurobi 11 versions (and newer).
As mentioned near the bottom of this official document [http://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python How-do-I-install-Gurobi-for-Python] the previously recommended method for installing Gurobi for Python with <code>setup.py</code> has been deprecated to be only usable with Gurobi 10 versions (and older).  Therefore a new section has been added below which shows how to simultaneously download a compatible binary wheel from [[pypi.org/project/gurobipy|pypi.org]] and convert it into a format usable with a newly recommended command to install Gurobi for Python with Gurobi 11 versions (and newer).


=== Gurobi Versions 10.0.3 (and older) === <!--T:10-->
=== Gurobi versions 10.0.3 (and older) === <!--T:10-->


<!--T:97-->
<!--T:97-->
Line 201: Line 201:
}}
}}


=== Gurobi Versions 11.0.0 (and newer) === <!--T:11-->
=== Gurobi versions 11.0.0 (and newer) === <!--T:11-->


<!--T:98-->
<!--T:98-->
rsnt_translations
56,430

edits

Navigation menu