Please have a look:

So basically I have a tree like architecture which is not really a tree because the root node might or might not be available at all times.
Root is connected to many children which in turn may or may not be connected to other childs. All nodes at one particular level or similar objects with different id’s as their identifiers.
I am thinking to implement it as a tree but then with a large data set it may be hard to search particular node. Or should i may be make a single Map Object at each level and based upon their key i will be able to serach their relation to parent node if it exists or not??
Or do you think there is anyother better way of doing this, because if i take it as a tree it would grow randomly, plus in it’s extension i have a problem that some children will have many parent nodes and this is probably not possible in tree??
Please suggest some implementation idea?
You could represent it as an oriented graph: each node has incoming edges from its parents and outgoing edges to its children: