Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are designing a flight scheduler for an airline AlgorithmAir. You will have access to a list of daily flights, F 1 d o t

You are designing a flight scheduler for an airline AlgorithmAir. You will have access to a list of daily
flights, F1dotsFn, each with a departure airport, departure time, arrival airport, arrival time, and cost,
Fi=(DAi,DTi,AAi,ATi,ci).(Times are measured in minutes after midnight UTC time.)
A passenger can make a flight connection from (DAi,DTi,AAi,ATi,ci) to (DAj,DTj,AAj,ATj,cj) if
and only if AAi==DAj. This connection will have a total layover time of DTj-ATi if 24-(ATi-DTj)DTjATijn{F1,dots,Fn}DADADAnF1dotsFnkP1,dots,PkDAnF1,dots,FnkP1,dots,PnDAPiPiDAATi
or24-(ATi-DTj)ifDTjATi,i.e., the passenger will have to wait until the next day to take flight
j.
(a) Given a list ofn available daily flights {F1,dots,Fn}, a departure airport D and an arrival airport A,
design an algorithm that returns the minimum cumulative layover time among all valid sequences
of flights starting from airport D and ending at airport A.(You can ignore cost for this question.)
(7 points for reasonably efficient correct high level algorithm description (with correctness proof),
5 points for correct time analysis, and 3 points for efficiency of your algorithm.)
(b) You notice that the route from DtoAis very popular and you want to make that particular
route cheaper than itis. There are n available daily flights F1dotsFn that are already running.
There are k potential future flights P1,dots,Pk that the airline is considering to add. You wish
to find exactly one of the potential future flights to make available that will result in the cheapest
sequence of flights from DtoA.
Given a list ofn available daily flights F1,dots,Fn and list ofk potential future daily flights
P1,dots,Pn and a departure airport D and arrival airport A, design an algorithm that returns
the index of the potential future daily flight Pi such that ifPiis included in the list of available
flights, it will result in the minimum cost among all valid sequences of flights from DtoA.
(7 points for reasonably efficient correct high level algorithm description (with correctness proof),
5 points for correct time analysis, and 3 points for efficiency of your algorithm.)
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions