To create new nodes, drag nodes from the blue circle in the lower left corner onto the stage.
To remove nodes, drag them from the stage into the black circle in the lower left corner.
Nodes can be dragged around the stage at any time.
About the Algorithm
Here's what I was trying to accomplish with this algorithm:
- Nodes are arranged in a circle, with equal spaces between them.
- Nodes don't travel all the way around the circle to get to their position.
- Minimize cases where nodes cross/pass each other. Nodes definitely should not trade places.
- Once all nodes are in place, clicking arrange again shouldn't cause them to move.
The "Arrage2" button uses the better algorithm. Equidistant positions are calculated for the number of nodes on the screen. The nearest node that is within a certain distance of a position will be assigned there. For any remaining nodes, if one its two nearest positions are unfilled, it will occupy that position. Otherwise, it will kick out the node in one of those two nearest positions, and the displaced node will displace its neighbour and so on until an empty space is found and filled.