Python Heapq Time Complexity Graph