Formulating a particular constraint

44 Views Asked by At

I have a problem setting similar to bin packing but not exactly. I have to put the few boxes of certain dimensions in a square area besides each other. Like a grid. The boxes should be placed around defined point in the working area. So I tried my modeling something like this. This gives me the solution. But, there's a but....but I will come to that later soon.

Pairwise distance between boxes: Getting the minimum distance and later maximizing it to avoid overlapping of two boxes. This is as same as the p-dispersion problem.

\begin{align} dist(b_{a} - b_{b}) >= minBoxBoxDistance \end{align}

Distance to the defined point: For each box, calculate distance to this defined point and place the boxes to somewhere around this point.

\begin{align} dist(b_k - centerPoint) >= minBoxPointDistance \\ distVar= dist(b_k - centerPoint) \end{align}

My objective function is:

\begin{align} minimize(distVar) \end{align}

with this formulation I was able to get the results what I expect. But, only with the square boxes, i.e. equal length and width. When I try with rectangular boxes, some box overlap partially or sometimes fully.

What I tried:

  1. So I tried to change this minBoxBoxDistance value, just by hit and try, but it is not yielding anything good.
  2. Tried Pairwise distance between boxes constraint separately with x-axis and 'y-axis' but then I am only able to fit limited number of boxes, limited to 4 in some cases.

Can anyone help me figure out where I am going wrong? Is there any similar standard optimization problem already?

PS: The pairwise distance between the boxes is not given. The number of boxes to fit is passed to the model and the center point is passed to the model.

Thanks in advance!

1

There are 1 best solutions below

0
On

If box dimensions are given $l,h$ & so are defined points $K$ then you'd need constraints like
$\sum_{i \in S_k} b_i+b_j \le 1$
where $S_k = \{(i,j) \in K: d(i,j) \ge \Vert (l,h) \Vert_2 \}$