Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.46 KB

README.md

File metadata and controls

26 lines (17 loc) · 1.46 KB

BFS Algorithm Visualization

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.

Explanation

This application visualizes how the BFS algorithm traverses a grid-based graph, showing the order in which nodes are visited in real time.

Button Descriptions

  • 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.

How to Run

  1. Open your preferred Java IDE.
  2. Locate and run Main.java from the path bfsAlgo/src/main/java/com/example/bfsalgo.

Additional Information

For more about the BFS algorithm, refer to this article on GeeksforGeeks.