|
| 1 | +# Algorithm Visualizer – Sorting and Pathfinding |
| 2 | + |
| 3 | +Algorithm Visualizer is an **interactive web application** that demonstrates classic **sorting algorithms** and **pathfinding algorithms** through real-time visualizations designed to support teaching and learning core Computer Science concepts. |
| 4 | + |
| 5 | +The project helps users understand how algorithms behave step by step by combining animated visual feedback with adjustable controls such as **data size, speed, and grid obstacles**. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Key Features |
| 10 | + |
| 11 | +✔ Interactive sorting algorithm visualizations |
| 12 | +✔ Dijkstra pathfinding visualization on a grid |
| 13 | +✔ Adjustable dataset size and animation speed |
| 14 | +✔ Obstacle placement with configurable start and end nodes |
| 15 | +✔ Real-time algorithm animation for learning and demonstration |
| 16 | +✔ Responsive web interface |
| 17 | +✔ Unit testing with Jest |
| 18 | +✔ End-to-end testing with Cypress |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Technologies Used |
| 23 | + |
| 24 | +- **Next.js** |
| 25 | +- **TypeScript** |
| 26 | +- **Tailwind CSS** |
| 27 | +- **Jest** |
| 28 | +- **Cypress** |
| 29 | +- **React-based UI architecture** |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Project Architecture |
| 34 | + |
| 35 | +The application is structured into separate components for **UI rendering, algorithm logic, animation control, and testing**. |
| 36 | + |
| 37 | +### Sorting Visualizer |
| 38 | + |
| 39 | +- Bubble Sort |
| 40 | +- Selection Sort |
| 41 | +- Insertion Sort |
| 42 | +- Merge Sort |
| 43 | +- Heap Sort |
| 44 | +- Quick Sort |
| 45 | + |
| 46 | +### Pathfinding Visualizer |
| 47 | + |
| 48 | +- Dijkstra’s Algorithm |
| 49 | +- Adjustable start and end points |
| 50 | +- Grid obstacle placement |
| 51 | +- Interactive control panel |
| 52 | + |
| 53 | +### Testing |
| 54 | + |
| 55 | +- **Jest** for unit testing |
| 56 | +- **Cypress** for end-to-end browser testing |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Live Demo |
| 61 | + |
| 62 | +**Live Demo:** |
| 63 | +[Algorithm Visualizer on Vercel](https://algorithm-visualizer-q15cskgbv-rosscyking1115s-projects.vercel.app/) |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Project Structure |
| 68 | + |
| 69 | +```text |
| 70 | +algorithm-visualizer |
| 71 | +│ |
| 72 | +├── app/ |
| 73 | +├── components/ |
| 74 | +├── cypress/ |
| 75 | +├── public/ |
| 76 | +│ └── screenshots/ |
| 77 | +│ ├── home.png |
| 78 | +│ ├── sorting.png |
| 79 | +│ └── pathfinding.png |
| 80 | +├── tests/ |
| 81 | +├── utils/ |
| 82 | +├── README.md |
| 83 | +├── package.json |
| 84 | +└── LICENSE |
| 85 | +``` |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Application Screenshots |
| 90 | + |
| 91 | +### Home / Control Interface |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +### Sorting Visualization |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +### Pathfinding Visualization |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Running the Project |
| 106 | + |
| 107 | +### Requirements |
| 108 | + |
| 109 | +- Node.js **18+** |
| 110 | +- npm |
| 111 | + |
| 112 | +### Setup |
| 113 | + |
| 114 | +Clone the repository: |
| 115 | + |
| 116 | +```bash |
| 117 | +git clone https://github.com/rosscyking1115/algorithm-visualizer.git |
| 118 | +cd algorithm-visualizer |
| 119 | +``` |
| 120 | + |
| 121 | +Install dependencies: |
| 122 | + |
| 123 | +```bash |
| 124 | +npm install |
| 125 | +``` |
| 126 | + |
| 127 | +Run the development server: |
| 128 | + |
| 129 | +```bash |
| 130 | +npm run dev |
| 131 | +``` |
| 132 | + |
| 133 | +Then open: |
| 134 | + |
| 135 | +```text |
| 136 | +http://localhost:3000 |
| 137 | +``` |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## Future Improvements |
| 142 | + |
| 143 | +- Add more pathfinding algorithms such as **A\*** and **BFS** |
| 144 | +- Add algorithm complexity explanations directly in the interface |
| 145 | +- Improve mobile responsiveness |
| 146 | +- Add sound or step-by-step playback mode |
| 147 | +- Support custom array input and maze generation |
| 148 | + |
| 149 | +--- |
| 150 | + |
| 151 | +## Skills Demonstrated |
| 152 | + |
| 153 | +- TypeScript |
| 154 | +- Next.js |
| 155 | +- Frontend component architecture |
| 156 | +- Algorithm visualization |
| 157 | +- UI state management |
| 158 | +- Web-based interactive design |
| 159 | +- Unit testing |
| 160 | +- End-to-end testing |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +## Notes |
| 165 | + |
| 166 | +This project was originally developed as part of undergraduate study in **Computer Science at Queen’s University Belfast**, and has been refined and presented here as a portfolio project focused on **interactive algorithm education and frontend software engineering**. |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +## Author |
| 171 | + |
| 172 | +**Cheng-Yuan King** |
0 commit comments