Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In a city, located on a straight line, there are n houses and m cell towers. You know the locations of all houses ( h
In a city, located on a straight line, there are houses and cell towers. You know the locations
of all houses dots, and all towers dots, You would like to purchase some towers so that
every house is within a range of some tower; each tower has purchasing cost and the coverage
radius
Thankfully, you also have coupons; when you buy a tower, of you use a coupon, the cost of the
tower is halved and the coupon disappears For each tower, you can apply a coupon only once.
Your goal is to purchase the towers so that:
Each house is covered by some tower formally for each i there exists such that
A house can be covered by more than one tower.
The total cost of purchased towers is minimized.
Note If you solve the problem only for you'll get of the grade.
Please do the following:
Formulate the subproblem. Please state it as precisely as possible.
Design a dynamic programming algorithm for solving this problem:
State the base case.
State the recurrence relation.
Explain why the recurrence relation is correct.
Please provide the pseudocode. Please use the bottomup approach.
Explain:
What is the running time of your algorithm.
How to recover the minimum total cost.
How to recover the set of the purchased towers and which towers are purchased
with coupons You don't need to write a pseudocode.
Why your algorithm correctly handles the case when an optimal solution doesn't
exist.
Example Let house locations be and the towers be
and the number of coupons The optimal
solution is to purchase towers and and apply a coupon to tower This way:
House is covered by tower
Houses and are covered by tower
The cost is which is optimal.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started