I'm currently using recursive BFS for a maze navigation algorithm that runs on a RaspberryPi, though I'm mostly doing testing and the majority of the work on Windows. Some of the recursion exceeds the recursion limit in python, so I increase sys.recursionlimit to a number I know for sure the recursion won't reach:
((mazeLength ** 2) + 10)
for a buffer of 10. Typically, the mazeLength is far over 20, but this behavior can be observed at a mazeLength of 10.
Running a maze works fine on the windows machine, but the same maze and same code hits the recursion limit on the RaspberryPi. The issue can be solved on the Pi just by increasing the buffer to 50, but this solution definitely doesn't seem robust. Why could this be? Is it platform dependant, memory dependant, or some other issue entirely?
I know the obvious solution would be to switch to an iterative approach, but I don't want to change anything in its current form if possible.
Thanks in advance!