Solve a Set Covering Problem with CVXPY

Motivation

After simulating real-life events in your restaurant, your restaurant starts to attract more customers so you decided to open chain restaurants at other locations.

Since many customers prefer to eat close by, you want your restaurants to be at most 15 miles away from areas 1, 2, 3, 4, and 5. The optimal solution is to build a minimal number of restaurants that are within 15 miles of all other areas.

Provided that your restaurants can only be placed at areas 1, 2, 3, 4, or 5, which locations should you build your restaurants?

Image by Author

This is called the set covering problem. In this article, you will learn how to solve this problem using CVXPY.

What is CVXPY?

CVXPY is a Python-embedded modeling language for convex optimization problems like the one above. It is similar to PuLP, but its syntax is simpler and more intuitive.

#mathematics #python-programming #optimization #python #how to find best locations for your restaurants with python #find best locations for your restaurants

How to Find Best Locations for your Restaurants with Python
2.50 GEEK