d[s]<-0 //d[x]=distance estimate from s to x equal δ(s,x) when x∈S
for each v∈v-{s}
do d[v]<-∞
S<-{}
Q<-V // priority queue keyed on d
while Q≠{}
do u<-Extract-MIN(Q)
S<-S∪{u}
for each v∈Adj{u}
do if d[v]>d[u]+w(u,v) //relaxation
then d[v]<-d[u]+w(u,v)
原文:https://www.cnblogs.com/naturals/p/12764302.html