Snake Game: Comparing Search Algorithms

This simulation showcases the classic Snake game, with the snake controlled by various search algorithms such as BFS, DFS, Dijkstra, Best First Search, and A*.

In a typical Snake game, the player controls the snake to reach an apple. However, in this simulation, the roles are reversed: we place the apple, and the snake, guided by different algorithms, attempts to reach the placed apple.

Two key terms to understand are 'cost' and 'frame.' In this context, 'frame' refers to the total number of animation frames used for finding and moving the snake. This reflects the number of cells visited and steps taken to move the snake.

Cost is calculated as the difference in numbers on the grid plus one, with the total cost being the sum of these individual costs. This metric is used in Dijkstra's and A* algorithms. Also, for heuristic value in A* and Best First Search, the Manhattan distance is used.