2

How do you go about solving the following problem that tries to match the greatest number of clients with servers with constraints? I'm trying to identify an algorithm or simulation that could help me solve this problem as optimally as possible.

Assume you are given a 2d map of servers and clients randomly scattered. Each server can handle a certain radius of clients but never two clients that are near each other (this is the constraint). While it makes sense for a server to handle all the clients near it, some clients may need to be handled by another server nearby. Picking which of those clients should be handled by another server (potentially farther but still in reach) such that the maximum number of clients can be handled is the objective.

Not all clients necessarily can be handled, but the problem should be able to match the most number of clients with servers possible, and the constraint must be upheld.

1 Answers1

1

The problem is NP-hard. Consider the following special case: there is only one server, and its radius is infinite (or very large). Then your problem becomes the problem of finding an independent set in a planar graph. That problem is known to be NP-hard. Since a special case of your problem is NP-hard, then your problem must be at least as hard in the general case.

There are many ways to deal with NP-hard problems. Probably one reasonable approach is to formulate your problem as integer linear programming, and then solve with an off-the-shelf ILP solver. Another approach is to formulate it as an instance of SAT (with a pseudoboolean constraint/cardinality constraint for counting the number of clients that are serviced), and solve with an off-the-shelf SAT solver, like Z3 (which has good support for pseudoboolean constraints).

D.W.
  • 167,959
  • 22
  • 232
  • 500