We are an emerging railway company and we are planning to build a high-speed train network in Pakistan. We will try to connect many cities all over the country. We have made a list of all the feasible connections between cities, now we just need to program it. Time and distance of each connection is known. We are making a feasibility report and are still considering what will be the best way to go about laying the rail network. The possible options are:
-
We make the network with minimum rail required to connect all the cities. This way we can start off relatively cheap then later on, upgrade our network.
-
We start from a single city, connect it to its neighbours and slowly grow our network.
-
Keeping in view the convenience of all cities' populations, we should know the shortest paths between any 2 cities. Then, we can do cost-benefit analysis to find out what will be most profitable for us and for the public.
This is just a graphical project to better visualize what we seek to do.
NOTE: Distances and Time used are not real values. They are random values used only for demonstration purposes.
SFML is a graphic library for C++. It has been used here to display BFS and MST. In order to compile the .cpp file, the library will be needed. NOTE: If you don't have SFML, download the .exe file from the Releases in this repository. Run it in the same folder as the source code.
It contains names, latitudes and longitudes of 157 cities of Pakistan.
It reads the city names from the above file and adds only the specified number of cities into "cities.txt". Also, it fills "Input_Graph.txt" with edges with random weights. The # of edges are specified.
The actual .cpp code that does everything. It takes Pakistan's map as input from "Pakistan_Map_Province_Wise.jpg", font as input from "solidworks gdt.ttf", cities and their locations as input from "cities.txt" and the weighted edges as input from "Input_Graph.txt". Implemented algorithms include Floyd Warshall, Kruskal, BFS.