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

 

Intermediate

Efficiency Analysis

How can mathematical optimization be used to measure the efficiency of an organization? Find out in this example, where you'll learn how to formulate an Efficiency Analysis model as a linear programming problem using the Gurobi Python API and then generate an optimal solution with the Gurobi Optimizer.

 Learn More

 

Intermediate

Electrical Power Generation

Major electric power companies around the world utilize mathematical optimization to manage the flow of energy across their electrical grids. In this example, you'll discover the power of mathematical optimization in addressing a common energy industry problem: electrical power generation. We'll show you how to figure out the optimal set of power stations to turn on in order to satisfy anticipated power demand over a 24-hour time horizon. 

 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

 

Intermediate

Factory Planning

Want to learn how to create an optimal production plan that will maximize your profits? In this example, we'll teach you how to solve this classic production planning problem. 

 Learn More

 

Advanced

Farm Planning

Cultivate your modeling skills with this example, where you'll learn how to solve a complex, multi-period production planning problem that involves optimizing the operations of a farm over five years. 

 Learn More

 

Intermediate

Food Manufacturing

If you're hungry for a mathematical optimization challenge, then try this food manufacturing problem. You'll learn how to create an optimal multi-period production plan for a product that requires a number of ingredients – each of which has different costs, restrictions, and features.

 Learn More

 

Introductory

Introduction To Mathematical Optimization Modeling

Learn the key components in the formulation of mixed-integer programming (MIP) problems. You will learn how to use the Gurobi Optimizer to compute an optimal solution of the MIP model.

 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

 

Intermediate

Logical Design

This problem is an example of constructing a circuit using the minimum number of NOR gates (devices with two inputs and one output) that will perform the logical function specified by a truth table. This problem is formulated as a binary optimization problem using the Gurobi Python API and solved with the Gurobi Optimizer.

 Learn More

 

Advanced

Lost Luggage Distribution

In this example, you'll learn how to use mathematical optimization to solve a vehicle routing problem with time windows, which involves helping a company figure out the minimum number of vans required to deliver pieces of lost or delayed baggage to their rightful owners and determining the optimal assignment of vans to customers.

 Learn More

 

Advanced

Manpower Planning

Staffing problems – which require difficult decisions about the recruitment, training, layoffs, and scheduling of workers – are common across a broad range of manufacturing and service industries. In this example, you'll learn how to model and solve a complex staffing problem by creating an optimal multi-period operation plan that minimizes the total number of layoffs and costs.

 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

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