# A Light Signaling Approach to Node Grouping for Massive MIMO IoT Networks
## 5 Optimization
### Formulation
Constraint (8) ensures that nodes are assigned positions in groups in the order of their dominant directions, that is, a node with a higher angle for its dominant direction may not be placed earlier in a group than a node with a lower angle. The second term on the right-hand side is used to cancel this constraint when a position in a group is empty, that is, not assigned to any node. Such empty positions must occur at the end of the group, thanks to constraint (6). Constraint (9) determines the angular tolerance for each position in each group, up to a maximum of the angular spectrum spread for the node assigned that position. This angular tolerance gives the range within which the node's angular position can be adjusted. Because the nodes are symbolically placed on a circle, in which an angle of \(2\pi\) is equivalent to an angle of 0, the last node in each group must be treated differently. For the purpose of computing the objective, angular differences between each successive pair of nodes in each group are considered, and additionally the angular difference from the last node back around the remainder of the circle to the first node must be included. Constraints (10)-(13) are used to find the angle and angular shift for the last node in each group. The binary decision variable \(m_{g}^{p}\) is set to 1 for the last position in each group, and 0 otherwise. It is not possible to determine in advance which is the last position in any given group, since the groups may have different numbers of nodes assigned to them. Constraint (13) forces only one position in each group to be selected as the last. To make sure the one selected is indeed the last, and to obtain the angle of the node in the last position, constraints (10) and (11) are used. Constraint (10) requires that the angle of the last position in each group \(g\in\mathcal{G}\), \(T_{g}\), be at least as large as all angles in the group \(t_{g}^{p}\). Meanwhile, constraint (11) requires that \(T_{g}\) be no more than the angle of the node selected by the variable \(m_{g}^{p}\). In this way, \(m_{g}^{p}\) can only feasibly be 1 for the last position in the group. Similarly, variable \(S_{g}\) is set to the angular shift of the last node in the group via constraint (12). Next, the angular differences between the nodes in each group need to be computed, in constraints (14)-(16). Constraint (14) sets variable \(d_{g}^{p}\) to be, at most, the angular difference between the nodes at positions \(p\) and \(p+1\) in group \(g\), taking into account their angular tolerances. Since the objective is a maximization function, equality will be achieved here for any angular differences that can affect the objective. Constraint (15) similarly takes the angular difference between the last and first positions in each group, thus closing the circle. Note that the variable \(d_{g}^{p}\) is used for this last angular difference, regardless of whether or not the last occupied position in the group is \(P\) or a lower position, due to the group having fewer than \(P\) nodes assigned to it. Constraint (16) limits all angular differences to be, at most, \(\pi\), since any difference greater than this would imply a smaller angular difference if measured in the opposite direction around the circle. We are now ready to compute the objective function using constraints (17) and (18). These constraints set the objective function value, represented by variable \(B\), to the minimum angular difference of any pair of nodes in any group. Here, again, the last position in each group must be treated separately (constraint (18)). In constraint (17), the second term on the right-hand side cancels the constraint for any positions to which no node has been assigned. Finally, the last three constraints in the formulation provide the domains for each of the decision variables. An example problem instance and solution are shown in \[\quad\sum_{g\in\mathcal{G}}u_{kg}=1, k\in\mathcal{K}\]9 In this instance, six nodes are partitioned into two groups.