Igraph layout.fruchterman.reingold outliers (sample image included)

Sometimes, when using a layout algorithm such as layout.fruchterman.reingold, you may end up with some nodes that are outliers in the sense that they expand disproportionately from the rest of the structure. Does anyone know how to impose the maximum length on the edges (e.g. = 1) so that the edge does not exceed the maximum length and hence remove those outliers?

l <- layout.fruchterman.reingold(subgraph)

      

By the way, I know to use the scale factor already for registering things in:

l <- layout.fruchterman.reingold(subgraph) * scaleFactor

      

Example of Outliers

+3


source to share


2 answers


The algorithm Fruhtermana-Reingold no built-in functions (and I suspect that the use of xmin

, ymin

, xmax

andymax

won't work because it might just "shrink" the non-outlier part of the network to make more room for outliers), but you can probably experiment with edge weights. When the FR compositing algorithm is used with weights, the algorithm will tend to keep the heavier weighted edges shorter. You could probably try to set the weights falling on the "outlier" vertices (ie vertices with degree = 1 or 2) to a smaller value. Another possibility is to make the edge weights dependent on the degrees of both endpoints, so that smaller degrees map to lower values, but larger degrees do not map to disproportionately large values ​​- perhaps a geometric mean of the degrees of the two endpoints could be useful here. But there is no "universal"solutions as far as I know, so you'll have to experiment a bit.



+1


source


When asking for a question with an example that depends on non-base functions, be sure to include in which package they live.

(for those wondering, this is in igraph).

Document documentation

The igraph for the fruchterman-reingold layout method contains in the "arguments":



Xmin, Xmax

The limits for the first coordinate, if one or both of them is NULL, then no normalization is done in that direction.

Ymin, uty

The limits for the second coordinate, if one or both of them are NULL, then no normalization is done in that direction.

Zmin, Zmax

The limits for the third coordinate, if one or both is NULL, then no normalization is done in that direction.

... so, set limits on x and y? Z is not required unless it is a 3-D graph.

-1


source







All Articles