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.
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.
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.
- 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.
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 asknownmarkers, 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.
- Ensure Java Development Kit (JDK 11 or higher) and JavaFX modules are declared inside your module configuration.
- Update the hardcoded local file strings in
Main.javaandMainController.javato point to your data source:File f = new File("YOUR_LOCAL_PATH_TO\\countriesData.txt");