An Interactive Algorithm Visualization Platform
Learn data structures and algorithms through interactive visualizations
- Overview
- Features
- Technologies
- Installation
- Usage
- Algorithms
- Project Structure
- Development
- Contributing
- License
DijkstraFlow is a comprehensive, interactive web application designed to help students and developers understand algorithms and data structures through real-time visualizations. Whether you're preparing for technical interviews, studying computer science, or simply curious about how algorithms work, DijkstraFlow provides an intuitive and engaging learning experience.
- 30+ Algorithms across 6 major categories
- Real-time Visualizations with step-by-step execution
- Race Mode to compare algorithms side-by-side
- Code Snippets in JavaScript, Python, and Java
- Custom Input support for hands-on experimentation
- Dark/Light Theme for comfortable viewing
- Responsive Design optimized for all devices
- Step-by-step Execution: Watch algorithms execute with detailed step-by-step animations
- Speed Control: Adjustable animation speed (1-100) for optimal learning pace
- Step Navigation: Move forward and backward through algorithm steps
- Visual States: Color-coded elements showing comparisons, swaps, sorted states, and more
- Statistics Tracking: Real-time display of comparisons, swaps, and other metrics
- Graph Visualizations: Interactive node-link graphs with distance labels, edge weights, and path highlighting
- Total Cost Display: Shows cumulative weight of shortest path edges for graph algorithms
- Performance Metrics: Track computations, queue size, and path distances in real-time
- Side-by-Side Comparison: Compare two sorting algorithms simultaneously
- Shared Dataset: Both algorithms operate on the same input data
- Performance Metrics: Track comparisons and swaps for each algorithm
- Winner Detection: Automatically identifies the most efficient algorithm
- Multi-language Support: View implementations in JavaScript, Python, and Java
- Well-documented Code: Comprehensive comments and explanations
- Time & Space Complexity: Detailed complexity analysis for each algorithm
- Best Practices: Clean, production-ready code examples
- Custom Input: Provide your own data for sorting and searching algorithms
- Graph Editor: Create custom graphs for graph algorithm visualizations
- Random Graph Generation: Automatically generate random weighted graphs for pathfinding algorithms
- Theme Toggle: Switch between light and dark modes
- Responsive Layout: Optimized for desktop, tablet, and mobile devices
- Next.js 16.0.4 - React framework for production
- React 19.2.0 - UI library
- TypeScript 5.0 - Type-safe JavaScript
- Tailwind CSS 4.0 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Framer Motion - Animation library
- Lucide React - Icon library
- ESLint - Code linting
- PostCSS - CSS processing
- Geist Font - Modern typography
- Node.js 18.0 or higher
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd dijkstraflow
-
Install dependencies
npm install # or yarn install -
Run the development server
npm run dev # or yarn dev -
Open your browser
Navigate to http://localhost:3000
npm run build
npm start- Select an Algorithm: Browse algorithms by category on the home page
- Start Visualization: Click "Play" to begin the animation
- Control Speed: Use the speed slider to adjust animation speed
- Step Through: Use step forward/backward buttons for precise control
- View Code: Switch to the "Code" tab to see implementations
- Enable Race Mode: Click the "Race Mode" button on the home page
- Select Algorithms: Choose two sorting algorithms from the dropdowns
- Start Race: Click "Race" to begin simultaneous execution
- Compare Results: View statistics and see which algorithm finishes first
- Open Custom Input Dialog: Click the custom input button in the visualizer
- Enter Data: Provide your own array of numbers (comma-separated)
- Submit: The visualization will use your custom data
- Select Graph Algorithm: Choose from Dijkstra's, A*, or Uniform Cost Search
- View Graph: See nodes and edges with weights displayed
- Watch Path Finding: Observe the algorithm finding the shortest path
- Monitor Metrics: Track computations, queue size, distance, and total cost
- Randomize Graph: Click "Randomize" to generate a new graph layout
- Bubble Sort - Simple comparison-based sorting
- Selection Sort - Finds minimum and places it
- Insertion Sort - Builds sorted array incrementally
- Merge Sort - Divide and conquer approach
- Quick Sort - Efficient pivot-based sorting
- Heap Sort - Uses binary heap data structure
- Shell Sort - Optimized insertion sort variant
- Tree Sort - Binary search tree-based sorting
- Tim Sort - Hybrid merge/insertion sort
- Cocktail Shaker Sort - Bidirectional bubble sort
- Counting Sort - Non-comparison integer sorting
- Radix Sort - Digit-by-digit sorting
- Linear Search - Sequential search through array
- Binary Search - Divide and conquer search
- Jump Search - Jump ahead by fixed steps
- Interpolation Search - Improved binary search for uniform data
- Exponential Search - Finds range then binary searches
- Fibonacci Search - Uses Fibonacci numbers to divide array
- Depth First Search (DFS) - Explores as far as possible with maze visualization
- Breadth First Search (BFS) - Level-by-level exploration with maze visualization
- Dijkstra's Algorithm - Shortest path in weighted graphs with distance tracking and total cost display
- A Search* - Informed search with heuristics and path cost visualization
- Uniform Cost Search - Least-cost path finding with weighted edge visualization
- Prim's Algorithm - Greedy MST construction
- Kruskal's Algorithm - Union-Find based MST
- N-Queens Problem - Place N queens on chessboard
- Sudoku Solver - Solve 9Γ9 Sudoku puzzles
- 0/1 Knapsack Problem - Maximize value with weight constraint
- Fibonacci Sequence - Memoized Fibonacci calculation
dijkstraflow/
βββ app/
β βββ globals.css # Global styles and theme variables
β βββ layout.tsx # Root layout component
β βββ page.tsx # Home page component
βββ components/
β βββ ui/ # Reusable UI components
β β βββ button.tsx
β β βββ card.tsx
β β βββ dialog.tsx
β β βββ input.tsx
β β βββ select.tsx
β β βββ slider.tsx
β β βββ switch.tsx
β β βββ ...
β βββ visualizers/ # Algorithm-specific visualizers
β β βββ sorting-visualizer.tsx
β β βββ searching-visualizer.tsx
β β βββ graph-visualizer.tsx
β β βββ mst-visualizer.tsx
β β βββ backtracking-visualizer.tsx
β β βββ dp-visualizer.tsx
β βββ algorithm-selector.tsx # Algorithm category browser
β βββ algorithm-visualizer.tsx # Main visualization container
β βββ race-mode.tsx # Race mode component
β βββ code-snippets.tsx # Code display component
β βββ custom-input-dialog.tsx # Custom input dialog
β βββ theme-toggle.tsx # Theme switcher
βββ lib/
β βββ algorithm-descriptions.ts # Algorithm explanations
β βββ code-snippets.ts # Code implementations
β βββ utils.ts # Utility functions
βββ package.json
βββ tsconfig.json
βββ next.config.ts
βββ README.md
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
- TypeScript strict mode enabled
- ESLint configuration for code quality
- Consistent component structure
- Responsive design patterns
- Add Algorithm Description: Update
lib/algorithm-descriptions.ts - Add Code Snippets: Update
lib/code-snippets.tswith implementations - Create Visualizer: Add visualizer component in
components/visualizers/ - Update Selector: Add algorithm to appropriate category in
components/algorithm-selector.tsx - Implement Logic: Add algorithm implementation in the visualizer
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-algorithm) - Make your changes with clear commit messages
- Test thoroughly across different browsers and devices
- Submit a pull request with a detailed description
- Add new algorithms
- Improve visualizations
- Enhance UI/UX
- Fix bugs
- Write documentation
- Optimize performance
- Add new features
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License is a permissive open-source license that allows:
- β Commercial use
- β Modification
- β Distribution
- β Private use
With the following conditions:
- Include the original copyright notice
- Include the license text
No warranty or liability is provided.
- Algorithm implementations inspired by classic computer science literature
- UI components built with Radix UI
- Icons provided by Lucide
- Fonts by Vercel Geist
For questions, issues, or suggestions:
- Open an issue on GitHub
- Check existing documentation
- Review code comments for implementation details
DijkstraFlow is designed for educational purposes. It's perfect for:
- Computer Science students
- Coding bootcamp participants
- Technical interview preparation
- Algorithm enthusiasts
- Educators teaching algorithms


