-
Notifications
You must be signed in to change notification settings - Fork 0
This program utilizes an iterative backtracking algorithm, and takes an input data file of all flights in various cities, and generates an undirected graph to map out the connections. Then, it takes a second input file for requested trips (City A to B), and generates the most efficient flight travels, based on the user's preference of time or cost.
License
pranavn21/Flight-Plan
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
To run this program, enter the following commands in the terminal: g++ -o flightPlan flightPlan.cpp ./flightPlan input.txt PathsToCalculateFile.txt output.txt Make sure to move the input files to the same directory as the source code files. The example input.txt (and input2.txt) + PathsToCalculateFile.txt generate the given output file to show an example of the program's output. The program can display the most efficient route of flight(s) based on time or cost efficiency. Project Report: To start, the project involved using several data structures learned throughout the course. As the instructions stated, we were using linked lists (linked lists of linked lists, specifically) to create an adjacency matrix to see what flight paths were possible. We were also using stacks to keep track of the flight paths and time/cost information. Together, this would allow us to use the iterative backtracking algorithm required for this project. I had to research what the iterative backtracking algorithm exactly was, and how it worked. I found a presentation that explained it with an example of the “N-Queens” problem, and it showed how this algorithm (along with using stacks) allowed us to create a non-recursive algorithm. One of the main challenges aside from implementing the algorithm itself was how to take the input, dissect it into separate variables, and then print it on another file (instead of the usual print to command line). As this algorithm is meant to be exhaustive, meaning it will try to find all possible flight paths and then only decide the best option (based on if the user wants least cost/least time), this may mean it won’t be the best in performance, as compared to a “efficient” or non-exhaustive algorithm.
About
This program utilizes an iterative backtracking algorithm, and takes an input data file of all flights in various cities, and generates an undirected graph to map out the connections. Then, it takes a second input file for requested trips (City A to B), and generates the most efficient flight travels, based on the user's preference of time or cost.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published