A generic priority queue for Python

后端 未结 12 478
面向向阳花
面向向阳花 2020-12-13 03:27

I need to use a priority queue in my Python code, and:

  • am looking for any fast implementations for priority queues
  • optimally, I\'d li
12条回答
  •  佛祖请我去吃肉
    2020-12-13 04:09

    I've not used it, but you could try PyHeap. It's written in C so hopefully it is fast enough for you.

    Are you positive heapq/PriorityQueue won't be fast enough? It might be worth going with one of them to start, and then profiling to see if it really is your performance bottlneck.

提交回复
热议问题