Abstract

Dijkstra`s Algorithm is a popular example of a greedy solution to the problem of determining the shortest path. This algorithm calculates the most direct and shortest journey and is majorly used in routing, rail networks, maps, etc. Its application to both directed and undirected graphs has the same goal, which is to determine the path that travels the least distance from the starting node, also known as the origin node, to any other node along the tracks. In this article, we are going to implement an application of this algorithm, but this time with a minor tweak. a travel agency asks for software that can create flight schedules for their customers, and the agent has the access to a database that lists all of the airports and flights. In this scenario, the agent is able to create flight schedules for their customers. In addition to the flight number, the airport of departure and arrival, and the destination, each trip`s times of departure and arrival are listed. The agent is interested in finding out the earliest possible arrival time at the destination, given both the airport of departure and the time at which the trip will begin. It was observed during implementation that, if the method is correctly applied, the overall cost for building every flight priority queue is O(m). For the airport priority queue, the overall cost using a heap is O((n + m) log n))

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call