A visualization tool for the Breadth-First Search (BFS) algorithm, which is commonly used to traverse or search tree and graph data structures. BFS explores nodes level by level, starting from the root (or any specified start node) and visiting all nodes at the current depth before moving to the next. This tool demonstrates BFS traversal in a 10x10 grid, allowing users to interactively explore its behavior.
This application visualizes how the BFS algorithm traverses a grid-based graph, showing the order in which nodes are visited in real time.
- Add Wall: Adds a wall to cells you click or drag over, creating obstacles for the BFS traversal.
- Delete Wall: Removes walls by resetting cells to their default state.
- Add Start: Sets a starting point for the BFS algorithm.
- BFS: Begins the BFS traversal and displays the process.
- Show Edges: Reveals the edges between nodes as they are defined in the grid layout.
- Reset: Resets the entire grid to its default state.
- Randomize: Randomly places walls throughout the grid. Click again to create a new random wall pattern.
- Open your preferred Java IDE.
- Locate and run
Main.java
from the pathbfsAlgo/src/main/java/com/example/bfsalgo
.
For more about the BFS algorithm, refer to this article on GeeksforGeeks.