This is version 1.2 of the code: It has advanced functionality with minimal search costs for all points. The interface for the A* algorithm has been updated. The code structure is divided into separate files.
The following improvements are possible: Having adjusted the price accounting, we returned to the search for new ways when we reached a dead end. Displaying additional information. Adding a new control.
Note!: To run it, you need to install the official software Qt "https://github.com/qt"
- Launch Qt Creator 14.0.1 (Community).
- Creating a Qt widget-based application that contains Qt Widgets Designer and C++.
- The name of the project and the storage location are at your discretion.
- Build system: Cmake.
- Class name: MainWindow.
- Package: Desktop Qt 6.7.2 MinGW 64-bit.
- Copy the code provided above into your project: CMakeLists.txt , main.cpp and other folders.
- Rebuild the project.
- You can click on Analysis->Cmake Profiler.
- Launch the project or press CTRL + R.
Select any of the methods.
Select any two points and click on "Start calculation". The green dots show the shortest path from the points you have selected.
Select any one point and click on "Start calculation". The green dots show where your path started and where it ended. The yellow dots indicate how much you will spend on the way back, following the same route we started with.
Note: To view the prices in detail, you open the "Application Output" window in Qt by pressing Alt+3.
- Left-click on the dots.
- Right-click to deselect.
- The "Start calculation" button starts the calculation algorithm.
- The Reset button resets the path.
- The "Go back" button returns us to the main menu.
- In the upper-right corner of the window, write "Estimated fare".