Greedy algorithm WeShip2You Inc., a transportation company that ships oversized goods between Kuala Lumpur and Singapore has approached you to develop an optimised scheduling solution for their shipping needs. The daily volume of oversized goods that needs to be shipped is high but there are only 5 trucks available for shipment. In addition, each truck has a fixed limit W- the maximum amount of weight they are allowed to carry. For simplicity, you may assume that the maximum load each truck can carry is the same. Oversized goods arrive at the Kuala Lumpur warehouse one by one, and each oversized parcel i has a weight wt. The space in the loading station is small. So, at most one truck can be at the loading station at any one time. Company policy requires that oversized goods are shipped in the order that they arrive to the warehouse as the oversized goods contain perishable items. However, occasionally, the company receives oversized goods with high or low priority for shipment. Oversized goods with high priority will be prioritized for shipment while oversized goods with low priority may be queued for shipment at the end of the day. Build a greedy algorithm solution that will help the logistics personnel optimise the number of oversized goods that may be shipped in any given day.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

using greedy algorithm, write a c++ code 

ONLY C++ code

b. Sample Input: The user should be allowed to input the following information:
i. Maximum weight a truck is allowed to carry
ii. Number of oversized items to ship for the day
iii. Weight of each oversized item
iv. Priority status for oversized item (if applicable)


Sample Output:
i. Oversized items that were loaded into each truck
ii. Amount of unused space (weight) for each truck
iii. Number of trucks that were not utilized/loaded (if any)
iv. List of oversized items that could not be shipped (including priority status, if applicable)

Greedy algorithm - Scheduling
WeShip2You Inc., a transportation company that ships oversized goods between Kuala Lumpur
and Singapore has approached you to develop an optimised scheduling solution for their shipping
needs. The daily volume of oversized goods that needs to be shipped is high but there are only 5
trucks available for shipment. In addition, each truck has a fixed limit W - the maximum amount
of weight they are allowed to carry. For simplicity, you may assume that the maximum load each
truck can carry is the same. Oversized goods arrive at the Kuala Lumpur warehouse one by one,
and each oversized parcel i has a weight wt. The space in the loading station is small. So, at most
one truck can be at the loading station at any one time. Company policy requires that oversized
goods are shipped in the order that they arrive to the warehouse as the oversized goods contain
perishable items. However, occasionally, the company receives oversized goods with high or low
priority for shipment. Oversized goods with high priority will be prioritized for shipment while
oversized goods with low priority may be queued for shipment at the end of the day. Build a greedy
algorithm solution that will help the logistics personnel optimise the number of oversized goods
that may be shipped in any given day.
Transcribed Image Text:Greedy algorithm - Scheduling WeShip2You Inc., a transportation company that ships oversized goods between Kuala Lumpur and Singapore has approached you to develop an optimised scheduling solution for their shipping needs. The daily volume of oversized goods that needs to be shipped is high but there are only 5 trucks available for shipment. In addition, each truck has a fixed limit W - the maximum amount of weight they are allowed to carry. For simplicity, you may assume that the maximum load each truck can carry is the same. Oversized goods arrive at the Kuala Lumpur warehouse one by one, and each oversized parcel i has a weight wt. The space in the loading station is small. So, at most one truck can be at the loading station at any one time. Company policy requires that oversized goods are shipped in the order that they arrive to the warehouse as the oversized goods contain perishable items. However, occasionally, the company receives oversized goods with high or low priority for shipment. Oversized goods with high priority will be prioritized for shipment while oversized goods with low priority may be queued for shipment at the end of the day. Build a greedy algorithm solution that will help the logistics personnel optimise the number of oversized goods that may be shipped in any given day.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY