Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is about stable matching. Peripatetic Shipping Lines, inc., is a shipping company that owns n ships and provides service to n ports. Each

This question is about stable matching.

Peripatetic Shipping Lines, inc., is a shipping company that owns n ships and provides service to n ports. Each of its ships has a schedule that says, for each day of the month, which of the ports its currently visiting, or whether its out at sea. (You can assume the month here has m days, for some m > n.) Each ship visits each port for exactly one day during the month. For safety reasons, PSL Inc. has the following strict requirement:

() No two ships can be in the same port on the same day.

The company wants to perform maintenance on all the ships this month, via the following scheme. They want to truncate each ships schedule: for each ship Si, there will be some day when it arrives in its scheduled port and simply remains there for the rest of the month (for maintenance). This means that Si will not visit the remaining ports on its schedule (if any) that month, but this is okay. So the truncation of Sis schedule will simply consist of its original schedule up to a certain specified day on which it is in a port P; the remainder of the truncated schedule simply has it remain in port P.

Now the companys question to you is the following: Given the schedule for each ship, find a truncation of each so that condition () continues to hold: no two ships are ever in the same port on the same day. Show that such a set of truncations can always be found, and give an algorithm to find them. Solve this problem by reducing it to the Stable matching problem.

My answer is:

Proof: Suppose there are ship1, ship2 and ship 3, and they match port1, port 2 and port 3. All ships should in ports every day. Set the number of days is 4, which satisfied the requirements that M>N. We assume that ship1 and ship2 are in the same port, the port1 and ship3 in port3 on the Day1. On the Day2, ship1 in port2, ship 2 in port3, and ship 3 in port1. On the day3, ship1 on the port3; ship2 and ship3 have to in port2. On the day4, they remain on their ports as Day3. As the instance shows above, if we set two ships(N: 1, 2, 3n) on the same ports on the same day, it results in the Mn day that there will be two ships on the same port. According to the requirement of the schedule of ships, "No two ships can be in the same port on the same day." Strict regulatory control of the schedule of ships, the output will be no two ships are ever in the same port on the same day.

Please correct my answer and give an algorithm of the question.

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions