Dataset | airports.txt | routes.txt | test_airports.txt | test_routes.txt | test_data.txt |
---|---|---|---|---|---|
information of airports | information of routes | some artificial airports for test | some artificial routes for test | a comma separated data for test |
Function | Airports | Edges | Airport_graph | BFS | Dijkstra | Pagerank | File_reader |
---|---|---|---|---|---|---|---|
airport class | edge class(using route data) | graph class, build graph with airport as vertex and routes as edges | BFS traversal implementation | Dijkstra implementation | Pagerank implementation | helper function for reading files |
Executable | main | test |
---|---|---|
An execuatble for running all algorithms | An execuatble for running test cases |
- Our program is running under CS225 docker environment. You may find guidance on setting it up it in this tutorial.
Docker File On Your Own Machine
In the directory, you need run the following command:
mkdir build
cd build
cmake ..
- Now you are ready to run the code, pay attention that every command should be run inside build repository
The program can be ran by using the 'main' executable:
make main
./main
- We use datasets from OpenFlights.org. If you want to go on with our program, enter y, else enter q.
Then the user will be given three choices on presenting algorithms. User needs to enter the algorithm's name to run it.
There will be guidance on each algorithm. Generally, user needs to enter the id of airport to find required results. When printing results, our program will also print the name of the airport.
To quit each algorithm, the user needs to enter -1.
- Program can be quitted with entering q after the user is quitted from algorithm with entering -1.
- We have prepared test cases for each function. User needs to use the following command to compile and run it.
make test
./test