You can see the link distance as the expected distance and the strength as the speed at which you want to reach this target distance on each iteration.
If you have a look at the source code of the force directed layout, you will find the following line:
l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
This algorithm is an optimization algorithm, thus, on each iteration you modify l
. Now the thing is that you have to specify by how much you modify this.
On a basic algorithm you would have the following in order to optimize the distances:
l = ((l = Math.sqrt(l)) - distances[i]) / l;
However you might want to have more control on every links and also on each individual link. Hence, you can consider the alpha
attribute as the fixed parameter and the strength
attribute as the parameter that varies for each link.
If you want to know more about the optimization method used, I recommend you to have a look at the Gauss-Seidel wikipedia page.