I have several files containing 3D positions of 10 points (as plotting in corresponding pictures). I would like to use multi-dimensional scaling to find similar orderings and print out different orderings. For example, here ordering from text file 1, 2 and 4 are completely the same, but different from 3.
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.collections import LineCollection
from sklearn import manifold
from sklearn.metrics import euclidean_distances
from sklearn.decomposition import PCA
A1=[[0.000, 0.000, 0.5],
[0.250, 0.000, 0.5],
[0.125, 0.250, 0.5],
[0.375, 0.250, 0.5],
[0.250, 0.500, 0.5],
[0.500, 0.500, 0.5],
[0.125, 0.750, 0.5],
[0.375, 0.750, 0.5],
[0.000, 1.000, 0.5],
[0.250, 1.000, 0.5]]
A2=[[0.500, 0.000, 0.5],
[0.750, 0.000, 0.5],
[0.375, 0.250, 0.5],
[0.625, 0.250, 0.5],
[0.250, 0.500, 0.5],
[0.500, 0.500, 0.5],
[0.375, 0.750, 0.5],
[0.625, 0.750, 0.5],
[0.500, 1.000, 0.5],
[0.750, 1.000, 0.5]]
A3=[[0.500, 0.000, 0.5],
[0.750, 0.000, 0.5],
[0.625, 0.250, 0.5],
[0.875, 0.250, 0.5],
[0.250, 0.500, 0.5],
[0.500, 0.500, 0.5],
[0.375, 0.750, 0.5],
[0.625, 0.750, 0.5],
[0.500, 1.000, 0.5],
[0.750, 1.000, 0.5]]
A4=[[0.250, 0.000, 0.5],
[0.500, 0.000, 0.5],
[0.375, 0.250, 0.5],
[0.625, 0.250, 0.5],
[0.500, 0.500, 0.5],
[0.750, 0.500, 0.5],
[0.375, 0.750, 0.5],
[0.625, 0.750, 0.5],
[0.250, 1.000, 0.5],
[0.500, 1.000, 0.5]]
print(len(A1), len(A2), len(A3), len(A4))
a1=euclidean_distances(A1)
a2=euclidean_distances(A2)
a3=euclidean_distances(A3)
a4=euclidean_distances(A4)
print(a1)
OUTPUT
Number of different orders: 2
A1
A3