Consolidate used an array of the size of total_nodes to work, while you only need an array of the size of max degree (Which can't go higher than 2*log n). This made extract_min unneccessarily complex on big graphs.
I was able to improve the runtime on my Prim algorithm from 510 seconds to 5.6 seconds on a graph with 100.000 nodes and 200.000 edges with this small change.
Consolidate used an array of the size of total_nodes to work, while you only need an array of the size of max degree (Which can't go higher than 2*log n). This made extract_min unneccessarily complex on big graphs.
I was able to improve the runtime on my Prim algorithm from 510 seconds to 5.6 seconds on a graph with 100.000 nodes and 200.000 edges with this small change.