D(0)  -- the weight matrix W
       0    3    8  inf   -4
     inf    0  inf    1    7
     inf    4    0  inf  inf
       2  inf   -5    0  inf
     inf  inf  inf    6    0

D(1)
       0    3    8  inf   -4
     inf    0  inf    1    7
     inf    4    0  inf  inf
       2    5   -5    0   -2
     inf  inf  inf    6    0

D(2)
       0    3    8    4   -4
     inf    0  inf    1    7
     inf    4    0    5   11
       2    5   -5    0   -2
     inf  inf  inf    6    0

D(3)
       0    3    8    4   -4
     inf    0  inf    1    7
     inf    4    0    5   11
       2   -1   -5    0   -2
     inf  inf  inf    6    0

D(4)
       0    3   -1    4   -4
       3    0   -4    1   -1
       7    4    0    5    3
       2   -1   -5    0   -2
       8    5    1    6    0

D(5)
       0    1   -3    2   -4
       3    0   -4    1   -1
       7    4    0    5    3
       2   -1   -5    0   -2
       8    5    1    6    0

Johnson's potentials h(v):  h(1)=0  h(2)=-1  h(3)=-5  h(4)=0  h(5)=-4

reweighted edges  w'(u,v) = w(u,v) + h(u) - h(v):
   1->2=4  1->3=13  1->5=0  2->4=0  2->5=10  3->2=0  4->1=2  4->3=0  5->4=2  

Johnson's answer
       0    1   -3    2   -4
       3    0   -4    1   -1
       7    4    0    5    3
       2   -1   -5    0   -2
       8    5    1    6    0

Floyd-Warshall and Johnson agree on every entry: yes
