I think the iteration counts are counted per tick. I don’t know for sure, but everything I’ve seen for the infinite loop warning has been per tick.
Anyhow, that’s why I put long processing tasks in C++. I’ve seen people say that the Construction script isn’t limited by timeout restrictions and even the count limitation (though I can’t be sure if any of this is true or not). So you could perhaps try that. Just spawn an actor that creates the maze and put your graph in the construction script. Easy enough to do and minimal changes. Again, make sure to destroy the actor on the next tick (or later).
Note that for you to use the Construction script, you MUST spawn the actor. In a standalone game, if the actor is already in the level, it will NOT execute the Construction script.