Given a list of elements, say [1,2,3,4]
, and their pair-wise affiliation, say
[[0, 0.5, 1, 0.1]
[0.5, 0, 1, 0.9]
[ 1, 1, 0, 0.2]
[0.1, 0.9, 0.2, 0]]
For those familiar with graph-theory, this is basically an adjacency matrix.
What is the fastest way to sort the list such that the distance in the list best correlates with the pair-wise affiliation, i.e. pairs of nodes with high affiliation should be close to each other.
Is there a way to do this (even a greedy algorithm would be fine) without going too much into MDS and ordination theory?
As a bonus question:
Note that some pair-wise affiliations can be represented perfectly, like for the list [1,2,3]
and a pair-wise affiliation:
[[0, 0, 1]
[0, 0, 1]
[1, 1, 0]]
the perfect order would be [1,3,2]
. But some affiliations can't, like this one:
[[0, 1, 1]
[1, 0, 1]
[1, 1, 0]]
where any order is equally good/bad.
Is there a way to tell the quality of an ordering? In the sense of how well it represents the pair-wise affiliations?