I am trying to figure out how to organize a set of nodes (not server nodes, just nodes in a general sense) I’m working with and I’m not sure how to go about this.
Each node is a cartesian point and they all form a network of connected points that connect either by a horizontal or vertical line, so I need to assign information to them about which nodes are neighbors. For example:
node1A = 10 @ 58;
node1A’s southern neighbor is node2A.
node1A’s eastern neighbor is node1B.
node1A’s northern and western neighbors are both nil (node1A is a top left corner).
Would I use an identity dictionary for this? I hope this makes sense. I have another Pen class object moving between these nodes on a GUI and it needs an algorithm to determine which way it can go once it hits a specific node. So for example, if this object hits node1A or any other node with southern and eastern neighbors, it should go either south or east.