The algorithm is principially simple, simulating a space of electrically charged particles. Basically, each node is thought of as a particle with the same charge, therefore they all try to get as far of each other as possible. On the other hand, though, there are the edges, which keep nodes together; higher weight the edges have, stronger are they in pulling nodes near each other.

So to recapitulate, we have repulsive force pushing nodes from each other and attractive force pushing connected nodes near each other. We then just apply the repulsive force between each two nodes and the attractive force between each two connected nodes; each node will have a resulting movement force, which we will apply to the node's position (initially randomzero-zero) after the forces calculation is finished.

However, we need to let this repeat for several times in order for the positions to stabilize. In fact, a lot of iterations is needed; higher the better, but also higher the slower, you can very easily get to tens of seconds here so beware. Currently, the number of iterations is hardcoded to 500, but this is expected to get configurable soon.