Skip to content

Felix-au/Algorithm-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AlgoQuest - Algorithm Visualizer

AlgoQuest Logo

An interactive desktop application for visualizing computer science algorithms

Java JavaFX Maven License


๐Ÿ“– About

AlgoQuest is an educational tool designed to help students, educators, and programming enthusiasts understand how algorithms work through interactive visualizations. Watch algorithms execute step-by-step, control playback speed, and see exactly how data structures change during execution.

Supported Algorithm Categories

  • ๐Ÿ” Searching Algorithms: Binary Search, Linear Search, Jump Search
  • ๐Ÿ“Š Sorting Algorithms: Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort
  • ๐ŸŒณ Graph Algorithms: BFS, DFS, Dijkstra's Algorithm, Prim's Algorithm, Kruskal's Algorithm
  • ๐Ÿงฉ Puzzle Solvers: N-Queens, Sudoku, Maze Generation and Solving
  • ๐Ÿ”— Pathfinding: A* Search, Best-First Search

โœจ Features

  • ๐ŸŽฌ Step-by-Step Visualization: Watch algorithms execute one step at a time
  • โฏ๏ธ Playback Controls: Play, Pause, Step Forward, Step Backward
  • โšก Adjustable Speed: Control animation speed with an intuitive slider
  • ๐Ÿ“Š Multiple Visualizations: Bar charts, arrays, graphs, grids, and chessboards
  • ๐Ÿ“ Variable Tracking: Monitor algorithm variables in real-time
  • ๐Ÿ’ป Code Display: View algorithm pseudocode alongside visualization
  • ๐ŸŽจ Clean UI: Modern JavaFX interface with intuitive controls
  • ๐Ÿ“ฆ Standalone Executable: Includes embedded JREโ€”no Java installation required

๐Ÿš€ Quick Start

Prerequisites

Running from Source

Windows

run.bat

Linux/Mac

chmod +x run.sh
./run.sh

Using Maven Directly

# Compile the project
mvn clean compile

# Run the application
mvn javafx:run

Running the Executable (Windows Only)

If you have the pre-built AlgoQuest.exe:

  1. Double-click AlgoQuest.exe
  2. No Java installation requiredโ€”JRE is embedded!

๐Ÿ—๏ธ Building from Source

Build JAR File

# Standard JAR (requires JavaFX on system)
mvn clean package

# Shaded JAR (includes all dependencies)
mvn clean package

Output: target/algorithm-visualizer-1.0.0.jar

Create Windows Executable

  1. Build the shaded JAR:

    mvn clean package
  2. Use Launch4j:

    • Install Launch4j
    • Open PrashnaSetu.xml in Launch4j
    • Click "Build wrapper" to generate AlgoQuest.exe
  3. Package for distribution:

    • Include AlgoQuest.exe
    • Include jre/ directory (embedded JRE)
    • Include openjfx-21.0.7_windows-x64_bin-sdk/ (JavaFX SDK)

๐ŸŽฎ How to Use

1. Select an Algorithm

  • Launch the application
  • Browse the algorithm list by category
  • Click on an algorithm to open its visualization

2. Configure Parameters

  • Set input size, target values, or other algorithm-specific parameters
  • Click "Generate" or "Start" to initialize

3. Control Playback

  • โ–ถ๏ธ Play: Auto-advance through algorithm steps
  • โธ๏ธ Pause: Pause automatic playback
  • โญ๏ธ Step: Advance one step forward
  • โฎ๏ธ Step Back: Go back one step
  • ๐Ÿ”„ Reset: Return to initial state

4. Adjust Speed

  • Use the speed slider to control animation speed
  • Slower speeds help understand complex operations
  • Faster speeds good for observing overall behavior

5. Monitor Execution

  • Visualization Area: Watch the algorithm in action
  • Progress Log: Read textual descriptions of each step
  • Variable List: Track variable values during execution
  • Code Display: View the algorithm's pseudocode

๐Ÿ›๏ธ Project Structure

algorithm-visualizer/
โ”œโ”€โ”€ src/main/
โ”‚   โ”œโ”€โ”€ java/com/algorithmvisualizer/
โ”‚   โ”‚   โ”œโ”€โ”€ Main.java                   # Application entry point
โ”‚   โ”‚   โ”œโ”€โ”€ algorithm/                  # Algorithm implementations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BinarySearchSolver.java
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BubbleSortSolver.java
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DFSSolver.java
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ model/                      # Algorithm metadata
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Algorithm.java          # Abstract base class
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BinarySearchAlgorithm.java
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ ui/                         # UI controllers
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MainController.java
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AlgorithmViewController.java
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ””โ”€โ”€ visualization/              # Renderers
โ”‚   โ”‚       โ”œโ”€โ”€ BarChartRenderer.java
โ”‚   โ”‚       โ”œโ”€โ”€ GraphRenderer.java
โ”‚   โ”‚       โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ resources/
โ”‚       โ”œโ”€โ”€ fxml/                       # UI layouts
โ”‚       โ”‚   โ”œโ”€โ”€ main-view.fxml
โ”‚       โ”‚   โ”œโ”€โ”€ algorithm-view-new.fxml
โ”‚       โ”‚   โ””โ”€โ”€ ...
โ”‚       โ””โ”€โ”€ Logo.png
โ”œโ”€โ”€ jre/                                # Embedded JRE (for distribution)
โ”œโ”€โ”€ openjfx-21.0.7_windows-x64_bin-sdk/ # JavaFX SDK (for distribution)
โ”œโ”€โ”€ pom.xml                             # Maven configuration
โ”œโ”€โ”€ PrashnaSetu.xml                     # Launch4j configuration
โ”œโ”€โ”€ run.bat                             # Windows run script
โ”œโ”€โ”€ run.sh                              # Unix/Linux run script
โ””โ”€โ”€ README.md                           # This file

๐Ÿ› ๏ธ Technology Stack

  • Language: Java 11
  • UI Framework: JavaFX 17.0.2
  • Build Tool: Apache Maven
  • Packaging: Launch4j (Windows executable creation)
  • Architecture: Model-View-Controller (MVC)

๐Ÿค Contributing

We welcome contributions! Whether it's adding new algorithms, improving visualizations, or fixing bugs, your help is appreciated.

Adding a New Algorithm

  1. Create Algorithm Model (model/[Name]Algorithm.java):

    public class NewAlgorithm extends Algorithm {
        public NewAlgorithm() {
            super("Algorithm Name", "Description", Category.SORTING);
        }
        
        @Override
        public String getVisualizationFxml() {
            return "/fxml/newalgorithm-view.fxml";
        }
        
        @Override
        public Class<?> getControllerClass() {
            return NewAlgorithmController.class;
        }
    }
  2. Implement Algorithm Logic (algorithm/[Name]Solver.java):

    public class NewAlgorithmSolver {
        public List<StepData> solve(Parameters params) {
            // Your algorithm implementation
        }
    }
  3. Create Controller (ui/[Name]Controller.java):

    • Implement AlgorithmViewController.AlgorithmSpecificController
    • Handle parameter input and visualization updates
  4. Create or Reuse Renderer (visualization/[Name]Renderer.java):

    • Render algorithm state to JavaFX Canvas or Pane
  5. Create FXML View (resources/fxml/[name]-view.fxml):

    • Link to your controller
  6. Register Algorithm:

    • Add to MainController.getAlgorithms() method

For detailed contribution guidelines, see AI_AGENT_ONBOARDING.md.


๐Ÿ“š Documentation


๐Ÿ› Known Issues

  • No automated tests currently exist
  • Code display feature is not fully implemented for all algorithms
  • Step-back functionality may have issues with certain puzzle algorithms
  • Linux/Mac executable not available (currently Windows only via Launch4j)

๐Ÿ—บ๏ธ Roadmap

Version 2.0 (Planned)

  • Add automated tests (JUnit)
  • Implement complete code display for all algorithms
  • Add dark mode theme
  • Export visualization as video/GIF
  • Linux and macOS native packages
  • Enhanced graph algorithm visualizations
  • Tutorial mode for beginners
  • Algorithm comparison mode

Future Enhancements

  • Dynamic programming visualizations
  • String matching algorithms
  • Tree traversal animations
  • Interactive parameter tuning
  • Performance metrics display
  • Multi-language support (i18n)
  • Web-based version

๐Ÿงช Testing

Currently, the project lacks automated tests. To test manually:

  1. Run the application: mvn javafx:run
  2. Test each algorithm category:
    • Select an algorithm
    • Configure parameters
    • Verify visualization renders correctly
    • Test all playback controls (Play, Pause, Step, Step Back, Reset)
    • Adjust speed and verify responsiveness
  3. Check edge cases:
    • Minimum input size
    • Maximum input size
    • Already sorted arrays (for sorting algorithms)
    • Graph with cycles vs. acyclic graphs

๐Ÿ’ก Tips for Educators

  • Start with Simple Algorithms: Begin with Binary Search or Selection Sort
  • Use Step-by-Step Mode: Pause and discuss each step with students
  • Vary Input Sizes: Show how algorithm behavior changes with data size
  • Compare Algorithms: Demonstrate different approaches to the same problem
  • Encourage Exploration: Let students adjust parameters and observe results

๐Ÿ™ Acknowledgments

  • Built with โค๏ธ using JavaFX
  • Icons and UI inspired by modern design principles
  • Educational content based on standard computer science curriculum

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ“ง Contact & Support


๐ŸŒŸ Star History

If you find this project helpful, please consider giving it a โญ on GitHub!


Made with ๐Ÿง  for algorithm enthusiasts

โฌ† Back to Top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages