While implementing Dijkstra's and Prim's algorithms, we require a priority queue with adjustable priorities. I Understand how an array based implementation of the heap functions, but I don't understand how to make the priorities adjustable. I've read that a hashmap allows this, but I don't understand how.
Can someone please give me a high level description of this implementation using a hashmap using an example. a,b,c,d,e,f have priorities 2,4,0,6,1,9 respectively, how would I keep a track of their indices after insertion into the heap? if b's priority is changed to 8 how would this work?.
Please refer me to any additional material I may require to understand this.