Look at VertexList[Gr]
: the 3rd vertex is not vertex 3
, but vertex 15
. GraphDistanceMatrix
returns its result according to the vertex ordering. You are confusing the names of vertices (which happen to be integers in your graph, but in general they don't need to) with the indices of vertices, i.e. their position in VertexList[Gr]
.
Construct your graph as Graph[Range[15], Land]
to control the vertex ordering.