Jump-Start Your Optimization Discovery

Explore our modeling examples below, access them via GitHub, or download the entire collection. You can also check out examples for other programming languages, or dive into our functional code. MIP developers: Be sure to check out ticdat.

Introductory: Tutorial Example

This tutorial assumes that you know Python and that you have a background in a discipline that uses quantitative methods.

Beginner

These modeling examples assume you know Python and have some knowledge about building mathematical optimization models.

Intermediate

These modeling examples assume that you have some knowledge about building mathematical optimization models. In addition, you should know Python and be familiar with the Gurobi Python API.

Advanced

These modeling examples 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.

  • Difficulty

  • Business Needs

 

Beginner

Cell Tower Coverage Problem

A simple covering problem that builds a network of cell towers to provide signal coverage to the largest number of people possible.

 Learn More

 

Beginner

Combining Machine Learning and Optimization Modeling in Fantasy Basketball

Fantasy sports has turned into a mainstream activity over the last ten to twenty years with leagues now working with popular fantasy sports sites as official partners. If you’re not familiar with fantasy sports, the goal is to select players from a slate of real games to fill out a virtual lineup.

 Learn More

 

Beginner

COVID-19 Facility Capacity Optimization

This COVID-19 Healthcare Facility Capacity Optimization problem shows you how to determine the optimal location and capacity of healthcare facilities.

 Learn More

 

Beginner

Curve Fitting

Try this Jupyter Notebook Modeling Example to learn how you can fit a function to a set of observations. We will formulate this regression problem as a linear programming problem using the Gurobi Python API and then solve it with the Gurobi Optimizer.

 Learn More

 

Beginner

Facility Location Problem

Facility location problems can be commonly found in many industries, including logistics and telecommunications. In this example, we'll show you how to tackle a facility location problem that involves determining the number and location of warehouses that are needed to supply a group of supermarkets. We'll demonstrate how to construct a mixed-integer programming (MIP) model of this problem, implement this model in the Gurobi Python API, and then use the Gurobi Optimizer to find an optimal solution.

 Learn More

 

Beginner

Logic Programming – 3D Tic-Tac-Toe

Try this logic programming example to learn how to solve the problem of arranging X's and O's on a three-dimensional Tic-Tac-Toe board so as to minimize the number of completed lines or diagonals. This example will show you how a binary programming model can be used to capture simple logical constraints.

 Learn More

 

Beginner

Market Sharing

In this example, we'll show you how to solve a goal programming problem that involves allocating the retailers to two divisions of a company in order to optimize the trade-offs of several market sharing goals. You'll learn how to create a mixed integer linear programming model of the problem using the Gurobi Python API and how to find an optimal solution to the problem using the Gurobi Optimizer.

 Learn More

 

Beginner

Marketing Campaign Optimization

Companies across almost every industry are looking to optimize their marketing campaigns. In this Jupyter Notebook, we'll explore a marketing campaign optimization problem that is common in the banking and financial services industry, which involves determining which products to offer to individual customers in order to maximize total expected profit while satisfying various business constraints. You'll learn how to formulate a mathematical optimization model of the problem (using machine learning predictive response models as parameters) and solve it using the Gurobi Optimizer.

 Learn More

 

Beginner

Offshore Wind Farming

In this example, you'll learn how to solve an offshore wind power generation problem. The goal of the problem is to figure out which underwater cables should be laid to connect an offshore wind farm power network at a minimum cost. We'll show you how to formulate a mixed-integer programming (MIP) model of this problem using the Gurobi Python API and then find an optimal solution to the problem using the Gurobi Optimizer.

 Learn More

 

Beginner

Supply Network Design

Try this Jupyter Notebook Modeling Example to learn how to solve a classic supply network design problem that involves finding the minimum cost flow through a network. We'll show you how – given a set of factories, depots, and customers – you can use mathematical optimization to determine the best way to satisfy customer demand while minimizing shipping costs. 

 Learn More

What's
New at Gurobi

News
Gurobi 10.0 Delivers Blazing-Fast Speed, Innovative Data Science Integration, and an Enterprise Development and Deployment Experience
Latest release enables data professionals to easily integrate machine learning models into optimization models to solve new types of problems.
 Learn More
Event
Webinar: What’s New in Gurobi 10.0
In this webinar, attendees will get a first look at our upcoming product release, Gurobi 10.0. We will summarize the performance improvements and highlight some of the underlying algorithmic advances, such as the network simplex algorithm, enhancements in concurrent LP, and optimization based bound tightening.
 Learn More
new content
Cost Savings & Business Benefits for Gurobi Customers
2022 Total Economic Impact™ Study Reveals A 518% ROI with Gurobi
 Learn More