Professor: Davide Martineghi
Execution Time: ~0.3s
Memory Usage: ~34 MiB
Grade: 30L/30L
Develop an efficient algorithm to compute a route with the fewest possible stops between two service stations. The stops consist of other service stations, each with its own fleet of vehicles. Each vehicle has a specific range.
| Grade | Memory | Time |
|---|---|---|
| 18 | 128 MiB | 19 s |
| 21 | 118 MiB | 15 s |
| 24 | 108 MiB | 10 s |
| 27 | 98 MiB | 6 s |
| 30 | 88 MiB | 4 s |
| 30L | 78 MiB | 1 s |
To create an efficient and memory-saving algorithm, I chose a tree structure where each node represents a service station.
Development Environment: CLion and compiler gcc.
I used Debian 11 as my OS to take advantage of Valgrind and ASan tools.
For debugging, I primarily relied on CLion’s built-in tools.