Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Suppose you want to place fast food restaurants at various locations along a highway. For simplicity, let us model the highway as the X-axis.

image text in transcribed

1. Suppose you want to place fast food restaurants at various locations along a highway. For simplicity, let us model the highway as the X-axis. You have a list of potential locations for the fast food restaurants z1,a2, .. . , For each location, you have an estimated revenue 2, However, for environmental reasons, the distance between two fast food restaurants must be at least 20 kilometers, that is for two con secutive fast food restaurants ri and rj, we must have zi20. Design a placement algorithm that will optimize your estimated revenue. For example, if your possible fast food restaurant locations are (2, 17, 24, 32, 48), and your estimated revenue is (9, 22, 11, 2, 12), then your optimal placement is one fast food restaurant at location 17 and one at 48 which gives you an estimated revenue of 22+12-34. It is possible to place a fast food restaurant at locations 2, 24, 48 however, that only gives you an estimated revenue of 9+11+12 = 32 which is less revenue. However, if your estimated revenue is (9, 22, 14, 2, 12), that is the revenue of location 24 is 14 instead of 11, then the optimal solution would be to place the fast food restaurants at 2, 24, 48. (a) Design an algorithm to find a placement that maximizes revenue. (b) Prove your algorithm is correct. (c) Analyze the run time of your algorithm. For full marks, your algorithm should run in O(n) time

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

More Books

Students also viewed these Databases questions

Question

LO4 Specify how to design a training program for adult learners.

Answered: 1 week ago