Question: INDR 2 2 0 : Introduction to Computing for Operations Research Homework 3 : The Cell Tower Coverage Problem In this homework, you will implement

INDR 220: Introduction to Computing for Operations Research
Homework 3: The Cell Tower Coverage Problem
In this homework, you will implement a Python script that solves the cell tower coverage
problem using CPLEX. A telecom company needs to build a set of cell towers to provide signal
coverage for the inhabitants of a given city. H\times W potential locations where the towers could
be built have been identified. The towers have a fixed range (it covers its own region and its
neighboring regions, namely, west, north, east, and south), and only a limited number of them
can be built due to budget constraints. Given these restrictions, the company wishes to provide
coverage to the largest percentage of the population possible. To simplify the problem, the
company has split the area it wishes to cover into H\times W regions, each of which has a known
population. The goal is then to choose which of the potential locations the company should
build cell towers on to provide coverage to as many people as possible.
The decision variables are
x_(ij)={(1 if tower is built in region (i,j),):}
0 otherwise ,
y_(ij)={(1 if region (i,j) is covered by at least one tower, ):}
0 otherwise
and the given information includes
H= height of city
W= width of city
T= maximum number of towers
p_(ij)= population in region (i,j)
The integer linear programming formulation of this problem becomes
ma\xi mizez=\sum_(i=1)^H \sum_(j=1)^W p_(ij)y_(ij)
subject to: x_(ij)+\sum_((k),l)in neighbors (i,j)x_(kl)>=y_(ij),i=1,2,dots,H;,j=1,2,dots,W
\sum_(i=1)^H \sum_(j=1)^W x_(ij)=T
x_(ij)in{0,1},i=1,2,dots,H;,j=1,2,dots,W
y_(ij)in{0,1},i=1,2,dots,H;,j=1,2,dots,Wp_(ij) H rows and W columns, and it is composed of the following lines for an example problem: import scipy.sparse as sp
import cplex as cp
def mixed_(i)nteger_(l)inear_(p)rogramming(direction, A, senses, b, c, l, u, types, names):prob = cp.Cplex()prob.variables.add(obj = c.tolist(), lb = l.tolist(), ub = u.tolist(), types = types.tolist(), names = names.tolist)if direction == "maximize":
prob.objective.set_(s)ense(prob.objective.sense.maximize)
else:
prob.objective.set_(s)ense(prob.objective.sense.minimize)prob.linear_(c)onstraints.add(senses = senses.tolist(), rhs = b.tolist())row_(i)ndices, col_(i)ndices = A.nonzero()
prob.linear_(c)onstraints.set_(c)oefficients(zip(row_(i)ndices.tolist(), col_(i)ndices.tolist(), A.data.tolist()))
print(prob.write_(a)s_(s)tring())prob.solve()print(prob.solution.get_(s)tatus())
print(prob.solution.status[prob.solution.get_(s)tatus()])x_(s)tar = prob.solution.get_(v)alues()
obj_(s)tar = prob.solution.get_(o)bjective_(v)alue()
return(x_(s)tar, obj_(s)tar) def cell_(t)ower_(c)overage_(p)roblem(populations_(f)ile, T):your implementation ends above
return(X_(s)tar)
X_(s)tar = cell_(t)ower_(c)overage_(p)roblem("populations.txt",3)
print(X_(s)tar)
INDR 2 2 0 : Introduction to Computing for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!