Springboard Graphs
Here we attempt to model graphs as systems of charged particles, connected by springs, in order to determine "optimal" plotting positions for nodes. We will do a time-step approximation of the movement of the nodes, based on spring and electrostatic forces. We will assume that the graph has no self-loops.
Let each spring (graph connection) have unstretched length and spring constant . Let each node have mass and charge , and let the electric field constant be .
So, for every node , the force due to a spring connecting node to is and the electrostatic force between node and any other node is
We will also add a universal attractive force to all of the nodes from the origin,
Since each node has mass , we can relate the net force on a node to a time-step approximation of accelaration in order to approximate the movement of the nodes:
Given any node , let denote the set of all nodes not equal to , and let denote the set of nodes connected to . Then, for the time step , the displacement of node is
File "<ipython-input-6-936544eda53d>", line 1
from graph-plot import * # See: https://github.com/francisp336/diGraph
^
SyntaxError: invalid syntax