OmerRosler / fractal_plotter

Plotting some fractals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace N, M algorithm to a DFS aproach

OmerRosler opened this issue · comments

The current algorithm is as follows:

  1. Calculate the entire T_{n+1} from T_n
  2. 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.