Traveling Salesman Problem
In this example, we solve the Traveling Salesman Problem (TSP), which is one of the most famous combinatorial optimization problems. The goal of the TSP is to find the shortest possible route that visits each city once and returns to the original city. We construct a mixed-integer programming (MIP) model of this problem, implement this model in the Gurobi Python API, and compute an optimal solution.
This modeling example is at the advanced level, where we assume that you know Python and the Gurobi Python API and that you have advanced knowledge of building mathematical optimization models. Typically, the objective function and/or constraints of these examples are complex or require advanced features of the Gurobi Python API.
Request a Gurobi Evaluation License or Free Academic License
Modeling examples are coded using the Gurobi Python API in Jupyter Notebook. In order to use the Jupyter Notebooks, you must have a Gurobi License. If you do not have a license, you can request an Evaluation License as a Commercial User or download a free license as an Academic User.
Access the Jupyter Notebook Modeling Example
Click on the button below to be directed to the GitHub HTML page, where you can download the repository Traveling Salesman Jupyter Notebook modeling example.
We’re happy to assist you. Please contact us using this form, and a Gurobi representative will get back to you shortly.
- Free Consultations
- General Inquiries
- Gurobi Optimizer Questions
Can’t view the form? Please email us at firstname.lastname@example.org.