Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5) There is an s miles long road, with n possible locations for advertisements at distances di,...,dn from the beginning of the road. Putting an

image text in transcribed

5) There is an s miles long road, with n possible locations for advertisements at distances di,...,dn from the beginning of the road. Putting an advertise- ment at the i'th location brings in revenue p Two advertisements cannot be located closer than distancel from each other. Find a set of locations for the advertisement bringing in maximal revenue. a) Design a dynamic programming algorithm for this problem. b) Use your algorithm to find the optimal solution for distances 5, 9, 17, 23 revenues 4, 8, 6, 1 and distance 10. Hint: Let r, be the maximal revenue achievable by locations on the first j miles stretch of the road. For every j, let prev(i) be the location preceding d, which is at least distance l from the j'th location. Determine an optimal- ity relation for r, involving these quantities and use it to design a dynamic programming algorithm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions