1. 演算法
Cost Matrix C[i][j]
:為一個nxn矩陣,n=|V|
C[i,j]=⎩⎨⎧邊長,∞,0,if (i, j) existsif (i, j) doesn’t existif i = j
S[i]={0,1,未確定起點到i的shortest path length已確定起點到i的shortest path length
Dist[i]:起點到i的shortest path length
Dist[w]=min{Dist[w], Dist[u]+C[u,w]}
2. 範例
求5到各點的最短路徑?