Skip to content

termlt/A-pathfinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” A* Pathfinding Visualizer

Java Swing Algorithm

An interactive Java application that visualizes the A* pathfinding algorithm in real-time

A* Pathfinding Demo

✨ Features

  • Interactive Grid: Click to add/remove walls and obstacles
  • Real-time Visualization: See the algorithm explore nodes step by step
  • Cost Display: Each node shows its F-cost and G-cost values
  • Simple Controls: Mouse clicks and keyboard shortcuts (check "Controls")

πŸš€ How to Run

  1. Make sure you have Java 8 or higher installed
  2. Download or clone this repository
  3. Compile:
    javac *.java
  4. Run:
    java Main

⌨️ Controls

  • Left Mouse Button: Add walls/obstacles
  • Right Mouse Button: Remove walls
  • Enter Key: Start the pathfinding algorithm
  • Reset Button: Clear the grid and start over

Visual Guide

Color Meaning
πŸ”΅ Blue Start Node
🟑 Yellow Goal Node
⚫ Dark Gray Wall/Obstacle
πŸ”΅ Light Blue Open Nodes (being considered)
🟠 Orange Checked Nodes (already evaluated)
🟒 Green Final Path

πŸ”§ Technical Details

  • Language: Java
  • GUI: Swing
  • Algorithm: A* (using Manhattan distance as the heuristic function)
  • Grid: 15x15 (customizable)

πŸ“œ Purpose

Built as an educational tool to help visualize how A* algorithm works.

About

An interactive Java application that visualizes the A* pathfinding algorithm in real-time

Topics

Resources

License

Stars

Watchers

Forks

Languages