- Bubble Sort - Watch elements bubble up to their correct positions
- Quick Sort - See the divide-and-conquer approach in action
- Merge Sort - Observe the merging process step by step
- Dijkstra's Algorithm - Find shortest paths in weighted graphs with real-time visualization
- Breadth-First Search (BFS) - Explore graphs level by level
- Depth-First Search (DFS) - Dive deep into graph structures
- Real-time Animation - Smooth transitions and color-coded states
- Interactive Controls - Adjust array sizes, set target values, and choose start/end nodes
- Responsive Design - Works perfectly on desktop and mobile devices
- Modern UI - Clean, dark theme with intuitive controls
- A modern web browser (Chrome, Firefox, Safari, Edge)
- Python 3.x (for local server) or any HTTP server
-
Clone the repository
git clone https://github.com/yourusername/algorithm-visualizer.git cd algorithm-visualizer -
Start the local server
python3 -m http.server 8000
-
Open your browser
http://localhost:8000
That's it! 🎉 The Algorithm Visualizer is now running locally.
- Select "Sorting" from the Type dropdown
- Choose your preferred algorithm (Bubble Sort, Quick Sort, or Merge Sort)
- Adjust the array size using the slider (10-150 elements)
- Click "New Array" to generate a random array
- Hit "Start" to begin the visualization
- Watch the magic happen! ✨
- Select "Searching" from the Type dropdown
- Choose your algorithm:
- Dijkstra: Enter start and target nodes (e.g., A → F)
- BFS/DFS: Enter a target node to search for
- Click "Start" to begin the search
- Observe the algorithm's exploration process
- Purpose: Find the shortest path between two nodes in a weighted graph
- Visualization:
- 🟢 Green nodes = Visited
- 🟡 Yellow nodes = Currently processing
- 🟠 Orange nodes = Unvisited
- ⚡ Yellow edges = Shortest path found
- 🟠 Orange bars = Normal state
- 🟢 Green bars = Currently comparing
- 🔵 Blue bars = Pivot element (Quick Sort)
- 🟢 Dark green bars = Sorted elements
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Styling: Custom CSS with modern animations
- Architecture: Vanilla JavaScript (no frameworks)
- Server: Python HTTP server (development)
algorithm-visualizer/
├── index.html # Main HTML file
├── script.js # Core JavaScript logic
├── styles.css # Styling and animations
├── dockerfile # Docker configuration
└── README.md # This file
- Add your algorithm function to
script.js - Update the algorithm selection in
renderUI() - Add corresponding CSS classes in
styles.css - Update the event listener in the start button handler
- Modify
styles.cssto change colors, animations, and layout - All visual states are controlled via CSS classes
- Responsive breakpoints are included for mobile devices
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-algorithm
- Add your algorithm
- Implement the algorithm logic
- Add visual states and animations
- Update the UI controls
- Commit your changes
git commit -m "Add amazing new algorithm" - Push to your branch
git push origin feature/amazing-algorithm
- Open a Pull Request
- Heap Sort
- Radix Sort
- A* Search Algorithm
- Binary Search Tree operations
- Graph coloring algorithms
- Array Size: Supports up to 150 elements for smooth visualization
- Animation Speed: Optimized delays for best user experience
- Memory Usage: Lightweight implementation with minimal overhead
- Browser Compatibility: Works on all modern browsers
Graph not displaying properly?
- Ensure you're using a modern browser
- Check the browser console for JavaScript errors
- Try refreshing the page
Animations too fast/slow?
- Modify the
delay()function values inscript.js - Adjust CSS transition durations in
styles.css
Mobile layout issues?
- The app is responsive, but some features work best on desktop
- Try landscape orientation on mobile devices
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the need to make algorithms more accessible
- Built with modern web technologies
- Designed for educational purposes
Your Name - @Yoken0
Project Link: https://github.com/Yoken0/algorithm-visualizer
⭐ Star this repository if you found it helpful!
Made with ❤️ and JavaScript