Ctrl/Cmd + P and select "Save as PDF".
Init-Single-Source(G, s) // d[s]=0, others inf
for i = 1 to |V| - 1
for each edge (u, v) in E
Relax(u, v, w)
// Negative cycle detection:
for each edge (u, v) in E
if d[v] > d[u] + w(u, v)
return "Negative cycle exists"
return d[], pi[]n = |V|
D = W // Initialize with edge weights
for k = 1 to n
for i = 1 to n
for j = 1 to n
D[i][j] = min(D[i][j], D[i][k] + D[k][j])
return D