algorithm - Shortest distance with choosing only one coordinates from number of coordinates in same vertical line using python -
I have list
= coordinates
in which I have all the coordinates Dots that are in the XY plane
coordinates
are more than the 1500 marks in the list. I have the lowest distance from the highest point in the plane to the highest point , Such that if two or more digits are in the same vertical line then only one of them is chosen for the path and therefore the distance calculation. Example of
coordinate
list is:
coordinates = [(-6, 0), (-5.82, 1.72), (-5.17) , -0.27), (- 4.28, 0.0), (-2.9, -0.74), (-2.9, -0.2), (-1.55, 0.08), (-1.37, -0.43), (4.8, -1.64) (4.92, -0.25), (5.05, -1.45), (5.36, -0.02), (6, 0)]
Then in this case the point (- 2.9, -0.74)
will not be considered.
How to use visualization algorithm for this case or at least use any other fit algorithm for the path, but such points in vertical rows It is not necessary to remove it too.
I was using itertools
to permutate
and finding all the possible paths and then the distance and then minimized but more than I 1000 is not suitable for the number. And it was also not possible to ignore Sam. E vertical line coordinates I have mentioned, please dragon
Comments
Post a Comment