1 forall(v:V)
2 Insert(Q, infty, v);
3 Wähle einen Knoten w:V als Wurzel;
4 DecreaseKey(Q, 0, w);
5 p[w]=nil;
6 while(!Empty(Q)) {
7 (d,u)=DeleteMin(Q);
8 forall((u,v):E)
9 if(v:Q && c(u,v)<v.Key) {
10 DecreaseKey(Q, c(u,v), v);
11 p[v]=u;
12 }