Skip to content

jbrowne7/javafx-algorithm-visualiser

Repository files navigation

JavaFX Algorithm Visualiser

Used JavaFX to create a visual graph which shows the steps of dijkstras algorithm, turns dijkstra into UI state transition

Table of Contents

Video Demo

Algorithm Visualiser Demo

Click the image above to watch a demonstration of the algorithm visualiser.

Requirements

  • Java 17-21
  • Git

Setup

1. Clone the repository

git clone https://github.com/jbrowne7/javafx-algorithm-visualiser.git
cd javafx-algorithm-visualiser

2. Run using gradle wrapper

On Linux/macOS:

./gradlew run --args dijkstra

On Windows:

gradlew.bat run --args dijkstra

Usage

Run the application:

./gradlew run --args dijkstra

Project Structure

algorithm package

This package contains implementations of the different algorithms that this project can visualise All algorithms implement the Algorithm interface. Classes in this package:

  • Dijkstra
  • DFS (not yet implemented)

model package

This package contains the custom data structures used in the project. Classes in this package:

  • Edge
  • Graph
  • Node
  • StepResult (used to store the result of each step of the algorithm)
  • NodeEntry (used in the priority queue for Dijkstra)

ui package

This package contains the user interface components of the project. Classes in this package:

  • GraphVisualiser (places UI components for the graph visualisation)
  • GraphPane (builds the graph UI (nodes, edges, weights))
  • DistancesPane (builds the table with the distances to certain nodes)
  • StepButtonPane (builds the step button)

util package

This package contains utility classes and methods used throughout the project. Classes in this package:

  • AlgorithmFactory (creates instances of algorithms based on user input)
  • GraphBuilder (builds graphs from user input or predefined structures)
  • AppConfig (record for configuration settings)
  • AppContext (stored configuration settings as AppConfig)
  • ArgsParser (parses cmdline arguments)

Future Improvements:

  • Adding more algorithms (e.g. DFS, BFS)
  • Highlight the entry in the table that was just updated

About

A javaFX algorithm visualiser used to help users better understand graph-based algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages