Skip to content

An interactive web application that visualizes Breadth-First Search (BFS) and Depth-First Search (DFS) on graphs using smooth animations and a modern dark dashboard UI.

Notifications You must be signed in to change notification settings

SabhyataVerma/BFS-DFS-Visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌌 Graph Traversal Visualizer

HTML CSS JavaScript Status License

An interactive web application that visualizes Breadth-First Search (BFS) and Depth-First Search (DFS) on graphs using smooth animations and a modern dark dashboard UI.

This project helps in understanding graph traversal algorithms through real-time visualization and user interaction.


🚀 Features

  • Add nodes dynamically
  • Add edges between nodes
  • Visualize BFS traversal
  • Visualize DFS traversal
  • Adjustable traversal speed
  • Live traversal order display
  • Reset graph functionality
  • Modern dark UI
  • Smooth animations and transitions

🛠 Tech Stack

Frontend

  • HTML5
  • CSS3 (Grid, Flexbox, Advanced Styling)
  • JavaScript (ES6)

Visualization

  • HTML5 Canvas

📂 Project Structure

Graph-Traversal-Visualizer/
│
├── index.html      # Main UI structure
├── style.css       # Styling and layout
├── script.js       # Graph logic and animations
└── README.md       # Project documentation

📖 How to Use

  1. Open the application in your browser.
  2. Add nodes using the input field.
  3. Add edges using the format: A B
  4. Click:
    • Start BFS to visualize Breadth-First Search
    • Start DFS to visualize Depth-First Search
  5. Adjust the traversal speed using the slider.
  6. View traversal order in real time.
  7. Use Reset Graph to clear the canvas.

🧠 Algorithms Implemented

Breadth-First Search (BFS)

  • Uses a queue
  • Traverses level by level
  • Guarantees shortest path in unweighted graphs

Depth-First Search (DFS)

  • Uses recursion
  • Explores one branch fully before backtracking

🎨 UI Highlights

  • Dark theme dashboard layout
  • Glass-style panels
  • Gradient buttons
  • Responsive layout using CSS Grid
  • Smooth hover and transition effects

📈 Learning Outcomes

Through this project, I practiced:

  • Graph data structures
  • BFS and DFS algorithms
  • Canvas-based rendering
  • Asynchronous animations in JavaScript
  • Advanced CSS layout and styling
  • UI/UX design principles

🔮 Future Improvements

  • Draggable nodes
  • Queue visualization for BFS
  • Stack visualization for DFS
  • Directed graph support
  • Save and load graphs
  • Predefined example graphs

▶️ Running the Project

Clone the repository:

git clone https://github.com/SabhyataVerma/BFS-DFS-Visualization.git

Open:

index.html

No installation required.


👨‍💻 Author

Sabhyata Verma


📄 License

This project is created for educational and portfolio purposes.

About

An interactive web application that visualizes Breadth-First Search (BFS) and Depth-First Search (DFS) on graphs using smooth animations and a modern dark dashboard UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published