If there is a graph with N nodes and I'm only given a N*N matrix of the distances from each node to every other (the diagonal is of course 0), what would be the most efficient way of generating a graph with as few edges as possible?
for n = 4 and the matrix
0 1 2 3
1 0 3 4
2 3 0 5
3 4 5 0
only having 3 edges would be enough, all connected to the 1st node.
- the edge from 1 and 2 would have length 1
- the edge from 1 and 3 would have length 2
- the edge from 1 and 4 would have length 3