## 2 Matrix-Based Object Representation
\begin{split} i_{l}&=\left\lfloor i_{r}-\tan\left( \theta\right)\left(c_{W}-j_{r}\right)\right\rceil\\ i_{u}&=\left\lfloor i_{\theta}-\tan\left(\theta \right)\left(c_{W}-j_{\theta}\right)\right\rceil\\ j_{l}&=\left\lfloor j_{r}+\tan\left(\theta \right)\left(r_{H}-i_{r}\right)\right\rceil\\ j_{u}&=\left\lfloor j_{\theta}+\tan\left(\theta \right)\left(r_{H}-i_{\theta}\right)\right\rceil\end{split}  \tag{2}\]  
where the brackets '\(\left\lfloor\right\rceil\)' signify rounding towards the nearest integer. Note that, \(i_{l}\) and \(i_{u}\) are column vectors where \(j_{l}\) and \(j_{u}\) are row vectors. Using the calculated boundary vectors, four constituent matrices can be obtained through the following vector inequalities:  
\[ \begin{split} D_{1}&=\left(r_{H}\geq i_{l}\right),\quad D_{2}=\left(r_{H}<i_{u}\right)\\ D_{3}&=\left(c_{W}\geq j_{l}\right),\quad D_{4}= \left(c_{W}<j_{u}\right)\end{split}  \tag{3}\]  
The final object representation is attained by performing element-by-element multiplication (denoted by operator '\(\circ\)') of calculated constituent matrices:  
\[D=D_{1}\circ D_{2}\circ D_{3}\circ D_{4} \tag{4}\]  
The described approach avoids using loops, which in turn substantially accelerates the computations. Figure 3 demonstrates the constituent matrices and final representation for a sample rectangular object. For circles, the raster approximations can be obtained directly without the need to calculate multiple constituent matrices. Let \(r_{1}\) be a row vector of ones with a length of \(H\), \(c_{1}\) be a column vector of ones with a length of \(W\), and \(I_{1}\) be an \(H\) by \(W\) matrix of ones. Then,  
Figure 3: The constituent matrices (\(D_{1}\), \(D_{2}\), \(D_{3}\), \(D_{4}\)) and resulting representation (\(D\)) for an exemplary rectangle. The final object representation is attained by performing elementwise multiplication of four constituent matrices obtained by using simple vector inequalities. the distance matrices along rows (\(s_{i}\)) and columns (\(s_{j}\)), and resultant distance matrix (\(s\)) can be calculated as follows:  
\[s_{i}=i_{c}I_{1}-r_{H}c_{1},\quad s_{j}=j_{c}I_{1}-r_{1}c_{W},\quad s=\sqrt{s_{i }\circ s_{i}+s_{j}\circ s_{j}} \tag{5}\]  
Finally, the matrix entities lying inside the circle can be filled with ones using the relation:  
\[D(s\leq d/2)=1 \tag{6}\]  
**3. Optimization Problem**  
3.1. Objective Functions  
3.1.1. Total Ones (T1)  
By denoting the number of matrix entities having the value \(k\) with \(N_{k}\), the first objective function is simply defined as the total number of ones in the domain (\(N_{1}\)):  
\[f_{T1}=N_{1} \tag{7}\]  
The maximization of this metric is equivalent to maximally occupying the design space without causing overlaps. However, this technique cannot be used for sequential placement as it would rank all feasible locations identically, thus creating an ill-posed problem. 3.1.2. Distance from the Center (DC)  
As the second objective, the rectilinear (Manhattan) distance between the centers of the objects and domain is maximized. This approach favors filling the areas next to the boundaries starting from the corners. Let the row and column indices of the domain center be \(i_{D}^{o}\) and \(j_{D}^{o}\), respectively. For a rectangle, the central row (\(i_{r}^{o}\)) and column (\(j_{r}^{o}\)) indices can be calculated as  
\[i_{r}^{o}=i_{r}+h/2\cos(\theta)-w/2\sin(\theta),\quad j_{r}^{o}=j_{r}+h/2\sin (\theta)+w/2\cos(\theta) \tag{8}\]  
Using the central indices, the distance function to be maximized is defined as  
\[f_{DC}^{r}=|i_{r}^{o}-i_{D}^{o}|+|j_{r}^{o}-j_{D}^{o}| \tag{9}\]  
For a circular object, the distance function can be written as follows:  
\[f_{DC}^{c}=|i_{c}-i_{D}^{o}|+|j_{c}-j_{D}^{o}| \tag{10}\]  
3.1.3. Distance to the Bottom-Left (DBL)  
The third metric is defined as the rectilinear distance between the objects and the bottom-left corner of the domain. Minimization of this distance has been prevalently used in the previous packing studies [17; 18].