A B C D E F
A 0 10 ~ ~ 7 ~
B 10 0 6 ~ 12 ~
C ~ 6 0 4 0 ~
D ~ ~ 4 0 4 ~
E 7 12 0 4 0 5
F ~ ~ ~ ~ 5 0
where A == 0, B == 1 etc as indexes into matrix.
And diagonal can be 0 or 1 or ~ depending on application.