Implementation of "Graph Drawing by Force-directed Placement" by Frutcherman and Reingold in 1991 using the jit-jax. This repo interprets the procedural/step-by-step nature of the algorithm into a matrix and gpu-friendly manner.
This algorithm is used almost everywhere you see beautiful graph/networks like from networkx.
Most of the procedures and formulae have been merged into the equation below.
For a Graph
The attractive displacement is
At this point
The last part of the algorithm is to cap the updates in either the
Hyperparameters of this algorithm include the number of steps, initializations, and the cooling function for determining the temperature.
The gifs take a while to start (because of recording). The speed is intentionally slow for demonstration.