Skip to content

showmidelo/Dijkstra

Repository files navigation

Dijkstra's algorithm

Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later.


we have a map that we want to make a graph with some vertices from it and their edges have weight (they could be time, Distances or etc).


we extract the Coordinates of vertices from Google Map and put it in a file that shows Quantity of vertices and edges, the identity of vertices and Coordinates of them, Connection of two vertices. like this:

33 33
1 35.7939386247039 51.529716260672124
2 35.793795036546236 51.53016150713691
3 35.79493070107018 51.531089558148224
4 35.79407169685162 51.532916086089784
5 35.793645278150116 51.53411771614739
6 35.79370401849901 51.53535153264036
8 35.794480712039146 51.53453345862103
9 35.79494411038281 51.53308238056171
10 35.794780940391746 51.53473730572242
11 35.79531178301682 51.53321649092744
12 35.7951007510979 51.5348821482753
13 35.79525086774967 51.53457637586212
14 35.79546624801462 51.53508867700197
16 35.79577735370356 51.53532471054082
18 35.795699031771065 51.53577263976478
19 35.79634734657284 51.53621788654253
20 35.796445247096756 51.53597112337474
21 35.796749822829646 51.536174974119
22 35.79656055133914 51.53563316431344
23 35.796989131158064 51.53689112265906
24 35.79725236987088 51.53589870076382
25 35.79755869319989 51.53508541277127
26 35.79534669886598 51.532334807538675
27 35.79554668482521 51.532456190253356
28 35.79578974358389 51.532877238264525
29 35.79561744725895 51.53165961547465
30 35.795734360349066 51.53138650248334
31 35.79587281540164 51.53198583078768
32 35.79607280164708 51.53206928107038
33 35.79617740997898 51.53222859680747
34 35.796340474105676 51.53180375419954
35 35.79733116504117 51.53252067790499
36 35.79711271997175 51.53198203503618
2 1
2 3
4 5
4 9
5 8
8 6
8 9
8 10
10 11
9 11
10 12
12 13
12 14
16 18
14 16
16 22
16 20
22 24
24 23
24 25
20 19
20 22
20 21
26 27
27 28
27 31
26 29
29 30
29 31
30 34
34 33
34 35
34 36
31 32

Output :

by these codes of Project we could find the shortest way between two vertices that client (it can be infinity) asked from the server and plot it to show to the client.

About

Find Shortest Path

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages