algorithm - Shortest distance with choosing only one coordinates from number of coordinates in same vertical line using python -
i have list
= coordinates
in have coordinates of points lying in xy plane.
there more 1500 points given in coordinates
list. have find minimum distance left point right point in xy plane such if 2 or more points lies in same vertical line 1 of them chosen path , hence distance calculation.
example of coordinates
list :
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)]
so in case point (-2.9,-0.74)
not considered.
how utilize dijksra's algorithm such case or other fit algorithm shortest path removing such points in vertical lines not required.
i using itertools
permutate
, find possible paths , distance , minimum of not fit points more 1000 , not possible ignore same vertical line coordinates mentioned. please help in python
python algorithm python-3.x graph-algorithm shortest-path
No comments:
Post a Comment