Home Experiences Projects Awards Blogs
Back

Rush Hour Puzzle Solver

JavaFX Java

Description

This project is a solution to Tucil 3 of IF2211 - Strategy and Algorithm, Semester II 2024/2025. The program aims to solve the classic Rush Hour puzzle using various pathfinding algorithms, including Uniform Cost Search (UCS), Greedy Best First Search (GBFS), A*, and Beam Search.

The puzzle is loaded from a configuration file, and the program computes a sequence of moves to help the red car (or the designated goal vehicle) reach the exit. For informed search algorithms (GBFS, A*, Beam Search), the program provides two heuristic options: Manhattan Distance and Blocking Heuristic. These heuristics guide the search process to efficiently find a solution with fewer explored nodes.

The application includes two modes of operation:

  • Command-Line Interface (CLI), for a text-based interaction and output.
  • Graphical User Interface (GUI), built with JavaFX, which offers visual puzzle representation, animated step-by-step solutions, and real-time performance statistics.

Program Structure

├── README.md
├── RushHourSolver.zip
├── build
│   ├── RushHourSolver.jar
│   └── RushHourSolverCLI.jar
├── doc
│   ├── img
│   └── Tucil3_13523091_13523107.pdf
├── src
│   ├── algorithm
│   │   ├── AStar.java
│   │   ├── Algorithm.java
│   │   ├── BeamSearch.java
│   │   ├── GBFS.java
│   │   ├── SolutionPath.java
│   │   └── UCS.java
│   ├── cli
│   │   └── CLI.java
│   ├── gui
│   │   ├── LoadingController.java
│   │   ├── LoadingScreen.fxml
│   │   ├── MainController.java
│   │   ├── MainView.fxml
│   │   ├── RushHourApp.java
│   │   └── assets
│   ├── heuristic
│   │   ├── BlockingHeuristic.java
│   │   ├── Heuristic.java
│   │   └── ManhattanDistance.java
│   ├── model
│   │   ├── Board.java
│   │   ├── Move.java
│   │   ├── Piece.java
│   │   ├── Position.java
│   │   └── State.java
│   └── util
│       ├── BoardParser.java
│       ├── Constants.java
│       └── FileHandler.java
└── test
    ├── input
    └── output
  • src : contains the program's source code in .java files.
  • build : ontains the compiled .jar files for both the CLI and GUI versions, ready to be executed.
  • test : contains the testing results included in the assignment report.
  • doc : contains the assignment report and program documentation.

Author

NIM Nama Anggota Github
13523091 Carlo Angkisan carllix
13523107 Heleni Gratia M Tampubolon mineraleee