Dijkstra algorithm implementation using minheap