Heapsort, Heap, Data Structures, Python, Sorting Algorithms.
minHeap = [(0, start)] # loop through until heap is empty # heap will be empty when all the cities are traversed # once which are reachable from starting city. while minHeap: current_distance, current_city = heapq.heappop(minHeap) # if min distance is already found - do nothing - continue if