This is an interesting application of Gradient descent. Although we are not using gradient here but it exploits the concepts of gradient descent to stabalize a graph containing multiple nodes. Each node expreience two kinds of repulsive forces:
- Spring forces (between any two connected nodes)
- Magnetic forces (between non-connected nodes) also known as Inverse square law.
Although the distance between any two node is fixed (by default equal to one) which keep the structure intact.
These is how these forces act and leads to a stable graph: