# Help with excel solver

Need help with the following exercise. I am unable to work out the objective function.

After months of closure due to Covid-19, a food court is preparing to re-open for business. However, safe management measures need to be implemented and one of these requires that there must be a distance of at least Dmin = $$4$$ between any two tables occupied by customers. The food court has a total of $$12$$ tables and they may not meet this requirement if all tables are occupied simultaneously. Furthermore, the tables are fixed and cannot be moved, and so there is a need to determine which of the $$12$$ tables can be selected for use so that the maximum number of tables are made available to customers at any time without violating the requirement, while the rest of the tables not selected will be marked with $$X$$s to indicate that they cannot be used. The location of each of the $$12$$ tables is known and specified by its respective $$(X_i, Y_i)$$ positional coordinates measured with respect to some reference point, for $$i = 1, 2,\ldots,12$$, as tabulated below. Which are the tables that should be selected for use? (It can be assumed that all distances and coordinates are expressed in consistent units.)

• Table 1: $$(X=3, Y=17)$$

• Table 2: $$(X=4, Y=8)$$

• Table 3: $$(X=5, Y=4)$$

• Table 4: $$(X=5, Y=14)$$

• Table 5: $$(X=7, Y=6)$$

• Table 6: $$(X=8, Y=12)$$

• Table 7: $$(X=13, Y=7)$$

• Table 8: $$(X=14, Y=5)$$

• Table 9: $$(X=16, Y=13)$$

• Table 10: $$(X=17, Y=4)$$

• Table 11: $$(X=17, Y=10)$$

• Table 12: $$(X=18, Y=15)$$

New contributor
Alibaba123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• Welcome to OR.SE. I'm not sure I really understand your question, therefore, would you say please, what you mean by "the tables are fixed and cannot be moved"? Also, is the food court area predefined (if so, how much is it dimensions?) and do the tables have the same size? What about the dimensions of the tables? – A.Omidi Oct 19 at 5:44
• The tables are fixed and cannot be moved refers to their coordinates do not change. The area of the food court is not defined. To make the question easier, I assume that all the tables have the same size, however the dimensions is not make known to us. Therefore, I assume the Dmin refers to the center distance between 2 tables. – Alibaba123 Oct 19 at 17:47
• Thanks for your explanation. As you mentioned "the tables are fixed", the problem is to find the number of combinations in which the two selected tables have been at least 4 unit of distance. A simple method would be, I assume that the tables are square. Please, see this link. By calculating the distance norm between the center of the tables and round up the results, in $5$ states you cannot select the tables. By removing the red states the rest of the combinations can be used. Is it useful? – A.Omidi Oct 20 at 21:33

This is a maximum independent set problem on a graph with 12 nodes, which you can solve with one binary variable $$z_i$$ per node and one "conflict" constraint $$z_i+z_j \le 1$$ per edge. The objective is to maximize $$\sum_i z_i$$.
• You actually don't need the distances as variables, since the location does not change. So whether table $i$ is selected is given by $z_i\in\{0,1\}$. Then, you can precompute whether the tables $i$ and $j$ are too close to each other (i.e. $D_{i,j} < 4$). If this is the case, then you add the cut that Rob suggested, i.e. $z_i + z_j \leq 1$. – Richard Oct 19 at 6:56