# constraint-programming¶

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

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.Tags: ampl-only, constraint-programming

Author: Gleb Belov (6 notebooks) <gleb@ampl.com>

## Containers scheduling¶

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¶

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.

Tags: constraint-programming, educational, mp, sequences, arithmetic, reinforced-formulations, highs, gecode, cbc, mip

## N-Queens¶

Description: How can N queens be placed on an NxN chessboard so that no two of them attack each other?

Author: Gleb Belov (6 notebooks) <gleb@ampl.com>

## Simple sudoku solver using logical constraints (with GUI)¶

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://amplmp.readthedocs.io/) for more information).