If I have an adjacency matrix, how can I find a matrix that has the shortest distance between each pair of nodes? (distance matrix, but the nodes are not in a euclidean space)
I'm trying to implement a Self Organising Map with an arbitrary topology, given by the adjacency matrix, so I want to be able to use the vectors of the the distance matrix to determine how far to move the other nodes in the SOM.
Best Answer
You will want to look at using the Floyd-Warshall Algorithm to solve the all-pairs shortest paths problem.
http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm