GraphPlot.jl icon indicating copy to clipboard operation
GraphPlot.jl copied to clipboard

spring_layout does not use the correct Fruchterman-Reingold aglorithm

Open simonschoelly opened this issue 6 years ago • 2 comments

The documentation for spring_layoutsays, that the algorithm uses the the forces

Attractive force:  f_a(d) =  d^2 / k
Repulsive force:  f_r(d) = -k^2 / d

but what it actually does, is using

Attractive force:  f_a(d) =  d / k
Repulsive force:  f_r(d) = -k^2 / d^2

where d is the distance between two vertices and k is some constant. That also works, so I'm wondering, if we want to keep using this modified version or use the original version by Fruchterman and Reingold. Networkx uses the same modified version, so either this is done on purpose or the error was copied when implementing it in Julia.

simonschoelly avatar Dec 23 '18 22:12 simonschoelly

To clarify, it appears that the decision to use the alternative form is intentional. There are two options and the original FR algorithm is commented out in favor of the other form.

Is the intention of this issue to have people make points in favor of one or the other to make a final decision?

lukasmericle avatar Oct 02 '20 00:10 lukasmericle

Can we close this issue @simonschoelly?

hdavid16 avatar Jul 27 '22 17:07 hdavid16