Need help with computer science to Find the pseudo-code to optimize this problem.

User Generated

ivpurn7544

Computer Science

Description

Problem 1. (Package Delivery) Tom is working for a delivery company. Every morning, Tom is given a list of n packages to choose those that he wants to deliver within L hours. Each package has a specified arrival time (when it is available to be delivered) and a specified delivery reward. The company requires that one person cannot choose two packages whose arrival times are less than or equal to 3 hours apart.

The problem is to find a subset of packages so as to maximize the total delivery reward, subjecting to this restriction.

Example. Suppose L = 10, n = 4, arrival time list (sorted in increasing order as {t1, t2, t3, t4} = {3, 5, 7, 9}, and delivery reward list as{r1, r2, r3, r4} = {6, 8, 7, 4}, then the optimal solution would be to choose package 1 and 3, for total reward of 13.


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Related Tags