constraint-programming#

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

sched_numberof.ipynb Open In Colab Kaggle 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 Kaggle 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.

Magic sequences#

magic_sequences.ipynb Open In Colab Kaggle 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 Kaggle 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?

Simple sudoku solver using logical constraints (with GUI)#

sudoku.ipynb Open In Colab Kaggle Gradient Open In SageMaker Studio Lab
Description: Simple sudoku model with two formulations: as a Constraint Programming problem using the alldiff operator and as a MIP. Note that the CP formulation is more natural but it needs a solver supporting logical constraints or a MIP solver with automatic reformulation support (see [here](https://mp.ampl.com/) for more information).