2
$\begingroup$

Let us have some data $x_i\in\mathbb{R}^2$ for $i=1,\dots,n$. Let $m=1000$. Let a small number is given, e.g. $m=5$.

The goals is to cover $n$ data by $m$ squares of the same size. The size shall be as small as possible.

In the other words $$ \arg\min_{p\in P} a $$ where $$ p = \left(c_{1,1},c_{1,2},\dots,c_{m,1},c_{m,2},a\right)\in\mathbb{R}^{2m+1} $$ are centers of squares and their size. Moreover $$ P=\{p:\forall i=1,\dots,n \; \exists j=1,\dots,m:x_i\in C_j\} $$ where $C_j$ is square given by center $c_{j,1},c_{j,2}$ and size $a$. In the other words, each data point must be covered at least by one square.

My attempt: To use differential evolution to optimize over $P$.

EDIT: Squares cannot be rotated, they are aligned with axes.

$\endgroup$
3
  • 1
    $\begingroup$ Are the squares free rotationally? Or are they, e.g., axis aligned? You may be able to express this as a linear programming problem. $\endgroup$
    – GeoMatt22
    Commented Jan 15, 2017 at 16:58
  • 2
    $\begingroup$ As @Anony-Mousse said, such problems might be near-optimally solved by a greedy approach. One immediate - not tested nor thought over - idea would be complete linkage hierarchical clustering based on Manhattan distance with certain constraints (at least one for sure - since you want squares of the same size). $\endgroup$
    – ttnphns
    Commented Jan 15, 2017 at 17:17
  • $\begingroup$ @ttnphns maximum norm and complete linkage is an interesting idea. But the problem is that an 'optimal' merge at a lower level may prevent you from finding the best solution. E.g. in 1d, we want to cover 0,2,3,4 with 2 clusters. Hierarchical clustering will merge 2 and 3 as best pair. The optimum solution is obviously [0,2],[3,4] and not found by hierarchical clustering. $\endgroup$ Commented Jan 15, 2017 at 21:15

1 Answer 1

1
$\begingroup$

This is not a clustering problem, but a set cover type of problem.

These (but so is k-means) are usually NP-hard, so finding the minimum is usually not feasible. Instead, you usually go with a greedy heuristic, and some iterative refinement to find a local optimum.

OTOH, in 2d, it may be of lower complexity.

The problem with using clustering here is that clustering algorithms like HAC and k-means assume that the closest points must be in the same set. But in a set cover problem, it may be desirable to violate this. Consider the set (-1,-1), (-1,1), (1,-1), (1,1), (-0.1,-0.1), (-0.1,0.1), (0.1,-0.1), (0.1,0.1) to be covered by four squares. Any clustering algorithm will attempt to put the four central points into the same cluster because they are close. The resulting cover will then have an edge length of 1.1. But the optimum cover matches each corner with only one of them (i.e. square edge length 0.9).

So try a greedy initialization (e.g. choose the farthest point from the center, then k-1 times the farthest point from all previous points (minimum to all previous, and use maximum norm). Then assign points so they least increase the required square size. Afterwards, try to move points to other squares if this further improves the result until you cannot further improve. This strategy should be okay as a start, but you will want something more random innthe beginning, so you get more than 1 chance to find the optimum.

$\endgroup$
7
  • $\begingroup$ Could you possibly give me a little bit more information about the greedy heuristic you are mentioning? $\endgroup$ Commented Jan 15, 2017 at 17:16
  • $\begingroup$ The problem could, e.g. be treated similarly to k-means, and you just adapt the EM algorithm to update cluster centers based on minimizing the $L_\infty$ norm rather than the $L_2$ norm. $\endgroup$
    – GeoMatt22
    Commented Jan 15, 2017 at 17:54
  • $\begingroup$ @GeoMatt22 the mean is only L2 optimal. So simply using maximum norm may not even find a local optimum. $\endgroup$ Commented Jan 15, 2017 at 20:12
  • $\begingroup$ @KarelMacek see the Wikipedia articles on set cover for such heuristics. Greedy is a general idea - you can and should try your own. Make an algorithm that makes a good first guess, then improve. $\endgroup$ Commented Jan 15, 2017 at 20:14
  • $\begingroup$ @Anony-Mousse I was saying that squares are $L_\infty$ balls, vs. disks for $L_2$. The "mid-range" would be the analogue of "mean" for the infinity norm. For a given assignment of points to "cluster IDs", the optimization can be done via linear programming (probably would reduce to the above, i.e. cluster-wise mid-range?). The combinatorial part is checking cluster assignments. This is more the "k means" analogy I was attempting. (Does that make more sense?) $\endgroup$
    – GeoMatt22
    Commented Jan 15, 2017 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.