Click to See Complete Forum and Search --> : A cell structure..


jyngem
August 21st, 2004, 05:51 AM
Hola!

Lets say we have a circle which is to be filled with (point-)nodes of some kind. The distances between them will be calculated so that each node knows it's placement in relation to any other node. These nodes is going to connect to each other in a certain way: the probability for connection between two nodes increases the nearer they are, and the amount of connections per node has a random set maximum (varying for each node). It is also of importance that the field (circle) has a direction which indicate which way the data flow. If sorted along the x axis, node1.x < node2.x implies that node1 will output to node2 which in turn calculates something and submits the result as output rightward. Each node must have at least one input and ditto output (two exceptions, but it is not essential). This has a strong resemblance to function trees, in fact it is one.

Now, there isn't really a maximum number of connections per node, it's rather a probability of connection. A node picks a second with prob decreasing with distance, asks itself "permission" to connect with a prob decreasing with the amount of already connected nodes (the prob defines the "maximum" in a way), and finally it must also ask the other node for permission to connect in the same manner.

There will be hundreds of thousands of these cells, so it's crucial to keep a good design, i guess.

Do you have any suggestions? I mean, anything at all is appreceated!
Due to the probabilistic nature; should i implement a recursive algorithm, or would it be best to have a controlclass connect the nodes? or mayby something else..

Thanx ;)

Joe Nellis
August 21st, 2004, 10:47 AM
This is a peer to peer design of some sort, or some simulation?

Recursive anything on something this size is probably not wise and may lead to stack overflow errors and slow runtime.
The distances between them will be calculated so that each node knows it's placement in relation to any other node.
Just doing this calculation on "hundreds of thousands of cells" will be difficult. The increase in connections between nodes of a fully connected graph grows very fast with each added node. A hundred thousand of these computed from each node frame of reference will be a drain on the system.

Your problem is a variant of the N-Body problem. Probability of communication between two nodes is a secondary problem because you need the "distance" between two nodes first to make that determination of communication. If this a p2p proposal then getting past this "distance" to node issue becomes even harder because "known existence" of a node is first required. If this is a simulation then there are methods to grouping and reducing calculations.

http://www.amara.com/papers/nbody.html