Skip to content

Nathan-Jordan/Search-Algorithm-Visualisation-Tool

Repository files navigation

Search algorithm visualiser

This is a tool to aid with learning how search algorithms work by visualising an algorithm step by step.

Dependencies

This tool requires Java openjdk-19 to be installed.

https://www.oracle.com/java/technologies/downloads/

If Java runtime is installed you can just run the .jar file. If not, use "java -jar SearchAlgorithmVisualiser.jar".

Getting started

Once opened you should see a window like the below.

image

The left window (the main window) contains the graph and the right window contains the pseudocode

Usage

Main window

  • Left click to create a node.
  • Left click and move on a node node to move it.
  • Right click on a node or edge to remove it.
  • Right click and drag to draw edges between nodes, letting go of right click when hovering over another node.
  • Double left click on a node to set the node as a root/goal or unset the node type.

image

Pseudocode window

The pseudocode window is not interactive as is just there to provide help for learning a search algorithm.

Toolbar

Menu

The menu dropdown contains the following options:

  • Run Algorithm – Run the current search algorithm on the current graph and start the visualisation. (Disables graph edits and some menu items, until visualisation is stopped)
  • Clear Nodes – Remove all of the nodes in the graph.
  • Reset Nodes – Reset the states of all the nodes in the graph, for example, if the nodes are labelled as visited or explored.
  • Hide Pseudocode – Show or hide the pseudocode window.
  • Node Label Type – Change the labelling of the nodes to be either Numeric or Alphabetic.
  • Generate Random Graph - Generate a random graph triangulation with the entered number of nodes.

Algorithms

The algorithms dropdown contains the following options:

  • Breadth-First Search - Changes the current algorithm to BFS.
  • Dept-First Search - Changes the current algorithm to DFS.
  • Dijkstra's Algorithm - Changes the current algorithm to Dijkstra.
  • A* - Changes the current algorithm to A*.

Visualisation buttons

The buttons at the bottom of the main window are for when the search algorithm is being visualised, the Pause/Resume button will either pause or resume the visualisation, the << or >> buttons will step forwards or backwards through the visualisation by 1 step (only when paused), and the Stop button will stop visualisation entirely, allowing graph edits to take place.

Demonstration of usage

image

About

Search Algorithm Visualisation Tool

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages