This code is implementation of shortest path algorithms described in the following paper:
Harish, P., Narayanan, P.J. (2007). Accelerating Large Graph Algorithms on the GPU Using CUDA. In: Aluru, S., Parashar, M., Badrinath, R., Prasanna, V.K. (eds) High Performance Computing – HiPC 2007. https://doi.org/10.1007/978-3-540-77220-0_21
This was my project for the course CSE-560: GPU Computing offered by IIIT-D under the guidance of Dr. Ojaswa Sharma.
- Dijkstra's algorithm
- Bellman-Ford algorithm
cd src
to go to the src folder.g++ -o create_input create_input.cpp
to compile the code../create_input <input_filepath> <num_vertices> <max_degree_per_vertex>
to create a input file folder in theinput
folder. Example:./create_input ../inputs/input2K 2000 30
will create a input file with 2000 vertices and maximum degree of 30 per vertex in theinput
folder with nameinput2K
.
mkdir build && cd build
to createbuild
folder in the project directory.cmake..
to create makefile in thebuild
folder.make
to compile the code../gpu_project <algorithm> <input_size>
to run the code. Example:./gpu_project dijkstras 1K
will run dijkstra's algorithm on the input fileinput1K
in theinput
folder. The output will be stored in theoutput
folder with nameoutput1K
../gpu_project bellman 1K
will run bellman-ford algorithm on the input fileinput1K
in theinput
folder. The output will be stored in theoutput
folder with nameoutput1K
.
Excellent speedups were obtained in comparison to CPU implementation.
Speedups achieved by GPU and GPU with grid strides over different numbers of vertices by Bellman-Ford algorithm:
Speedups achieved by GPU and GPU with grid strides over different numbers of vertices by Dijkstra's algorithm.