Monday, October 24, 2016

Simple traversal of compact graphs

def traverse(self,id) :
if self.count = 1 : return(id)
i = 0
while i < self.count : i = GET(id).traverse(id+i)

This is not tested,  The algorithm is a complete traversal of the graph, basically visiting each location in an array of nodes.  As the algorithm traverses, it accumulates the index into the array by accumulating the block counts of any node. GET is to be decided, but it is a call to the iterator to get the node pointer at index ID.  Now, the structure of this thing forces compact graph because it uses enclosed counts, the if statement enforces an end point  Or, to put is more bluntly, the insert and append function on this array will be much more complex to make this descent so simple.

But the simplicity of it is also the code verification, it gets a complete traversal with the minimal exposure of any node to variables other than local variables linked within its enclosed sub block. We limit the bots this this patyh and we get a ton of protection from malignant bots.

No comments: