Graph Animation

      Comments Off on Graph Animation
A Network

A Network

This is another example of using Processing to create animations. The GraphAnimation program demonstrates packet forwarding by flooding. A packet sent by node A is replicated by every node (router) it reaches and sent in all connected links until it reaches the destination node N. Knowing the shortest route, node N replies with a unicast packet.

The codes use a force-directed graph layout algorithm to locate the nodes, but the algorithm does not stabilize so the user has to fix the location of some nodes manually. The packet animation is inspired by a Path Following example by Daniel Shiffman in The Nature of Code.