Shortest path through coordinates

青春壹個敷衍的年華 提交于 2019-12-13 09:46:18

问题


I am given a set of point in the x-y plane ={(x1,y1),(x2,y2),.....(xn,yn)}

and I am given two points a(xa,ya) and b(xb,yb) and asked to find the set of points that cover the shortest path.

no connection between points are given. If I assume a connection to every other point.it will take a long time to compute these values for a weighted graph. Can someone tell me what reading I should do. what topic does this problem come under graph algorithms?!!(Is there any specific algorithm) I have been stuck on this for days. note: need to go through the points. cannot jump across the points.


回答1:


The Shortest path between two points in a plane is a straight line. so you could use the points to form the equation of line and check if the set of points satisfies your equation.

Equation of line: y - y1 = m(x - x1)

where, m = (y2-y1)/(x2-x1)



来源:https://stackoverflow.com/questions/36275776/shortest-path-through-coordinates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!