are siblings (bottom), the servers at $n_1$ and $n_2$ are removed, and a new one is created at their parent $n_3$. \[fig:consolidate\] ](img/consolidate "fig:"){width=".22\textwidth"}

The consolidation procedure is depicted in [Fig. \[fig:consolidate\]]{}. It involves two nodes $n_1$ and $n_2$ such that either $n_2$ is $n_1$’s parent, or $n_1$ and $n_2$ are siblings, i.e., have a common parent $n_3$. In both cases, the server(s) at the child(ren) are removed, and all base stations they used to serve are served by the parent. Every time we perform the consolidation procedure, the number of servers deployed in the topology decreases by one unit, at the cost of potentially increasing the latency.

In [Line \[line:pairs1\]]{}–[Line \[line:pairs2\]]{} of [Alg. \[alg:design\]]{}, we construct a set ${\mathcal{P}}$ of pairs of nodes eligible for consolidation, i.e., such that (i) they both have a server, and either (ii) $n_1$ is $n_2$’s parent ([Line \[line:pairs1\]]{}), or (iii) both $n_1$ and $n_2$ have a common parent $n_3$. In [Line \[line:mindist\]]{}, we select the nodes $n_1^\star$ and $n_2^\star$ with the highest score, i.e., the most suitable to consolidate, and call the [**consolidate**]{} procedure with those nodes as an argument. As discussed in [Sec. \[sec:dist\]]{}, different definitions of score can be considered, leading 