Method for comparing 2 3-dimensional networks (igraphs) in R

48 Views Asked by At

I'm looking for a way to compare 2 (or more) igraph objects in R. These are trajectories in 3-dim which are a network of nodes and edges but are not necessarily the same number of either, just that they have a corresponding coordinate in 3-dim.

I think something like Procrustes could work nicely but requires an equal number of points, and so I'd need a pre-step like iterative closest point (ICP) to find correspondences between the network.

I fear I have gone down the rabbit hole trying to fit a solution to Procrustes (and have yet to get a sensible answer from ICP so far), and thought I'd reach out to the smart people in this community and see if there's a technique I'm missing. This is a new area for me so grateful for any advice.

Thanks in advance!

What I've tried:

I initially tried a Procrustes algorithm but only to find I need equal sized datasets, and then tried writing my own function for ICP in R, but I don't think it's working fully and the resulting networks don't look right to me. My question here is more method than help fixing code anyway.

1

There are 1 best solutions below

0
On

If you have lots of nodes and the total length of the paths is supposed to be approximately the same, you could try resampling the longer path to get the same number of nodes.

If the paths are different lengths, but the distance between nodes isn't too different, you could run the ICP algorithm with multiple initial conditions starting with aligning the 1st node of the shorter (length n) path with the (n - k)th node of the longer (length k) path.

Since you say they are spatial co-ordinates, you might want to split the paths down further by creating more nodes, in order to make the length of edges between nodes equal for both paths (might need to do some rounding), then you can apply regular distance metrics between the paths.

Clearly these suggestions will be pretty silly if you are dealing with stretches, shearing, perspective transformations or something more complicated. Of course you might have thought of these options already and discarded them, but you haven't said so. I'd be interested to hear what the purpose is!