Determining shortest distance between Isobaths - r

I'm interested in finding the shortest distance between two 120m isobaths to determine the interaction of species during the Pleistocene.
Thus far I have found methods to plot the isobaths with package marmap. But have not been able to find functions to determine the shortest distance between isobaths without having to manually measure them as there will be quite a substantial number of measurements involved which would not be efficient to do so manually.
Would appreciate any advice on this, thanks!

Have you tried using the function dist2isobath() in the latest version of marmap (v0.9.1)? Its purpose is to compute great circle distances between any number of points and a given isobath. So you could get the coordinates of points along one of your 120m isobath using contourLines(), then use dist2isobath() to compute the shortest path between each of these points and your second 120m isobath.

Related

Minimum length of lines needed

Suppose we have a set of N points on the cartesian plane (x_i and y_i). Suppose we connect those points with lines.
Is there any way like using a graph and something like a shortest path algorithm or minimum spanning tree so that we can reach any point starting from any point but minimizing the total length of the lines??
I though that maybe I could set the cost of the edges with the distance of a graph and use a shortest path algorithm but I'm not sure if this is possible.
Any ideas ?
I'm not 100% sure what you want, so I go for two algorithms.
First: you just want a robust algorithm, use dijkstras algorithm. The only challange left is to define the edge cost. Which would be 1 for neighboring nodes, I assume.
Second: you want to use heuristics to estimate the next best node and optimize time consumption. Use A*, but you need to write a heuristic which under estimates the distance. You could use the euclidean distance to do so. The edge problematic stays the same.

finding shortest distance between two points around waterways in r

Looking for some advice on the best approach to this problem. I need make a matrix of pairwise OVER LAND shortest distance between each pair of points for 309 points (see figure below).
An approach I was thinking of following was creating a shapefile of the entire area in question and rasterizing it and using the gdistance library to somehow convert waterways to a 'high cost' barrier and land to 'low cost' and then finding least cost paths. And then finding a way to put that in matrix form. Or if there's a way to do this just by telling R to stay within a shapefile?
Any suggestions would be very helpful! Thanks

Cluster by distance between a lot off point in R

I need to create clusters from the distance between clients if the distance between the points is less than certain precise value group them together.
I thought about using Delaunay but I'm not having success

Optimal meeting point in an directed graph having 2 starting vertices

What algorithm should I use if in a directed graph I want to find the shortest paths, having 2 starting vertices, so that the paths meet and both have the minimum distance for this to happen.
I would do an All-Pairs-Shortest-Path, find common endpoints, and then find the minimum of (distance(vertex1,endpoint)+distance(vertex2,endpoint)) for all possible endpoints
I would use Dijkstra's to get minimal distance trees for both starting vertices, then add the two distance vectors together and take the minimum. C.B.'s answer is fine, but you don't need the shortest distances between all pairs, so there's some redundant work there.

Is This Graph Embedding Possible & Does It Have A Name?

I want to project an undirected graph into the 2d plane such that:
the euclidean distance preserves the stepwise distance (i.e. if the shortest path between A and B is shorter than the shortest path between C and D, then the euclidean distance between A and B is less than the euclidean distance between A and B)
the minimum difference between the euclidean distance and the stepwise distance is minimized. Ideally the set of solutions is generated or described if there is not a unique minimum.
If this is not possible, what are the most minimal sets of constraints on the graph that make it possible? I'm interested in the question in general, although at the moment I want it for a finite lattice with its minimum removed.
It's called graph embeddng. There's even a theorem that gives an upper limit to the distortion. The embedding algorithm that I like the most is SDE. It's fairly easy to implement on any language if you have a SDP library.
Here's an algorithm that's a bit simpler.
I think the first requirement is impossible, at least for the general case. Consider a fully-connected graph consisting of four nodes, with all path-lengths equal. It's not possible to choose four points in 2D Euclidean space that exhibits the same property (other than 4 coincident points).
See Diego's answer for some useful information (my knowledge of graph theory is very limited!).

Resources