Skip to content

Palestine Map using classic Dijkstra shortest path algorithm for maps. Java | JavaFX

Notifications You must be signed in to change notification settings

sondosaabed/Palestine-Map

Repository files navigation

Palestine Map (Graph)

in this Java desktop project I have created Palestine Map. I have implemented the classic Dijkstra’s shortest path algorithm and optimize it for maps. Made it find route information between two cities in Palestine. User may choose the city through mouse or List. The path would appear on the map. This projects includes 50 cities.

Dijkstra’s algorithm

Dijkstra’s algorithm is a classic solution to the shortest path problem on a weighted graph. The basic idea is not difficult to understand. We maintain, for every vertex in the graph, the length of the shortest known path from the source to that vertex, and we maintain these lengths in a priority queue. Initially, we put all the vertices on the queue with an artificially high priority and then assign priority 0.0 to the source. The algorithm proceeds by taking the lowest-priority vertex off the PQ, then checking all the vertices that can be reached from that vertex by one edge to see whether that edge gives a shorter path to the vertex from the source than the shortest previously-known path. If so, it lowers the priority to reflect this new information.

Running the project

In order to run the project, needs the JavaFx library to be build on the projecet path.

File format example

The input files of the program contains as many cities as the user want.

file format: Cities:

00

Adjacents:

01

Programms versions

javafx.version=17.0.1,
Java.version=17.0.8

Program screenshot:

Browse for the inputs file:

1

Ready to run: (read the file correctly)

2

Map:

3

Get the shortest path using mouse (by click):

4

Get the shortest path using the list:

5

About

Palestine Map using classic Dijkstra shortest path algorithm for maps. Java | JavaFX

Topics

Resources

Stars

Watchers

Forks