Implementation of Dijkstra's algorithm to compute the shortest path on Paris subway network 🚉 --> 🚋 --> 🚉
You can find a python-based implementation for the same database here : https://github.com/IemProg/ParisPathFinder.
Step #1: Install C/C++ compiler and related tools
If you are using Fedora, Red Hat, CentOS, or Scientific Linux, use the following yum command to install GNU c/c++ compiler:
yum groupinstall 'Development Tools'
If you are using Debian or Ubuntu Linux, type the following apt-get command to install GNU c/c++ compiler:
$ sudo apt-get update
$ sudo apt-get install build-essential manpages-dev
Step #2: Verify installation
Type the following command to display the version number and location of the compiler on Linux:
$ whereis gcc
$ which gcc
$ gcc --version
-
Using of compilerflags 🏁 :
-Wall -Wextra -Werror -pedantic -pedantic -errors -O3
of g++ to garanteeC++ norms in the code implementation, optimizing compiling.
-
Using C++ 11 by adding the compilerflag 🏁 :
std=c++11
-
Dynamic memory using STL containers
Use of the csv files as database :
In order to execute the code , two csv files 📄 are provided as database :
s.csv : contains all the stations of paris subway :
c.csv : contains all the connections between the subway stations ( transfer time in seconds )
Use the makefile to compile the cpp files :
Example :
You can check the makefile ☑️
Execute the program :
There are two ways to excute the Network program :
1/ Using Stations Ids :
You can find the 🆔 of the stations in : s.csv file
./Network s.csv c.csv Start_id End_id
Example :
./Network s.csv c.csv 1722 2062
Output :
2/ Using Stations Names :
You can find the names 🔡 of stations in : s.csv file
Note : the code is resistant to spelling errors
./Network s.csv c.csv Start_name End_name
Example :
./Network s.csv c.csv Bastille Jussieu
Output :
- Djahnine Aissam - Profile