Replace N, M algorithm to a DFS aproach
OmerRosler opened this issue · comments
The current algorithm is as follows:
- Calculate the entire
T_{n+1}
fromT_n
- If empty exit at
n
This is essentially a "BFS" algorithm on the tree, and it takes too much memory.
A possible DFS approach outline should be:
Start from T_1
Iterate g_i
on it until the cut-off. And put cand_n = cut_off_index
If the cut_off wasn't achieved after max_iterations
we exit early as we found our candidate accumulation point.
After that we take the maximal n
for all the iterations.