This Project implements 4 algorithms on HyperGraphs from [1] - HyperBFS, HyperBPath, HyperSSSP, HyperPageRank in CUDA. The standard serial implementation in C++ can be accessed at [2] which is the official github repository for the paper [1]. This project provides a parallel implementation to run on GPUs.
cdto thesrc/directory and runmaketo compile the CUDA code.- To test the code run the command:
./main $(ALG) ../testcases/winput1.txt ../testcases/output.txtwhere ALG can be any of - BFS, BPath, SSSP, PageRank. - The input
testcases/have two types of HyperGraphs normal and weighted. Use only weighted HyperGraphs (winput*.txt) for running CUDA code. - For compiling the sreial code,
cdtoligra/apps/hyper/and run themakecommand. - In the
ligra/apps/hyper/directory, run the command./Hyper$(ALG) ../../../testcases/input1.txtfor testing serial code. For SSSP use weighted inputs (winput*.txt), otherwise use normal inputs (input*.txt). - BFS and BPath are randomised by parallelisation so you cannot compare outputs for them. You can compare the outputs of SSSP and PageRank by looking at the generated files in the
testcases/directory -output.txtfor the CUDA implementation output andHyper$(ALG)_output.txtfor the serial implementation output. - You can generate additional testcases by using the graph generators provided by ligra.
cdtoligra/utils/and runmake. Run the command./randHypergraph -nv <number of vertices> -nh <number of HyperEdges> -c <cardinality of each HyperEdge> ../../testcases/input*.txtto generate normal HyperGraphs and./adjHypergraphAddWeights ../../testcases/input*.txt ../../testcases/winput*.txtto generate corresponding weighted HyperGraphs.
[1] Julian Shun. 2020. Practical parallel hypergraph algorithms. In Proceedings of the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '20). Association for Computing Machinery, New York, NY, USA, 232–249. DOI:https://doi.org/10.1145/3332466.3374527