The std::priority_queue creates a binary heap, which is generally quite good, but it may pay off to use a custom implementation of a Fibonacci heap, splay tree, HOT queue, indexed array, hash table, or (similar to the existing HeapSet) combination thereof.