Distance matrix is a by matrix that stores the total distance taken to travel from one node to the other.

Stores distance not weight. If unreachable, distance is infinity.

Notation

Distance matrix is commonly notated as .

Example

abcd
a01034
b2056
c7701
d61690