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 srcto go to the src folder.g++ -o create_input create_input.cppto compile the code../create_input <input_filepath> <num_vertices> <max_degree_per_vertex>to create a input file folder in theinputfolder. Example:./create_input ../inputs/input2K 2000 30will create a input file with 2000 vertices and maximum degree of 30 per vertex in theinputfolder with nameinput2K.
mkdir build && cd buildto createbuildfolder in the project directory.cmake..to create makefile in thebuildfolder.maketo compile the code../gpu_project <algorithm> <input_size>to run the code. Example:./gpu_project dijkstras 1Kwill run dijkstra's algorithm on the input fileinput1Kin theinputfolder. The output will be stored in theoutputfolder with nameoutput1K../gpu_project bellman 1Kwill run bellman-ford algorithm on the input fileinput1Kin theinputfolder. The output will be stored in theoutputfolder 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.
