Skip to content

ferasqaq-dev/Geographic-Path-Finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Criteria Geographic Path Finder (Dijkstra Optimization)

A Java-based navigation desktop application engineered with a JavaFX graphical interface to calculate optimal travel paths across countries. The core routing engine implements an adapted Dijkstra's Algorithm capable of finding the shortest path based on three independent optimization priorities: Geographical Distance, Financial Cost, or Travel Time.


Technical Architecture & Design Decisions

1. Custom Min-Heap Implementation (minHeap.java)

Instead of relying on the standard Java PriorityQueue, this project features a custom-built binary Min-Heap array structure tailored specifically for tableEntry records.

  • Operates at $O(\log V)$ efficiency for extraction (removeMin) and insertion (insert).
  • Explicitly tracks and preserves spatial properties using primitive distance variables to minimize overhead during Dijkstra relaxation phases.

2. Algorithmic Flexibility (Multi-Weight Graph)

Most pathfinders optimize for a single static dimension. This engine adapts dynamically depending on the selected execution filter:

  • Distance Metric: Computes real-world physical boundaries using the Haversine Formula over real latitude and longitude coordinates ($\Delta \text{lat}, \Delta \text{lon}$) to account for the Earth's curvature ($R = 6371\text{ km}$).
  • Cost Metric: Evaluates edge costs dynamically mapped from localized adjacency pricing structures.
  • Time Metric: Computes duration matrices tracking explicit point-to-point transit times.

Key Features

  • Dynamic Network Ingestion: Reads structured vertex sets and heavily formatted raw spatial strings (countriesData.txt), dynamically scaling longitude/latitude to pixel coordinate offsets for physical UI maps.
  • Interactive Controls: Features dual-node validation where the target endpoint combobox dynamically populates only after a valid origin point is selected.
  • Visual Log Traceback: Reconstructs explicit path tracking sequences via chained linked-node lookups (getPath()) to output clean topological directional arrows directly into a terminal or text view window.

Project Structure

  • Node.java / Edge.java: Domain models representing coordinate vertices (real coordinates vs. UI layout coordinates) and directional weighted boundaries.
  • Graph.java: Encapsulates adjacency lists, dynamic storage arrays, and custom identity search algorithms for fast indexing.
  • tableEntry.java: Tracks state parameters for every unique vertex point (such as known markers, current path parents, total time, and distances).
  • MainController.java: Drives the JavaFX initialization layer, file readers, boundary scaling math, and layout action handlers.
  • Main.java: Provides a robust, standalone console-driven execution sequence to run test cases without invoking a graphical runtime frame.

Setup and Requirements

  1. Ensure Java Development Kit (JDK 11 or higher) and JavaFX modules are declared inside your module configuration.
  2. Update the hardcoded local file strings in Main.java and MainController.java to point to your data source:
    File f = new File("YOUR_LOCAL_PATH_TO\\countriesData.txt");

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages