I am creating a tree in java to simulate the Extensive form of the game for AI. The tree will be a 25-ary tree (the tree in which each branch has the most 25 child branches), because there are 25 different moves on each turn of the game. Since the number of new branches that must be created on each new layer of the tree is 25%. I am very interested in making this effective. (I intend to ruthlessly cut branches so that they do not grow, to prevent things from getting stuck). What is the best way to model such a tree when efficiency is such a problem? My first impression is to have a node object, where each node has a parent node and an array of child nodes, but that means creating a lot of objects. Ultimately these are my questions:
Is this the fastest way to create and manage my tree?
What is a good way to find out how long it will take to execute any algorithm or process in a program? (the only thing I've been thinking so far is to create a date before the process, and then after and compare the number of milliseconds passed)
Any other thoughts are also welcome. My question implies and is related to a lot of other questions, I would expect. If I was ambiguous or unclear, please comment to let me know, instead of voting and storming, as this is ineffective.
David source
share