Dijkstra's shortest path implemented with heap structure