We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8caabf1 commit 2fb4c5aCopy full SHA for 2fb4c5a
include/prim_mst.h
@@ -73,11 +73,12 @@ namespace alg {
73
74
while (!Q.is_empty()) {
75
Heap<uint32_t>::elem e = Q.pop();
76
- Graph::Adjacent * u = g[e.data]; // the vertex to process
+ uint32_t id = e.data;
77
+ Graph::Adjacent * u = g[id]; // the vertex to process
78
Graph::Vertex * v;
79
list_for_each_entry(v, &u->v_head, v_node) {
80
if (Q.contains(v->id) && v->weight < keys[v->id]) {
- pi[v->id] = e.data;
81
+ pi[v->id] = id;
82
Q.decrease_key(v->id, v->weight);
83
keys[v->id] = v->weight;
84
}
0 commit comments