mp#

A Party Scheduling Problem with FICO Xpress#

party1.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: A scheduling problem for visitor-host assignments. Feasibility version (no objective function). Demonstrates high-level modeling in AMPL MP, AMPL Python API, and tuning in FICO Xpress

CP-style scheduling model with the numberof operator, solved by a MIP solver#

sched_numberof.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Scheduling model with the Constraint Programming numberof operator, solved with a MIP solver. New MIP solver drivers based on the [MP library](https://amplmp.readthedocs.io/) enable CP-style modeling.

Containers scheduling#

containers_scheduling.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Scheduling model for harbor operations. It is a problem with dependences between containers, which should be dispatch the fastest possible. We are using the MP solver interfaces to model a complex system using techniques from Constraint Programming, such as indicator constraints, and logical or and forall operators. After the model is written, a couple instances are presented and Highs/Gurobi MIP solvers are used to tackle the problem.

Diagnose infeasibility#

diagnose_infeasibility.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: This notebook demonstrates how to deal with infeasible models.

Formula 1 Scheduling and Routing Optimization#

f1_scheduling_routing.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: A notebook that tackles the Formula 1 Calendar as a routing and a scheduling problem, minimizing total distance between races whilst also assigning a spot in the calendar respecting scheduling constraints using MP

Labs scheduling#

labs_scheduling.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Model for laboratories scheduling. Some labs are needed to handle requests from researchers, and departments have to assign labs and locations to the requests.

Magic sequences#

magic_sequences.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Solving magic sequences through reinforced formulations and constrained programming. Some comparison between models and solvers is done, and we look into the “Another solution” problem for these sequences.

N-Queens#

nqueens.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: How can N queens be placed on an NxN chessboard so that no two of them attack each other?

Paintshop Color Change Scheduling with FICO Xpress#

color_change_scheduling.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: A scheduling problem demonstrating high-level modeling and manual solver tuning in FICO Xpress

Portfolio Optimization: Factor Model#

portfolio_factor_model.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Mean-Variance Portfolio Optimization model where the risk estimator is not given explicitly but is instead represented by a factor model, as is common in US equity models [1]. The original notebook is [3].

Retrieve Solution pool with AMPL and Gurobi#

solution_pool.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: This notebook describes how to retrieve multiple solutions from the solver’s solution pool. Optimization problems usually have several optimal solutions, one is returned by the solver but the others are discarded. These alternative solutions can also be retrieved by AMPL.

Solution check: discontinuous objective function#

sol-check.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Pathological examples to illustrate MP solution checker and settings

Unit Commitment MINLP with Knitro#

unit_commitment_minlp_mp2nl.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Solving a nonlinear Unit Commitment problem with Knitro using MP features for logic and multi-objective optimization. The goal of this notebook is to show a straightforward and clear way of using nonlinear solvers for complex models with logical expressions and also hierarchical multi-objective optimization.

Using multiple objectives in your model#

emulate_multiobjective.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: We show how to use multiple objectives with Amplpy using a nonlinear Unit Commitment problem. We won’t be using native or emulated features from the solver interface, but emulating manually a lexicographic multiobjective problem.

Vehicle Routing Problem with Fair Profits and Time Windows (VRP-FPTW)#

vrp_fptw.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: This notebook implements and solves the Vehicle Routing Problem with Fair Profits and Time Windows (VRP-FPTW), a realistic and recent extension of the classical VRP problem.

Warehouse location and transport#

warehouse_location.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Model for warehouse allocation. Farms (suppliers) send feedstock to warehouses, and later on, those warehouses send it to a production plant. The problem involves modeling a storage facility location problem with a transportation component to the final plant.

Warm start solvers with snapshot#

snapshot.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: We show how to warm start a solver with a previous solution. A nonlinear Unit Commitment problem is being used as example. We will use the “snapshot” feature for this matter.