Table 2.
Procedure maxWeightPath(G,s) | |
For each v in G | 1 |
M(v) = −1 | 2 |
3 | |
M(s) = ∞ | 4 |
Q = V // Add all the vertices in G | 5 |
6 | |
while Q ≠ NULL | 7 |
u = EXTRACT_MAX(Q) | 8 |
for each v in Adj(u) | 9 |
if M(v) < min(M(u),w(u,v)) // M(v) = max(M(v),min(M(u),w(u,v))) | 10 |
M(v) = min(M(u),w(u,v)) | 11 |
12 | |
if M(u) < w(u,v) | 13 |
bottleneck(v) = bottleneck(u) | 14 |
Else | 15 |
bottleneck(v) = (u,v) | 16 |
return bottleneck, M | 17 |