added BFS strategy and bailout at 100k nodes