What is the best approach finding the shortest distance between a point and a polygon or a route (route = first and last point are not connected)?
I think that the brute force here is take the shortest distance between this point and all the segments and It takes O(n) time where n is the segments amount of the polygon or the size of the segments set in the route, but ...
Can we do it better?
Is O(logn) possible if we know this segments set and we can store it sorted using some criteria?
Any hint or documentation will be appreciate.
Thanks in advance!