#include #include "heaps/heap.h" #include "heaps/heap_lib.h" #include "dgraph_factory.h" #include "dgraphp_lib.h" #include "dijkstra.h" #include "exp_sp.h" /* Main Program - Runs an Experiment Comparing Different Dijkstra's Algorithm * Implementations * ---------------------------------------------------------------------------- * Author: Shane Saunders */ using namespace std; /* Edge cost settings */ const int MIN_EDGE_COST = 1; const int MAX_EDGE_COST = 10000; int main(void) { /* * graph problem */ SparseGraphEdgesP graphProvider; /* * algorithms */ HeapD fHeapDesc; HeapD ttHeapDesc; HeapD mfHeapDesc; DijkstraDesc fHeapAlgD(&fHeapDesc); DijkstraDesc ttHeapAlgD(&ttHeapDesc); DijkstraDesc mfHeapAlgD(&mfHeapDesc); SpAlgSpec algSpecs[] = { { "fheap", &fHeapAlgD }, { "23heap", &ttHeapAlgD }, { "mfheap", &mfHeapAlgD }, }; int nAlgs = sizeof(algSpecs) / sizeof(SpAlgSpec); /* * graph factory settings */ DGraphFactory *f = DGraphFactory::instancePtr(); f->setEdgeCostRange(MIN_EDGE_COST, MAX_EDGE_COST); /* * run experiment */ SpExperiment exp; exp.run(&graphProvider, algSpecs, nAlgs); }