Home / Expert Answers / Computer Science / consider-the-uncapacitated-facility-location-problem-and-write-a-python-code-to-model-and-solve-it-pa382

(Solved): Consider the uncapacitated facility location problem and write a Python code to model and solve it ...



Consider the uncapacitated facility location problem and write a Python code to model and solve it. To that end, set the numb

Consider the uncapacitated facility location problem and write a Python code to model and solve it. To that end, set the number of customers to 120 and the number of facilities to 10 (these can be easily changed at the beginning of the code). Then, randomly generate the location of all customers and facilities on a grid and plot them. The fixed cost must be generated randomly in . Use the rectilinear method to calculate the distance between nodes (we can think of these facilities to be located in a city). Once the model is solved, plot how each customer is assigned to each facility and report the number of demand points served by each facility. Use Markdown cells to put some explanation before every code cell that you use in Jupyter notebook. Submit your Jupyter notebook file along with your .lp files.


We have an Answer from Expert

View Expert Answer

Expert Answer


Here is a code example to model and solve the uncapacitated facility location problem using the Gurobi optimization solver in Python: import randomimp
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe