I am creating a variant of a chess program, which should simultaneously generate and cross a very large tree structure. Each node has 10 bools, int, 8 ulongs, short [64] and 2 ulong [64] s. The root node receives some initial parameters, then the correct child nodes are determined programmatically (recursively) from there.
Basically, my program is constantly expanding this tree, while the user and the program take turns intersecting from the child node to the child node. Each time a new child node is selected, its parents and siblings are no longer needed and discarded. Since the tree reaches (on average) a depth of about 60 (from the initial root of the node), the number of allowed child nodes will naturally begin to decrease to about a depth of about 75, the tree resolves to one final node without further children.
At first, the logic of this looked pretty straightforward, but I constantly encounter an OutOfMemoryException, which completely kills further progress.
Below are some average values โโfor valid children for each generation:
Generation New Nodes 1 1 2 20 3 4,000 4 30,000 5 2,200,000 6 > 50,000,000
In my real program, I canโt even completely expand the fifth generation. When I do not save the specific node data (I clear the node data when it was used to define its own children), I can completely expand the fifth generation, but hit the very strong wall on the sixth generation.
Ideally, I would like my program to eventually reach and then support 8 generations of nodes, as well as the โcurrentโ node. The more I look at it, the less likely it is.
I am tired of working with sqlite database, but could not quickly grow the tree.
Does anyone know of any potential alternatives to working with a very large tree structure?