mehulthakral / dijkstra-using-different-heaps

Implemented Dijkstra’s algorithm and compared performance when implemented using fibonacci, binomial and binary heaps in CPP. Ran algorithm on New York’s road network dataset which consisted of around 0.2M nodes and 0.7M edges. Concluded that fibonacci Heap gives performance enhancement on such a large dataset compared to other two heaps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dijkstra-using-different-heaps

Implementing Dijkstra's algorithm which is used to find single source shortest path in both directed and un-directed graphs and comparing performance when implemented with fibonacci, binomial and binary heaps.

Refer AA_report.pdf for dataset and implementation details

Steps to execute

  • g++ main.cpp fibo.cpp binomial.cpp binary.cpp
  • ./a.out < input.txt
large - contains code for New York city's road network(ny.txt)
  • g++ main.cpp my_binary.cpp
  • ./a.out < ny.txt > output.txt

Results

  • Time taken to execute using fibonacci heap on input.txt - 0.126 msec.
  • Time taken to execute using binomial heap on input.txt - 0.145 msec.
  • Time taken to execute using binary heap on input.txt - 0.055 msec.
Time taken to execute using binary heap on ny.txt - 1006.82 msec.
Detailed Results in AA_report.pdf

Conclusion

We are able to show that for a small input graph dijkstra’s algorithm has provided performance boost when implemented using binary heap as compared to binomial and fibonacci heaps.

About

Implemented Dijkstra’s algorithm and compared performance when implemented using fibonacci, binomial and binary heaps in CPP. Ran algorithm on New York’s road network dataset which consisted of around 0.2M nodes and 0.7M edges. Concluded that fibonacci Heap gives performance enhancement on such a large dataset compared to other two heaps.


Languages

Language:C++ 100.0%