README

There are two source files in the direcotry: bellmanPar.hs and generateGraph.hs.

To compile generateGraph.hs, enter stack ghc -- -O2 -threaded -rtsopts -eventlog bellmanPar.hs
To compile bellmanPar.hs, enter stack ghc -- -O2 -threaded -rtsopts -eventlog generateGraph.hs

After compilation, we can generate graphs by for example entering ./generateGraph 100 10 "graph1" which will output graph1-graph.txt containing the graph, graph1-cycle.txt containing the negative weight cycle, and graph1-weight.txt containing the weight (in positive number; that is, the weight of the negative cycle is -1 * the integer in graph1-weight.txt) of the negative weight cycle.

Enter for example ./bellmanPar 6 2 graph1-graph.txt +RTS -s -N8 to run the parallel Bellman-Ford algorithm. The first argument specifies the version of the algorithm to be used: 1 for V1, 2 for V2, 3 for V2-list, 4 for V2-vector, 5 for V3-list, and 6 for V3-vector. For all other integers, the program will use V1. The second argument specifies the depth to be used for V2-list, V2-vector, V3-list, and V3-vector. It does not matter when the program is instructed to use V1 or V2. The third argument is the name of the text file containing the graph.

Cheers :)

