Wednesday, May 15, 2024

Another very small but very difficult global NLP model

The goal of this exercise is to fill a square area [0,250]×[0,100][0,250]×[0,100] with 25 circles. The model can choose the x and y coordinates of the center of each circle and the radius. So we have as variables xi, yi, and ri. The circles placed inside the area should not overlap. The objective is to maximize the total area covered. 

A solution is:


Thursday, May 9, 2024

Modeling surprises

Here is an example where the PuLP modeling tool goes berserk.

In standard linear programming, only , = and constraints are supported. Some tools also allow , which for MIP models needs to be reformulated into a disjunctive constraint. Here is an attempt to do this in PuLP [1]. PuLP does not support this relational operator in its constraints, so we would expect a meaningful error message.

Monday, May 6, 2024

Rounding inside an optimization model

In [1], the question was asked: how can I round to two decimal places inside an optimization model? I.e., yi,j=round(xi,j,2) To get this off my chest first: I have never encountered a situation like this. Rounding to two decimal places is more for reporting than something we want inside model equations. Given that, let me look into this modeling problem a bit more as an exercise.