(Scroll Down for English Description)
Simulator of the St. Petersburg metro. *Yandex Metro Clone

Handlers/Handlers.go downloads the Assets/Stations.json file, receives information about the station and distances between them, then fastens them to Index.TMPL, builds an unoriented balanced column on it. HomeHandler also retains the names of the stations and sorts them alphabetically.
Stations.json structure:
"st_g0" : {
"Name" : " Беговая " ,
"X" : 93 ,
"Y" : 140 ,
"Adj" : [ " st_g1 " ],
"Dist" : [ 4 ],
"Line" : " green " ,
"Shift" : " left " ,
"Dx" : 0 ,
"Dy" : 0
}Name, X, Y, Line means the name of the station, the position on XY and the color of the branch, respectively. Adj - stations that can be driven from this station, Dist - the fare to them, Shift - on which side is the text relative to X, Y. DX, DY - mixing the text according to X, Y.
FindrouteHandler (Handlers/Handlers.go) reads two lines from FROM, to from the index.tmpl form, finds a suitable station (see p. 3), finds the optimal route and its time.
The shortest way is using the Dijkstra/Dijkstra.go algorithm, which accepts the numbers of the stations in alphabetical order, returns the minimum time and an array from the numbers of stations that are included on this path.
example.
| From | To | Best Route | Duration |
|---|---|---|---|
| Gorky | Obvodny channel | Gorkovskaya, Nevsky, Avenue, Sennaya, Sadovaya, Zvenigorodskaya, Obvodny Canal | 18 minutes |

ShowruteHandler (Handlers/Handlers.go) builds a metro card, a 80%transparency effect is added to the ribs that are not included in the shortest route.
..* utils.entoru (s) - crushes the line, returns the line with replaced English letters in Russians who are on the same keyboard clamps.
..* getidx (s) - returns the most "similar" to S line of all the names of the stations. The S1 line is more like a line S than the S2 if the distance of Levenstein (utils.editdistance ()) between S1 and S less than between S2 and S.
Saint Petersburg Subway Simulator. *Yandex Metro Clone

Handlers/Handlers.go) Loads Assstes/Stations.json File Witch IS Describing Stations, Builds Graphs of States and Distances Between Them and Draw It. ALSO Homehandler Saves Stations Names and Sort Them in Alphabetic Order.
Stations.json Structure:
"st_g0" : {
"Name" : " Беговая " ,
"X" : 93 ,
"Y" : 140 ,
"Adj" : [ " st_g1 " ],
"Dist" : [ 4 ],
"Line" : " green " ,
"Shift" : " left " ,
"Dx" : 0 ,
"Dy" : 0
}Name, X, Y, Line Stands for Station Name, Xy Position and Color of Branch Respectively. Adj Is Array of States Connecting with this One. DIST - Time to Reach Them, Shift - Offseet Side of the Text. DX, DY - Text Shift by X and Y.
Findroutehandler (Handlers/Handlers.go) Reads Two String "From", "To" from the Form in Index.tmpl Page, Find the Station You Maan (P.3) and, Finally, Searsch the Best Route Between from and To.
Dijkstra algorithm (dijkstra/dijkstra.go) return the shortest path between two nodes.

ShowruteHandler (Handlers/Handlers.go) Builds Subway Map. Edges Wich Are not in Shortest Path Arewing Transparent.
Getidx (S) - Returns The Most Similar Stations Name to s. Similarity Between String S and String T is the Levenshtein Distance from S TO T. LEVENSHTEIN DISTANCE IS A String Metric for Measoring the Difference Between Two String.