Tuesday, October 25, 2016

My next version of compact graph machine

I posted it here, it compiles but does not run.

It has two classes, one the g array which treats the graph as a linear array of node pointers that can be moved around in blpocks.

And he node class which treats the graph as a always descending tree, organized as nested block.  The idea is to create nested blocks, as if the bot were writing a script, like python.  But the only value in the leaf nodes is price, to a specified precision.  Its a simple recursive loop which I can bang on, I am really more interest in the various type of operators we can create to traverse the block. The operator most interesting is the Huffman operator, it runs, asynchronously, and adjusts the graph to maximum entropy. I want to see how the losses and gains come out when that is done.

OK, I have he code running,badly but running.  Let's talk about what operations I can do on a descend only compact graph.  Since, ultimately, all subgraphs,meaning nodes having null or more enclosed nodes, will be exchange with some other subgraph, already on in the packed array.

Creating a new node appends it to the root node, with all counts properly set.

We get:

root.was -> r.(new,was)  prependnew before was, and all the block counts updated.

But that is the general insert function, prepend new onto the first element of previous.  In turn we call up the array iterator, and blocks moved.  The iterator knows nothing about nodes or graphs, it is shifting arbitrary python  object references about on a linear array of fixed size..

So, my code can build the graph and descent it carrying an operator.  I have three, the Null function passes every node.  The IsEqual functions stops when the specified node is found, and ( will have update counts used when a block exchange occurs.  All operators accumulate the array index as they descend.

So, set up is highly recursive, and highly block shift oriented, but access it quick and a breeze.  This is what the trading sights need, each trip through the betting graph is nickels in the site owners hands. Programming the graph a since.  Wait times on recursions short if you are dealing with large groups of short grahs.


No comments: