'Updates the position of nodes in the graph.
The weight parameter determines the impact of edge weight.
The limit parameter determines the maximum movement each update().'

def update(self, weight=10.0, limit=0.5):

    GraphLayout.update(self)
    for (i, n1) in enumerate(self.graph.nodes):
        for (j, n2) in enumerate(self.graph.nodes[(i + 1):]):
            self._repulse(n1, n2)
    for e in self.graph.edges:
        self._attract(e.node1, e.node2, (weight * e.weight), (1.0 / (e.length or 0.01)))
    for n in self.graph.nodes:
        if (not n.fixed):
            n._x += max((- limit), min((self.force * n.force.x), limit))
            n._y += max((- limit), min((self.force * n.force.y), limit))
        n.force.x = 0
        n.force.y = 0
