The first implementation of a Unity 3D framework for algorithm animation is a project which generates an X, Y grid (the user may define width and height variables X and Y as integer inputs). A maze generation algorithm may then be run on the grid any number of times in order to demonstrate the many unique graph structures that might result from such a generation. Once the user is satisfied with the resulting, randomly-generated maze, he or she may then run any of the the search algorithm animations listed previously. Each of these solutions utilizes a variety of Unity 3D features, mesh rendering, line rendering, movement and animation, and UI elements.
Within the context of our search algorithms, we will refer to the searching entity (sometimes this can be thought of as the traveler, or NPC) as the search agent. The agent is an important component in the visualization of a search algorithm, since it will reveal the primary decision-making processes with its movements on the learner’s screen.
Within the maze application, a number of different colored lines and points are rendered, each of which represents an aspect of the graph problem. Lines rendered white represent the ’walls’ of the maze, whereas the rendered yellow lines represent all possible paths through the maze which have not yet been processed (logically, these are the edges between each connected node in the graph). Green lines represent the agent’s current best path (or the current working path if an animation is in progress), red lines represent known useless paths (for example, when the agent encounters a dead-end in the maze and is forced to back-track), and blue lines (which only appear only in some breadth-first-search style algorithms) represent potential paths on the edge of the search space which are pending further processing.