Question

5. Suggest an algorithm for a search engine that lets you plan travel connections between cities. Its input is a list of possible connections, where each connection is given as

a combination of a starting time, an ending time, a starting location and a destination location. (For example, one such connection could be "a train departing from London at 08:48, arriving in Manchester 10:55".) 1. Describe an algorithm for finding a fastest journey from one city to another, with a given starting time. Note that a journey can consist of many connections. [15 marks] 2. Explain how to adjust your algorithm to accommodate minimum change overtimes, e.g., when switching from one train to another at least a 20-minute margin should be given, and when switching from one plane to another a margin of at least one hour is required. [10 marks]

Question image 1Question image 2Question image 3