Priority queues support a 'decrease key' operation (https://en.wikipedia.org/wiki/Priority_queue#Summary_of_running_times), it is needed for a number of best first search type algorithms. It should run in O(log n) time. Does scala.collection.mutable.PriorityQueue support this efficiently?
Looking through the API docs the closest thing I can find is
def update (idx: Int, elem: A) : Unit
Replaces element at given index with a new value.
scala.collection.mutable.PriorityQueue does not support a
To implement a
decrease-key operation, one must augment a typical
PQ implementation with an additional data structure for indexing.
The accepted answer to the post you reference, How to implement O(logn) decrease-key operation for min-heap based Priority Queue, illustrates how to do this.
The Java standard library also does not contain an indexed priority queue.
You can find one Java implemenation on the Princeton Algorithms site.
There is a Scala version of the above located here