# This is an example of the N-Queens problem, which is a classic combinatorial problem.
# The problem is to place N queens on an N x N chessboard so that no two queens attack each other.
#
# We show how to model the problem as a MIP and solve it using highspy.
# Using numpy can simplify the construction of the constraints (i.e., diagonal).
= 8
=
=
# each row has exactly one queen
# each col has exactly one queen
=
# each diagonal has at most one queen
# each 'reverse' diagonal has at most one queen
=