The assignment Game has various search algorithms. We are using five algorithms: Breadth-First Search, Depth First Search, and A* search with two heuristics (and average between them) to allow the spider to find the ant.
In the program, I use web workers to reduce the processing, which allows the browser to remain responsive even though the CPU has huge operations that may be taking place. The user can select some options that can change the results, The results are drawn on the screen using a canvas element.
Breadth First Search: low to medieum average moves, but must process a lot of nodes (low number of moves at high CPU cost).
Depth First Search: high average moves, but must process many nodes (high number of moves at high CPU cost, very bad).
A* Search: low average moves, with low number of processed nodes (low number of moves at low CPU cost, very good).
Because of the heuristics functions, In A* search, we can know what direction the ant is closest to, so we search in that direction instead of randomly wandering around the board. Sorting makes the spider such as creative.