Gurobi Modeling Examples

Explore our modeling examples for the Gurobi Python API

Supply Network Design


Supply Network Design 1

This model is an example of a supply network design problem. Given a set of factories, depots, and customers, the goal is to determine how to satisfy customer demand while minimizing shipping costs. This problem can be regarded as one of finding the minimum cost flow through a network.

This model is example 19 from the fifth edition of Model Building in Mathematical Programming, by H. Paul Williams on pages 273-275 and 330-332.

This example is of beginning difficulty; we assume that you know Python and have some knowledge of the Gurobi Python API and building mathematical optimization models.

View the notebook

Google Colab Link


Supply Network Design 2

This model is an extension of the supply network design problem considered in example 19. Given a set of factories, depots, and customers, the goal of this example is to determine which depots to open in order to minimize overall costs. This extenstion allows the possibility to close some depots and open new ones

This model is example 20 from the fifth edition of Model Building in Mathematical Programming, by H. Paul Williams on pages 275-276 and 332-333

This example is of beginning difficulty; we assume that you know Python and have some knowledge of the Gurobi Python API and building mathematical optimization models.

View the notebook

Google Colab Link


For details on licensing or on running the notebooks, see the overview on Modeling Examples

© Gurobi Optimization, LLC